Compare commits

..

1 Commits

Author SHA1 Message Date
YoVinchen f71ab053b3 Restore auth tab localization in settings
The settings page already routes the auth tab label through the shared i18n key, but the locale bundles never defined that key. Adding the missing entries fixes the label with the same simple pattern used by the other tabs.

Constraint: Keep the fix aligned with the existing settings-tab i18n flow
Rejected: Add component-level bilingual rendering | unnecessary for a missing translation key
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: When adding settings tabs, define locale keys in every bundled language before relying on fallback text
Tested: pnpm format:check; pnpm typecheck
Not-tested: Manual verification in the desktop UI
2026-04-10 11:31:35 +08:00
4 changed files with 8 additions and 8 deletions
@@ -14,11 +14,10 @@ function parseModelsFromConfig(settingsConfig: string) {
const env = cfg?.env || {}; const env = cfg?.env || {};
const model = const model =
typeof env.ANTHROPIC_MODEL === "string" ? env.ANTHROPIC_MODEL : ""; typeof env.ANTHROPIC_MODEL === "string" ? env.ANTHROPIC_MODEL : "";
const explicitReasoning = const reasoning =
typeof env.ANTHROPIC_REASONING_MODEL === "string" typeof env.ANTHROPIC_REASONING_MODEL === "string"
? env.ANTHROPIC_REASONING_MODEL ? env.ANTHROPIC_REASONING_MODEL
: ""; : "";
const reasoning = explicitReasoning || model;
const small = const small =
typeof env.ANTHROPIC_SMALL_FAST_MODEL === "string" typeof env.ANTHROPIC_SMALL_FAST_MODEL === "string"
? env.ANTHROPIC_SMALL_FAST_MODEL ? env.ANTHROPIC_SMALL_FAST_MODEL
@@ -93,11 +92,10 @@ export function useModelState({
const env = cfg?.env || {}; const env = cfg?.env || {};
const model = const model =
typeof env.ANTHROPIC_MODEL === "string" ? env.ANTHROPIC_MODEL : ""; typeof env.ANTHROPIC_MODEL === "string" ? env.ANTHROPIC_MODEL : "";
const explicitReasoning = const reasoning =
typeof env.ANTHROPIC_REASONING_MODEL === "string" typeof env.ANTHROPIC_REASONING_MODEL === "string"
? env.ANTHROPIC_REASONING_MODEL ? env.ANTHROPIC_REASONING_MODEL
: ""; : "";
const reasoning = explicitReasoning || model;
const small = const small =
typeof env.ANTHROPIC_SMALL_FAST_MODEL === "string" typeof env.ANTHROPIC_SMALL_FAST_MODEL === "string"
? env.ANTHROPIC_SMALL_FAST_MODEL ? env.ANTHROPIC_SMALL_FAST_MODEL
@@ -150,17 +148,16 @@ export function useModelState({
? JSON.parse(settingsConfig) ? JSON.parse(settingsConfig)
: { env: {} }; : { env: {} };
if (!currentConfig.env) currentConfig.env = {}; if (!currentConfig.env) currentConfig.env = {};
const env = currentConfig.env as Record<string, unknown>;
// 新键仅写入;旧键不再写入 // 新键仅写入;旧键不再写入
const trimmed = value.trim(); const trimmed = value.trim();
if (trimmed) { if (trimmed) {
env[field] = trimmed; currentConfig.env[field] = trimmed;
} else { } else {
delete env[field]; delete currentConfig.env[field];
} }
// 删除旧键 // 删除旧键
delete env["ANTHROPIC_SMALL_FAST_MODEL"]; delete currentConfig.env["ANTHROPIC_SMALL_FAST_MODEL"];
onConfigChange(JSON.stringify(currentConfig, null, 2)); onConfigChange(JSON.stringify(currentConfig, null, 2));
} catch (err) { } catch (err) {
+1
View File
@@ -243,6 +243,7 @@
"title": "Settings", "title": "Settings",
"general": "General", "general": "General",
"tabGeneral": "General", "tabGeneral": "General",
"tabAuth": "Auth",
"tabAdvanced": "Advanced", "tabAdvanced": "Advanced",
"tabProxy": "Proxy", "tabProxy": "Proxy",
"authCenter": { "authCenter": {
+1
View File
@@ -243,6 +243,7 @@
"title": "設定", "title": "設定",
"general": "一般", "general": "一般",
"tabGeneral": "一般", "tabGeneral": "一般",
"tabAuth": "認証",
"tabAdvanced": "詳細", "tabAdvanced": "詳細",
"tabProxy": "プロキシ", "tabProxy": "プロキシ",
"authCenter": { "authCenter": {
+1
View File
@@ -243,6 +243,7 @@
"title": "设置", "title": "设置",
"general": "通用", "general": "通用",
"tabGeneral": "通用", "tabGeneral": "通用",
"tabAuth": "认证",
"tabAdvanced": "高级", "tabAdvanced": "高级",
"tabProxy": "代理", "tabProxy": "代理",
"authCenter": { "authCenter": {