From 3dce407f4f994af0f9f8a635097c30a0fec91d5a Mon Sep 17 00:00:00 2001 From: Christian Kaisermann Date: Wed, 20 Nov 2019 02:09:27 -0300 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20use=20new=20register=20?= =?UTF-8?q?and=20waitLocale=20methods?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- example/src/i18n.js | 10 +++++----- example/src/routes/_layout.svelte | 2 +- example/src/routes/about/index.svelte | 10 +++++----- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index ae54b9a..78b7f9e 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,9 @@ ## TODO - WIP -- [ ] Maybe locale can be a promise so we can await for it on the template; +- [x] Maybe locale can be a promise so we can await for it on the template; - [ ] Wiki on github; -- [ ] Find a more flexible way to preload dictionaries so it's possible to preload partial dictionaries. +- [x] Find a more flexible way to preload dictionaries so it's possible to preload partial dictionaries. ## Usage diff --git a/example/src/i18n.js b/example/src/i18n.js index d6ebe1e..b745f1f 100644 --- a/example/src/i18n.js +++ b/example/src/i18n.js @@ -1,6 +1,6 @@ -import { registerLocaleLoader } from 'svelte-i18n' +import { register } from 'svelte-i18n' -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')) +register('en', () => import('../messages/en.json')) +register('pt-BR', () => import('../messages/pt-BR.json')) +register('en-US', () => import('../messages/en-US.json')) +register('es-ES', () => import('../messages/es-ES.json')) diff --git a/example/src/routes/_layout.svelte b/example/src/routes/_layout.svelte index 9234774..01d1f8c 100644 --- a/example/src/routes/_layout.svelte +++ b/example/src/routes/_layout.svelte @@ -1,5 +1,5 @@