🚧 I18n
This commit is contained in:
@@ -33,7 +33,7 @@ export class I18nService {
|
|||||||
escapeValue: false
|
escapeValue: false
|
||||||
},
|
},
|
||||||
detection: {
|
detection: {
|
||||||
order: ['querystring', 'navigator'],
|
order: ['browser', 'querystring', 'navigator', 'localStorage', 'htmlTag'],
|
||||||
lookupQuerystring: 'lng'
|
lookupQuerystring: 'lng'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,9 +4,20 @@
|
|||||||
import { navbarVisible } from '$lib/stores.ts';
|
import { navbarVisible } from '$lib/stores.ts';
|
||||||
import * as Sentry from '@sentry/browser';
|
import * as Sentry from '@sentry/browser';
|
||||||
import { BrowserTracing } from '@sentry/tracing';
|
import { BrowserTracing } from '@sentry/tracing';
|
||||||
import { initLocalizationContext } from '$lib/i18n';
|
import { initLocalizationContext, getLocalization } from '$lib/i18n';
|
||||||
|
import { browser } from '$app/env';
|
||||||
|
|
||||||
initLocalizationContext();
|
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) {
|
if (import.meta.env.VITE_SENTRY !== null) {
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn: import.meta.env.VITE_SENTRY,
|
dsn: import.meta.env.VITE_SENTRY,
|
||||||
|
|||||||
Reference in New Issue
Block a user