diff options
Diffstat (limited to 'core/js/l10n.js')
-rw-r--r-- | core/js/l10n.js | 18 |
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); } }, |