i18n
This commit is contained in:
parent
764d0c0526
commit
ac111154fe
7 changed files with 183 additions and 0 deletions
12
src/lib/i18n/index.ts
Normal file
12
src/lib/i18n/index.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { browser } from '$app/environment';
|
||||
import { init, register } from 'svelte-i18n';
|
||||
|
||||
const defaultLocale = 'en';
|
||||
|
||||
register('en', () => import('./locales/en.json'));
|
||||
register('fr', () => import('./locales/fr.json'));
|
||||
|
||||
init({
|
||||
fallbackLocale: defaultLocale,
|
||||
initialLocale: browser ? window.navigator.language : defaultLocale
|
||||
});
|
0
src/lib/i18n/locales/en.json
Normal file
0
src/lib/i18n/locales/en.json
Normal file
0
src/lib/i18n/locales/fr.json
Normal file
0
src/lib/i18n/locales/fr.json
Normal file
Loading…
Add table
Add a link
Reference in a new issue