Initial commit
This commit is contained in:
commit
ba5370c7ca
36 changed files with 4122 additions and 0 deletions
17
src/lib/i18n/index.ts
Normal file
17
src/lib/i18n/index.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import { browser } from '$app/environment';
|
||||
import { init, register } from 'svelte-i18n';
|
||||
|
||||
const defaultLocale = 'en';
|
||||
|
||||
register('en', () => import('../locales/en.json'));
|
||||
register('nl', () => import('../locales/nl.json'));
|
||||
register('es', () => import('../locales/es.json'));
|
||||
|
||||
init({
|
||||
fallbackLocale: defaultLocale,
|
||||
initialLocale: browser
|
||||
? browser && localStorage.getItem('locale')
|
||||
? localStorage.getItem('locale')
|
||||
: window.navigator.language.slice(0, 2)
|
||||
: defaultLocale
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue