Initial commit

This commit is contained in:
Djuri 2024-03-17 18:35:26 +01:00
commit ba5370c7ca
36 changed files with 4122 additions and 0 deletions

17
src/lib/i18n/index.ts Normal file
View 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
});