diff --git a/package.json b/package.json index 73bb4e5..5e748de 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "svelte-i18n", - "version": "0.0.4", + "version": "0.0.5", "license": "MIT", "main": "dist/i18n.js", "module": "dist/i18n.m.js", diff --git a/src/index.js b/src/index.js index 01afef7..ee6cbae 100644 --- a/src/index.js +++ b/src/index.js @@ -7,8 +7,10 @@ export { capital, title, upper, lower } export function i18n(store, { dictionary: initialDictionary }) { const formatter = new Formatter() - let dictionary let currentLocale + let dictionary = Array.isArray(initialDictionary) + ? deepmerge.all(initialDictionary) + : initialDictionary const getLocalizedMessage = ( path, @@ -94,11 +96,5 @@ export function i18n(store, { dictionary: initialDictionary }) { }, } - if (Array.isArray(initialDictionary)) { - dictionary = deepmerge.all(initialDictionary) - } else { - initialDictionary = dictionary - } - return store }