summaryrefslogtreecommitdiffstats
path: root/core/js/l10n.js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-03-01 08:26:28 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-03-01 08:26:28 +0100
commit71e5de3865f7f1c49feb5d94c0c658261bac38a3 (patch)
tree4ba1717769d9a0b59927a3df5c86573c8d312356 /core/js/l10n.js
parent91f01d2c7ed9f32e9326aeaca6b3f0c6dcfb0f64 (diff)
parent0091df2bc8eed432df9d726d5bea09ac527128d2 (diff)
downloadnextcloud-server-71e5de3865f7f1c49feb5d94c0c658261bac38a3.tar.gz
nextcloud-server-71e5de3865f7f1c49feb5d94c0c658261bac38a3.zip
Merge pull request #22677 from owncloud/allow-to-overwrite-single-l10n-string-via-theme
Allow to overwrite a single language string via the theme folder
Diffstat (limited to 'core/js/l10n.js')
-rw-r--r--core/js/l10n.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/core/js/l10n.js b/core/js/l10n.js
index fb93d7b789e..43cfc7e820f 100644
--- a/core/js/l10n.js
+++ b/core/js/l10n.js
@@ -66,13 +66,19 @@ OC.L10N = {
* @param {Function|String} [pluralForm] optional plural function or plural string
*/
register: function(appName, bundle, pluralForm) {
- this._bundles[appName] = bundle || {};
-
- if (_.isFunction(pluralForm)) {
- this._pluralFunctions[appName] = pluralForm;
+ var self = this;
+ if (_.isUndefined(this._bundles[appName])) {
+ this._bundles[appName] = bundle || {};
+
+ if (_.isFunction(pluralForm)) {
+ this._pluralFunctions[appName] = pluralForm;
+ } else {
+ // generate plural function based on form
+ this._pluralFunctions[appName] = this._generatePluralFunction(pluralForm);
+ }
} else {
- // generate plural function based on form
- this._pluralFunctions[appName] = this._generatePluralFunction(pluralForm);
+ // Theme overwriting the default language
+ _.extend(self._bundles[appName], bundle);
}
},