🌐 Fixed language-detection

This commit is contained in:
Mawoka
2022-03-26 19:10:11 +01:00
parent 02c39edd45
commit 7f44911c6e
5 changed files with 109 additions and 91 deletions
+1 -11
View File
@@ -4,20 +4,10 @@
import { navbarVisible } from '$lib/stores.ts';
import * as Sentry from '@sentry/browser';
import { BrowserTracing } from '@sentry/tracing';
import { initLocalizationContext, getLocalization } from '$lib/i18n';
import { browser } from '$app/env';
import { initLocalizationContext } from '$lib/i18n';
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,