diff --git a/.prettierrc b/.prettierrc index 279ffd9..beaab0d 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,7 +1,7 @@ { "semi": false, "printWidth": 100, - "trailingComma": "all", + "trailingComma": "es5", "bracketSpacing": true, "jsxBracketSameLine": false, "singleQuote": true diff --git a/example/messages/en.json b/example/messages/en.json new file mode 100644 index 0000000..fb80aae --- /dev/null +++ b/example/messages/en.json @@ -0,0 +1,10 @@ +{ + "title": { + "index": "Sapper project template!" + }, + "messages": { + "success": "Great success!", + "high_five": "High five", + "try_editing": "Try editing this file (src/routes/index.svelte) to test live reloading." + } +} diff --git a/example/src/i18n.js b/example/src/i18n.js index 6c272fc..d6ebe1e 100644 --- a/example/src/i18n.js +++ b/example/src/i18n.js @@ -1,7 +1,6 @@ -import { dictionary } from 'svelte-i18n' +import { registerLocaleLoader } from 'svelte-i18n' -dictionary.set({ - 'pt-BR': () => import('../messages/pt-BR.json'), - 'en-US': () => import('../messages/en-US.json'), - 'es-ES': () => import('../messages/es-ES.json'), -}) +registerLocaleLoader('en', () => import('../messages/en.json')) +registerLocaleLoader('pt-BR', () => import('../messages/pt-BR.json')) +registerLocaleLoader('en-US', () => import('../messages/en-US.json')) +registerLocaleLoader('es-ES', () => import('../messages/es-ES.json')) diff --git a/example/src/routes/_layout.svelte b/example/src/routes/_layout.svelte index 5d8c826..9234774 100644 --- a/example/src/routes/_layout.svelte +++ b/example/src/routes/_layout.svelte @@ -30,16 +30,16 @@ } - - {loading} - +{loading}