webui/src/lib/i18n/index.ts
2023-11-17 01:05:35 +01:00

13 lines
No EOL
381 B
TypeScript

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 ? window.navigator.language : defaultLocale,
})