From a320ec3efba37bd62944dfa73bf67dca057b6d90 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 25 Feb 2016 14:20:59 -0500 Subject: [PATCH] closes #4178 --- public/src/modules/translator.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/public/src/modules/translator.js b/public/src/modules/translator.js index fcf6553768..58c8ef6f26 100644 --- a/public/src/modules/translator.js +++ b/public/src/modules/translator.js @@ -27,8 +27,18 @@ translator.addTranslation = function(language, filename, translations) { languages[language] = languages[language] || {}; languages[language].loaded = languages[language].loaded || {}; - languages[language].loaded[filename] = translations; languages[language].loading = languages[language].loading || {}; + + if (languages[language].loaded[filename]) { + var existing = languages[language].loaded[filename]; + for (var t in translations) { + if (translations.hasOwnProperty(t)) { + languages[language].loaded[filename][t] = translations[t]; + } + } + } else { + languages[language].loaded[filename] = translations; + } }; translator.getTranslations = function(language, filename, callback) {