diff options
author | Morris Jobke <hey@morrisjobke.de> | 2019-01-29 10:55:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-29 10:55:30 +0100 |
commit | 2682d672d8076302da61fef3cc15e4d647d50be5 (patch) | |
tree | 12c09f80ad9636316f8479081cf5370f4353c700 /core/src/globals.js | |
parent | 34d5001e2f04d45c4b22583f8838930962f25cf4 (diff) | |
parent | d0cd0918b9bd0813b38b861e21714fda18eaa621 (diff) | |
download | nextcloud-server-2682d672d8076302da61fef3cc15e4d647d50be5.tar.gz nextcloud-server-2682d672d8076302da61fef3cc15e4d647d50be5.zip |
Merge pull request #13878 from nextcloud/refactor/oc-appconfig-eventsource-l10n
Move OC.AppConfig, OC.EventSource and OC.L10N to the server bundle
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); |