Quicksave
This commit is contained in:
@@ -22,15 +22,19 @@ export const getLocalization = () => {
|
||||
return getContext<I18nContext>(CONTEXT_KEY);
|
||||
};
|
||||
|
||||
export const initLocalizationContext = () => {
|
||||
export const initLocalizationContext = (start_lanugage: string): { i18n: I18nService } => {
|
||||
// Initialize our services
|
||||
const i18n = new I18nService();
|
||||
const tranlator = new I18NextTranslationService(i18n);
|
||||
|
||||
let locale: any;
|
||||
if (start_lanugage) {
|
||||
locale = start_lanugage;
|
||||
}
|
||||
tranlator.locale.set(locale);
|
||||
// skipcq: JS-0357
|
||||
setLocalization({
|
||||
t: tranlator.translate,
|
||||
currentLanguage: tranlator.locale
|
||||
currentLanguage: locale
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
@@ -49,8 +49,11 @@ SPDX-License-Identifier: MPL-2.0
|
||||
// // Whenever the user explicitly chooses to respect the OS preference
|
||||
// localStorage.removeItem('theme');
|
||||
}
|
||||
|
||||
initLocalizationContext();
|
||||
let start_language = 'en';
|
||||
if (browser) {
|
||||
start_language = localStorage.getItem('language') ?? 'en';
|
||||
}
|
||||
initLocalizationContext(start_language);
|
||||
|
||||
if (import.meta.env.VITE_SENTRY !== undefined && import.meta.env.PROD) {
|
||||
Sentry.init({
|
||||
@@ -67,8 +70,18 @@ SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
<svelte:head>
|
||||
{#if plausible_data_url}
|
||||
<script defer data-domain={plausible_data_url} src="https://plausible.nexus.mawoka.eu/js/script.file-downloads.outbound-links.pageview-props.tagged-events.js"></script>
|
||||
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
|
||||
<script
|
||||
defer
|
||||
data-domain={plausible_data_url}
|
||||
src="https://plausible.nexus.mawoka.eu/js/script.file-downloads.outbound-links.pageview-props.tagged-events.js"
|
||||
></script>
|
||||
<script>
|
||||
window.plausible =
|
||||
window.plausible ||
|
||||
function () {
|
||||
(window.plausible.q = window.plausible.q || []).push(arguments);
|
||||
};
|
||||
</script>
|
||||
{/if}
|
||||
</svelte:head>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user