aboutsummaryrefslogtreecommitdiffstats
path: root/core/src/globals.js
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2019-01-29 10:55:30 +0100
committerGitHub <noreply@github.com>2019-01-29 10:55:30 +0100
commit2682d672d8076302da61fef3cc15e4d647d50be5 (patch)
tree12c09f80ad9636316f8479081cf5370f4353c700 /core/src/globals.js
parent34d5001e2f04d45c4b22583f8838930962f25cf4 (diff)
parentd0cd0918b9bd0813b38b861e21714fda18eaa621 (diff)
downloadnextcloud-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.js21
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);