web: refactor and deduplicate locale preference logic

This commit is contained in:
dumbmoron
2024-07-20 14:37:52 +00:00
parent d4d4eded32
commit 8a080c55f6
7 changed files with 40 additions and 50 deletions

View File

@@ -1,6 +1,6 @@
import i18n from 'sveltekit-i18n';
import type { Config } from 'sveltekit-i18n'
import type { Config } from 'sveltekit-i18n';
import type {
GenericImport,
StructuredLocfileInfo,
@@ -45,6 +45,6 @@ const config: Config = {
export { defaultLocale };
export const {
t, loading, locales, locale, translations,
t, loading, locales, locale: INTERNAL_locale, translations,
loadTranslations, addTranslations, setLocale, setRoute
} = new i18n(config);