i18n(html): sync html language with i18n language

This commit is contained in:
Timothy Jaeryang Baek
2025-02-28 16:06:28 -08:00
parent 88c02d5a14
commit fe44e4d344
3 changed files with 12 additions and 4 deletions

View File

@@ -40,7 +40,7 @@
import 'tippy.js/dist/tippy.css';
import { WEBUI_BASE_URL, WEBUI_HOSTNAME } from '$lib/constants';
import i18n, { initI18n, getLanguages } from '$lib/i18n';
import i18n, { initI18n, getLanguages, changeLanguage } from '$lib/i18n';
import { bestMatchingLanguage } from '$lib/utils';
import { getAllTags, getChatList } from '$lib/apis/chats';
import NotificationToast from '$lib/components/NotificationToast.svelte';
@@ -472,7 +472,7 @@
const lang = backendConfig.default_locale
? backendConfig.default_locale
: bestMatchingLanguage(languages, browserLanguages, 'en-US');
$i18n.changeLanguage(lang);
changeLanguage(lang);
}
if (backendConfig) {