mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-13 12:55:19 +00:00
index
This commit is contained in:
parent
c26b4b0f6c
commit
42eb59ab4e
3 changed files with 7 additions and 7 deletions
|
|
@ -173,10 +173,10 @@
|
||||||
<div>
|
<div>
|
||||||
<div class="text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2">
|
<div class="text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2">
|
||||||
<span class="w-3 h-3 rounded bg-blue-500 shadow-[0_0_8px_rgba(59,130,246,0.6)]"></span>
|
<span class="w-3 h-3 rounded bg-blue-500 shadow-[0_0_8px_rgba(59,130,246,0.6)]"></span>
|
||||||
Chat Filter & Import
|
记录筛选与导入
|
||||||
</div>
|
</div>
|
||||||
<div class="text-sm text-gray-500 dark:text-gray-400 mt-1">
|
<div class="text-sm text-gray-500 dark:text-gray-400 mt-1">
|
||||||
导入 JSON 数组,筛选所需的聊天记录,自动下载并导入。
|
筛选所需的聊天记录
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
|
|
@ -191,7 +191,7 @@
|
||||||
<div class="space-y-4">
|
<div class="space-y-4">
|
||||||
<div class="rounded-2xl border border-gray-100 dark:border-gray-800 bg-white dark:bg-gray-900 p-4 space-y-3">
|
<div class="rounded-2xl border border-gray-100 dark:border-gray-800 bg-white dark:bg-gray-900 p-4 space-y-3">
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<div class="text-sm font-semibold text-gray-800 dark:text-gray-100">1. 读取文件 (JSON Array)</div>
|
<div class="text-sm font-semibold text-gray-800 dark:text-gray-100">1. 读取文件</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ export const initI18n = (defaultLocale?: string | undefined) => {
|
||||||
const detectionOrder = defaultLocale
|
const detectionOrder = defaultLocale
|
||||||
? ['querystring', 'localStorage']
|
? ['querystring', 'localStorage']
|
||||||
: ['querystring', 'localStorage', 'navigator'];
|
: ['querystring', 'localStorage', 'navigator'];
|
||||||
const fallbackDefaultLocale = defaultLocale ? [defaultLocale] : ['en-US'];
|
const fallbackDefaultLocale = defaultLocale ? [defaultLocale] : ['zh-CN'];
|
||||||
|
|
||||||
const loadResource = (language: string, namespace: string) =>
|
const loadResource = (language: string, namespace: string) =>
|
||||||
import(`./locales/${language}/${namespace}.json`);
|
import(`./locales/${language}/${namespace}.json`);
|
||||||
|
|
@ -67,7 +67,7 @@ export const initI18n = (defaultLocale?: string | undefined) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const lang = i18next?.language || defaultLocale || 'en-US';
|
const lang = i18next?.language || defaultLocale || 'zh-CN';
|
||||||
document.documentElement.setAttribute('lang', lang);
|
document.documentElement.setAttribute('lang', lang);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -602,7 +602,7 @@
|
||||||
// Initialize i18n even if we didn't get a backend config,
|
// Initialize i18n even if we didn't get a backend config,
|
||||||
// so `/error` can show something that's not `undefined`.
|
// so `/error` can show something that's not `undefined`.
|
||||||
|
|
||||||
initI18n(localStorage?.locale);
|
initI18n(localStorage?.locale ?? 'zh-CN');
|
||||||
if (!localStorage.locale) {
|
if (!localStorage.locale) {
|
||||||
const languages = await getLanguages();
|
const languages = await getLanguages();
|
||||||
const browserLanguages = navigator.languages
|
const browserLanguages = navigator.languages
|
||||||
|
|
@ -610,7 +610,7 @@
|
||||||
: [navigator.language || navigator.userLanguage];
|
: [navigator.language || navigator.userLanguage];
|
||||||
const lang = backendConfig.default_locale
|
const lang = backendConfig.default_locale
|
||||||
? backendConfig.default_locale
|
? backendConfig.default_locale
|
||||||
: bestMatchingLanguage(languages, browserLanguages, 'en-US');
|
: bestMatchingLanguage(languages, browserLanguages, 'zh-CN');
|
||||||
changeLanguage(lang);
|
changeLanguage(lang);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue