From 8cb05a91ab45e9cc572199cd3ab732e41f0b61b8 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 12 Oct 2018 23:45:52 +0200 Subject: Update language.php --- include/language.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/include/language.php b/include/language.php index 69a7e3004..556752cf9 100644 --- a/include/language.php +++ b/include/language.php @@ -254,6 +254,37 @@ function tt($singular, $plural, $count, $ctx = ''){ } } +/** + * @brief Return slash separated string of plurals translation form + * + * @param string $k key in translations array + * @return string + */ +function ta($k){ + + $t = App::$strings[$k]; + if (is_array($t)) { + return implode("/", $t); + } else { + return $k; + } +} + +/** + * @brief Return string_plural_select_xx function code + * + * @return string + */ +function tf() { + + $r = ''; + $lang = str_replace('-', '_', App::$language); + if(function_exists('string_plural_select_'.$lang)) { + $r = trim(shell_exec("sed -n '5p' view/".$lang."/hstrings.php | tr -d '$'")); + } + return $r; +} + /** * @brief Provide a fallback which will not collide with a function defined in * any language file. -- cgit v1.2.3