Fix loading locale data

This commit is contained in:
Cohee 2024-05-13 15:56:37 +03:00
parent 297519c401
commit cd47f3b238
1 changed files with 3 additions and 1 deletions

View File

@ -5,7 +5,9 @@ const storageKey = 'language';
const overrideLanguage = localStorage.getItem(storageKey);
const localeFile = String(overrideLanguage || navigator.language || navigator.userLanguage || 'en').toLowerCase();
const langs = await fetch('/locales/lang.json').then(response => response.json());
const localeData = await getLocaleData(localeFile);
// Don't change to let/const! It will break module loading.
// eslint-disable-next-line prefer-const
var localeData = await getLocaleData(localeFile);
/**
* Fetches the locale data for the given language.