diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2016-02-26 15:56:02 +0300 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2016-02-26 15:56:02 +0300 |
commit | 78570a5f728bb0b16ddea31f8ca8cfc212144246 (patch) | |
tree | 9c224f450511dab16d4b2a8ceb46ad4743223eef /core | |
parent | 5718402277b3d9a8bd688e3fbbf965bcf19addbe (diff) |
Allow to overwrite a single language string via the theme folder
Diffstat (limited to 'core')
-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 + }); } }, |