当设备未连接时,各页面默认显示英文语言的文本,并在标题追加 (Disconnect)

This commit is contained in:
eafonyang
2026-07-01 11:23:06 +08:00
parent 8283ffcf14
commit ac7b5da0f0
20 changed files with 113 additions and 440 deletions
+3 -5
View File
@@ -11,8 +11,8 @@ import { cn } from "@/lib/utils";
import { readAndClearAiSplitRestorePath, useAIDrawer } from "@/contexts/AIDrawerContext";
import { useIsLgUp } from "@/hooks/useIsLgUp";
import localeZh from "@/locales/data-zh.json";
import localeZhHK from "@/locales/data-zh-HK.json";
import localeEn from "@/locales/data-en.json";
import { resolveLocalePack } from "@/locales/resolveLocale";
import {
Activity,
Bot,
@@ -49,10 +49,8 @@ export default function BottomNav() {
const { deviceState } = useDevice();
const navText = useMemo((): BottomNavLocale => {
const lang = deviceState?.language;
const pack =
lang === 0 ? localeEn : lang === 1 ? localeZhHK : localeZh;
return (pack.bottomNav ?? localeZh.bottomNav) as BottomNavLocale;
const pack = resolveLocalePack(deviceState?.language);
return (pack.bottomNav ?? localeEn.bottomNav) as BottomNavLocale;
}, [deviceState?.language]);
return (