From 6d8e822f8d4503c853f8b64b9936af7dde57d78f Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 13 Nov 2025 17:08:05 +0800 Subject: [PATCH] refactor(i18n): remove unnecessary translation for brand names - Use hardcoded "Claude", "Codex", "Gemini" instead of i18n keys - Brand names should not be translated across different locales - Simplifies code by removing useTranslation hook from AppSwitcher - Reduces maintenance overhead in translation files --- src/components/AppSwitcher.tsx | 8 +++----- src/components/mcp/McpFormModal.tsx | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/components/AppSwitcher.tsx b/src/components/AppSwitcher.tsx index 010bce4..f7ac954 100644 --- a/src/components/AppSwitcher.tsx +++ b/src/components/AppSwitcher.tsx @@ -1,6 +1,5 @@ import type { AppId } from "@/lib/api"; import { ClaudeIcon, CodexIcon, GeminiIcon } from "./BrandIcons"; -import { useTranslation } from "react-i18next"; interface AppSwitcherProps { activeApp: AppId; @@ -8,7 +7,6 @@ interface AppSwitcherProps { } export function AppSwitcher({ activeApp, onSwitch }: AppSwitcherProps) { - const { t } = useTranslation(); const handleSwitch = (app: AppId) => { if (app === activeApp) return; onSwitch(app); @@ -33,7 +31,7 @@ export function AppSwitcher({ activeApp, onSwitch }: AppSwitcherProps) { : "text-gray-500 dark:text-gray-400 group-hover:text-[#D97757] dark:group-hover:text-[#D97757] transition-colors duration-200" } /> - {t("apps.claude")} + Claude ); diff --git a/src/components/mcp/McpFormModal.tsx b/src/components/mcp/McpFormModal.tsx index 81871f5..12a5305 100644 --- a/src/components/mcp/McpFormModal.tsx +++ b/src/components/mcp/McpFormModal.tsx @@ -111,8 +111,7 @@ const McpFormModal: React.FC = ({ // 判断是否使用 TOML 格式 const useToml = appId === "codex"; - const syncTargetLabel = - appId === "claude" ? t("apps.codex") : t("apps.claude"); + const syncTargetLabel = appId === "claude" ? "Codex" : "Claude"; const otherAppType: AppId = appId === "claude" ? "codex" : "claude"; const syncCheckboxId = useMemo(() => `sync-other-side-${appId}`, [appId]);