diff options
Diffstat (limited to 'core/js/l10n.js')
-rw-r--r-- | core/js/l10n.js | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/core/js/l10n.js b/core/js/l10n.js index fb93d7b789e..c19f523b30e 100644 --- a/core/js/l10n.js +++ b/core/js/l10n.js @@ -66,13 +66,21 @@ 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 + _.each(bundle, function(translation, key) { + self._bundles[appName][key] = translation + }); } }, |