diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-01-29 09:28:45 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-01-29 09:38:50 +0100 |
commit | d0cd0918b9bd0813b38b861e21714fda18eaa621 (patch) | |
tree | a194f3e4e39102ae5bba977cc157d92080d59911 /core/src/globals.js | |
parent | 3695d025755a69dbb4940eaa8de24ce3ca559c1b (diff) | |
download | nextcloud-server-d0cd0918b9bd0813b38b861e21714fda18eaa621.tar.gz nextcloud-server-d0cd0918b9bd0813b38b861e21714fda18eaa621.zip |
Move OC.L10n to the server bundle
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'core/src/globals.js')
-rw-r--r-- | core/src/globals.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/core/src/globals.js b/core/src/globals.js index a9884f335e0..5d077f22486 100644 --- a/core/src/globals.js +++ b/core/src/globals.js @@ -72,3 +72,24 @@ window['moment'] = moment window['OC'] = OC window['OCP'] = OCP window['OCA'] = OCA + +/** + * translate a string + * @param {string} app the id of the app for which to translate the string + * @param {string} text the string to translate + * @param [vars] map of placeholder key to value + * @param {number} [count] number to replace %n with + * @return {string} + */ +window.t = _.bind(OC.L10N.translate, OC.L10N); + +/** + * translate a string + * @param {string} app the id of the app for which to translate the string + * @param {string} text_singular the string to translate for exactly one object + * @param {string} text_plural the string to translate for n objects + * @param {number} count number to determine whether to use singular or plural + * @param [vars] map of placeholder key to value + * @return {string} Translated string + */ +window.n = _.bind(OC.L10N.translatePlural, OC.L10N); |