🚧 I18n

This commit is contained in:
Mawoka
2022-03-25 19:07:46 +01:00
parent 8f8e152c32
commit 8bf4b8cadf
2 changed files with 13 additions and 2 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ export class I18nService {
escapeValue: false
},
detection: {
order: ['querystring', 'navigator'],
order: ['browser', 'querystring', 'navigator', 'localStorage', 'htmlTag'],
lookupQuerystring: 'lng'
}
});
+12 -1
View File
@@ -4,9 +4,20 @@
import { navbarVisible } from '$lib/stores.ts';
import * as Sentry from '@sentry/browser';
import { BrowserTracing } from '@sentry/tracing';
import { initLocalizationContext } from '$lib/i18n';
import { initLocalizationContext, getLocalization } from '$lib/i18n';
import { browser } from '$app/env';
initLocalizationContext();
if (browser) {
if (localStorage.getItem('language') === null) {
localStorage.setItem('language', 'en');
} else {
const { currentLanguage } = getLocalization();
currentLanguage.set(localStorage.getItem('language'));
}
}
if (import.meta.env.VITE_SENTRY !== null) {
Sentry.init({
dsn: import.meta.env.VITE_SENTRY,