Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2016-02-26 15:56:02 +0300
committerJoas Schilling <nickvergessen@owncloud.com>2016-02-26 15:56:02 +0300
commit78570a5f728bb0b16ddea31f8ca8cfc212144246 (patch)
tree9c224f450511dab16d4b2a8ceb46ad4743223eef /core
parent5718402277b3d9a8bd688e3fbbf965bcf19addbe (diff)
Allow to overwrite a single language string via the theme folder
Diffstat (limited to 'core')
-rw-r--r--core/js/l10n.js20
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
+ });
}
},