Merge branch 'patch-14' into 'dev'

Add date/time plurals translation in JavaScript

See merge request hubzilla/core!1336

(cherry picked from commit a2575059e2)

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
This commit is contained in:
Mario
2018-10-13 18:16:56 +00:00
parent 5310f4e310
commit eaee27c9e4
5 changed files with 65 additions and 27 deletions

View File

@@ -254,6 +254,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.