aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2018-10-12 23:45:52 +0200
committerMax Kostikov <max@kostikov.co>2018-10-12 23:45:52 +0200
commit8cb05a91ab45e9cc572199cd3ab732e41f0b61b8 (patch)
treecbc306b2c51bda949a35c4b931308059d2ac1f21 /include
parent5f2c3f607eae07958e9c5ecc8b6166d29e00136f (diff)
downloadvolse-hubzilla-8cb05a91ab45e9cc572199cd3ab732e41f0b61b8.tar.gz
volse-hubzilla-8cb05a91ab45e9cc572199cd3ab732e41f0b61b8.tar.bz2
volse-hubzilla-8cb05a91ab45e9cc572199cd3ab732e41f0b61b8.zip
Update language.php
Diffstat (limited to 'include')
-rw-r--r--include/language.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/language.php b/include/language.php
index 69a7e3004..556752cf9 100644
--- a/include/language.php
+++ b/include/language.php
@@ -255,6 +255,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.
*