diff --git a/package-lock.json b/package-lock.json index 9836fc9..9c1a40d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@open-election-compass/client", - "version": "2.0.0-alpha.3", + "version": "2.0.0-alpha.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e5aa24d..e424d20 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@open-election-compass/client", - "version": "2.0.0-alpha.3", + "version": "2.0.0-alpha.4", "author": "Till Sanders ", "license": "GPL-3.0", "main": "dist/open-election-compass.umd.min.js", diff --git a/src/store/modules/languages/languages.js b/src/store/modules/languages/languages.js index 65ab360..3466a67 100644 --- a/src/store/modules/languages/languages.js +++ b/src/store/modules/languages/languages.js @@ -1,5 +1,6 @@ import getUserLocale from 'get-user-locale'; import i18n from '/src/locales/i18n'; +import cloneDeep from 'lodash/cloneDeep'; const officialLanguages = ['ar', 'de', 'en', 'es', 'fr', 'hu', 'id', 'it', 'nl', 'pl', 'pt', 'tr']; @@ -39,7 +40,7 @@ export default { ); } if (typeof language.overwrites === 'object' && language.overwrites !== null) { - i18n.global.mergeLocaleMessage(language.code, language.overwrites); + i18n.global.mergeLocaleMessage(language.code, cloneDeep(language.overwrites)); } state.languages.push({ code: language.code, @@ -70,10 +71,8 @@ export default { ...translations.content, ui: translations.ui, }); - console.log('overwriting', language, language.overwrites); if (typeof language.overwrites === 'object' && language.overwrites !== null) { - console.log('overwritten', language, language.overwrites); - i18n.global.mergeLocaleMessage(language.code, language.overwrites); + i18n.global.mergeLocaleMessage(language.code, cloneDeep(language.overwrites)); } }, setFallbackLanguage(state, code) {