]>
Commit | Line | Data |
---|---|---|
8050f772 BB |
1 | import { addMessages, getLocaleFromNavigator, init } from 'svelte-i18n'; |
2 | ||
3 | import en from './translations/en.json'; | |
862a5f9c | 4 | import es from './translations/es.json'; |
8050f772 BB |
5 | |
6 | addMessages('en', en); | |
862a5f9c | 7 | addMessages('es', es); |
8050f772 | 8 | |
be1ce532 RBR |
9 | const fallbackLocale = 'en'; |
10 | const browserLocale: string = getLocaleFromNavigator(); | |
11 | const initialLocale = browserLocale ? browserLocale.replace(/-[A-Z]{2}$/, '') : fallbackLocale; | |
12 | ||
8050f772 | 13 | init({ |
be1ce532 RBR |
14 | fallbackLocale, |
15 | initialLocale | |
8050f772 | 16 | }); |