mirror of
https://github.com/cupcakearmy/svelte-i18n.git
synced 2024-11-16 18:10:43 +01:00
Fix initialDictionary initialization
This commit is contained in:
parent
38dcecb724
commit
7dd50b7cf3
@ -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",
|
||||
|
10
src/index.js
10
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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user