aboutsummaryrefslogtreecommitdiffstats
path: root/include/language.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2018-10-13 18:16:56 +0000
committerMario <mario@mariovavti.com>2018-10-13 20:17:14 +0200
commiteaee27c9e4f7a533fea8e2cda7a0b2c7230a5dfb (patch)
treee86a90a27578d6dde289aa91ae5190b3e0024fef /include/language.php
parent5310f4e310f58e77cb3764c9174b627e406d7a66 (diff)
downloadvolse-hubzilla-eaee27c9e4f7a533fea8e2cda7a0b2c7230a5dfb.tar.gz
volse-hubzilla-eaee27c9e4f7a533fea8e2cda7a0b2c7230a5dfb.tar.bz2
volse-hubzilla-eaee27c9e4f7a533fea8e2cda7a0b2c7230a5dfb.zip
Merge branch 'patch-14' into 'dev'
Add date/time plurals translation in JavaScript See merge request hubzilla/core!1336 (cherry picked from commit a2575059e2a068a67cd984888422265c6888f261) 5c0d3187 Add date/time plurals translation in JavaScript 729d0d53 Update language.php f68674b3 Update js_strings.tpl 3ac4337a Update main.js e96e3dc6 Update po2php.php 54bdf59d Update js_strings.php
Diffstat (limited to 'include/language.php')
-rw-r--r--include/language.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/language.php b/include/language.php
index 69a7e3004..18b942bce 100644
--- a/include/language.php
+++ b/include/language.php
@@ -255,6 +255,32 @@ function tt($singular, $plural, $count, $ctx = ''){
}
/**
+ * @brief Return slash separated string of plurals translation forms
+ *
+ * @param string $k key in translations array
+ * @return string
+ */
+function ta($k){
+
+ $t = App::$strings[$k];
+ if (is_array($t))
+ $t = implode("/", $t);
+ return ($t == "" ? $k : $t);
+}
+
+/**
+ * @brief Return string_plural_select_xx function code
+ *
+ * @return string
+ */
+
+function tf() {
+
+ $s = "plural_function_code";
+ return (x(App::$strings, $s) ? App::$strings[$s] : "return 0;");
+}
+
+/**
* @brief Provide a fallback which will not collide with a function defined in
* any language file.
*