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
This commit is contained in:
Jason
2025-11-13 17:08:05 +08:00
parent 2fae8c9275
commit 6d8e822f8d
2 changed files with 4 additions and 7 deletions

View File

@@ -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"
}
/>
<span>{t("apps.claude")}</span>
<span>Claude</span>
</button>
<button
@@ -46,7 +44,7 @@ export function AppSwitcher({ activeApp, onSwitch }: AppSwitcherProps) {
}`}
>
<CodexIcon size={16} />
<span>{t("apps.codex")}</span>
<span>Codex</span>
</button>
<button
@@ -66,7 +64,7 @@ export function AppSwitcher({ activeApp, onSwitch }: AppSwitcherProps) {
: "text-gray-500 dark:text-gray-400 group-hover:text-[#4285F4] dark:group-hover:text-[#4285F4] transition-colors duration-200"
}
/>
<span>{t("apps.gemini")}</span>
<span>Gemini</span>
</button>
</div>
);

View File

@@ -111,8 +111,7 @@ const McpFormModal: React.FC<McpFormModalProps> = ({
// 判断是否使用 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]);