Extends the i18n infra from #97 (Settings screen only) to the rest of the app: session chat screen, connection add/edit/list screens, sessions list (incl. directory grouping from #96), navigation titles, notifications category metadata, error boundary, telemetry consent modal, auth gate, and every chat UI component (permission/question prompts, status indicator, model/variant pickers, directory switcher/browser, reasoning block, tool call card, session info). - 244 new keys added to en.json/zh-Hans.json with reviewed, natural Simplified Chinese (not machine-garbage), keeping key sets identical. - User content, server URLs, code snippets, log/error-detail text, and diagnostics-classify.ts (pure dependency-free module feeding Sentry/ support reports) are intentionally left untranslated per scope. - Interpolation used for counts/names (e.g. reconnect attempt, files count, connection name in delete confirmations); categoryMeta/ CONNECTION_TYPES switched to labelKey indirection since they're module-level constants evaluated before i18next is guaranteed ready. - Added src/lib/i18n/catalog-parity.test.ts (node --test) asserting en.json/zh-Hans.json expose identical key sets and no empty values, to catch future locale drift. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
50 lines
1.5 KiB
TypeScript
50 lines
1.5 KiB
TypeScript
import { Tabs } from "expo-router"
|
|
import { useColorScheme } from "react-native"
|
|
import { Ionicons } from "@expo/vector-icons"
|
|
import { useTranslation } from "react-i18next"
|
|
|
|
export default function TabLayout() {
|
|
const colorScheme = useColorScheme()
|
|
const isDark = colorScheme === "dark"
|
|
const { t } = useTranslation()
|
|
|
|
return (
|
|
<Tabs
|
|
screenOptions={{
|
|
tabBarActiveTintColor: isDark ? "#ffffff" : "#0a0a0a",
|
|
tabBarInactiveTintColor: isDark ? "#666666" : "#999999",
|
|
tabBarStyle: {
|
|
backgroundColor: isDark ? "#0a0a0a" : "#ffffff",
|
|
borderTopColor: isDark ? "#1a1a1a" : "#e5e5e5",
|
|
},
|
|
headerStyle: {
|
|
backgroundColor: isDark ? "#0a0a0a" : "#ffffff",
|
|
},
|
|
headerTintColor: isDark ? "#ffffff" : "#0a0a0a",
|
|
}}
|
|
>
|
|
<Tabs.Screen
|
|
name="index"
|
|
options={{
|
|
title: t("nav.sessionsTab"),
|
|
tabBarIcon: ({ color, size }) => <Ionicons name="chatbubbles-outline" size={size} color={color} />,
|
|
}}
|
|
/>
|
|
<Tabs.Screen
|
|
name="connections"
|
|
options={{
|
|
title: t("nav.connectionsTab"),
|
|
tabBarIcon: ({ color, size }) => <Ionicons name="server-outline" size={size} color={color} />,
|
|
}}
|
|
/>
|
|
<Tabs.Screen
|
|
name="settings"
|
|
options={{
|
|
title: t("nav.settingsTab"),
|
|
tabBarIcon: ({ color, size }) => <Ionicons name="settings-outline" size={size} color={color} />,
|
|
}}
|
|
/>
|
|
</Tabs>
|
|
)
|
|
}
|