]> git.r.bdr.sh - rbdr/forum/blob - src/lib/i18n.ts
5dd533a911999bff9b4454c1009992c576106d56
[rbdr/forum] / src / lib / i18n.ts
1 import { addMessages, getLocaleFromNavigator, init } from 'svelte-i18n';
2
3 import en from './translations/en.json';
4 import es from './translations/es.json';
5
6 addMessages('en', en);
7 addMessages('es', es);
8
9 init({
10 fallbackLocale: 'en',
11 initialLocale: getLocaleFromNavigator().replace(/-[A-Z]{2}$/, '')
12 });