- i18n: complete remaining internationalization across the UI

- Locales: add and align keys (common.enterValidValue, apiKeyInput.*, jsonEditor.*, claudeConfig.*); fix zh common.unknown mapping
- ProviderForm: localize labels/placeholders/hints/errors; unify JSON/auth validation to providerForm.*; add wizard CTA for Codex custom with i18n; cancel uses common.cancel
- CodexConfigEditor: i18n for quick wizard, labels/placeholders/hints, common config modal (title/help/buttons)
- ClaudeConfigEditor: i18n for main label, common-config toggle/button, modal title/help, footer buttons
- EndpointSpeedTest: localize failed/noEndpoints/done and aria labels
- ApiKeyInput: i18n for placeholder and show/hide aria
- JsonEditor: i18n linter messages
- PresetSelector: remove hardcoded defaults, use i18n keys
- UpdateBadge: i18n close aria
- Build/typecheck: pass; scan shows no visible hardcoded Chinese strings outside locales
This commit is contained in:
Jason
2025-10-07 23:31:00 +08:00
parent 420a4234de
commit 01da9a1eac
13 changed files with 425 additions and 154 deletions

View File

@@ -17,7 +17,25 @@
"loading": "Loading...",
"success": "Success",
"error": "Error",
"unknown": "Unknown"
"unknown": "Unknown",
"enterValidValue": "Please enter a valid value"
},
"apiKeyInput": {
"placeholder": "Enter API Key",
"show": "Show API Key",
"hide": "Hide API Key"
},
"jsonEditor": {
"mustBeObject": "Configuration must be a JSON object, not an array or other type",
"invalidJson": "Invalid JSON format"
},
"claudeConfig": {
"configLabel": "Claude Code settings.json (JSON) *",
"writeCommonConfig": "Write Common Config",
"editCommonConfig": "Edit Common Config",
"editCommonConfigTitle": "Edit Common Config Snippet",
"commonConfigHint": "This snippet will be merged into settings.json when 'Write Common Config' is checked",
"fullSettingsHint": "Full Claude Code settings.json content"
},
"header": {
"viewOnGithub": "View on GitHub",
@@ -96,7 +114,8 @@
"upToDate": "Up to Date",
"releaseNotes": "Release Notes",
"viewReleaseNotes": "View release notes for this version",
"viewCurrentReleaseNotes": "View current version release notes"
"viewCurrentReleaseNotes": "View current version release notes",
"exportFailedError": "Export config failed:"
},
"apps": {
"claude": "Claude Code",
@@ -120,5 +139,114 @@
"selectConfigDirFailed": "Failed to select config directory:",
"getDefaultConfigDirFailed": "Failed to get default config directory:",
"openReleaseNotesFailed": "Failed to open release notes:"
},
"providerForm": {
"supplierName": "Provider Name",
"supplierNameRequired": "Provider Name *",
"supplierNamePlaceholder": "e.g., Anthropic Official",
"websiteUrl": "Website URL",
"websiteUrlPlaceholder": "https://example.com (optional)",
"apiEndpoint": "API Endpoint",
"apiEndpointPlaceholder": "https://your-api-endpoint.com",
"codexApiEndpointPlaceholder": "https://your-api-endpoint.com/v1",
"manageAndTest": "Manage & Test",
"configContent": "Config Content",
"useConfigWizard": "Use Configuration Wizard",
"manualConfig": "Manually configure provider, requires complete configuration, or",
"officialNoApiKey": "Official login does not require API Key, save directly",
"codexOfficialNoApiKey": "Official does not require API Key, save directly",
"kimiApiKeyHint": "Fill in to get model list",
"apiKeyAutoFill": "Just fill in here, config below will be auto-filled",
"codexApiKeyAutoFill": "Just fill in here, auth.json below will be auto-filled",
"getApiKey": "Get API Key",
"parameterConfig": "Parameter Config - {{name}} *",
"mainModel": "Main Model (optional)",
"mainModelPlaceholder": "e.g., GLM-4.5",
"fastModel": "Fast Model (optional)",
"fastModelPlaceholder": "e.g., GLM-4.5-Air",
"modelHint": "💡 Leave blank to use provider's default model",
"apiHint": "💡 Fill in Claude API compatible service endpoint",
"fillSupplierName": "Please fill in provider name",
"fillConfigContent": "Please fill in configuration content",
"fillParameter": "Please fill in {{label}}",
"configJsonError": "Config JSON format error, please check syntax",
"authJsonRequired": "auth.json must be a JSON object",
"authJsonError": "auth.json format error, please check JSON syntax",
"fillAuthJson": "Please fill in auth.json configuration",
"fillApiKey": "Please fill in OPENAI_API_KEY",
"visitWebsite": "Visit {{url}}"
},
"endpointTest": {
"title": "API Endpoint Management",
"endpoints": "endpoints",
"autoSelect": "Auto Select",
"testSpeed": "Test",
"testing": "Testing",
"addEndpointPlaceholder": "https://api.example.com",
"done": "Done",
"noEndpoints": "No endpoints",
"failed": "Failed",
"enterValidUrl": "Please enter a valid URL",
"invalidUrlFormat": "Invalid URL format",
"onlyHttps": "Only HTTP/HTTPS supported",
"urlExists": "This URL already exists",
"saveFailed": "Save failed, please try again",
"loadEndpointsFailed": "Failed to load custom endpoints:",
"addEndpointFailed": "Failed to add custom endpoint:",
"removeEndpointFailed": "Failed to remove custom endpoint:",
"pleaseAddEndpoint": "Please add an endpoint first",
"testUnavailable": "Speed test unavailable",
"noResult": "No result returned",
"testFailed": "Speed test failed: {{error}}"
},
"codexConfig": {
"quickWizard": "Quick Configuration Wizard",
"authJson": "auth.json (JSON) *",
"authJsonPlaceholder": "{\n \"OPENAI_API_KEY\": \"sk-your-api-key-here\"\n}",
"authJsonHint": "Codex auth.json configuration content",
"configToml": "config.toml (TOML)",
"configTomlHint": "Codex config.toml configuration content",
"writeCommonConfig": "Write Common Config",
"editCommonConfig": "Edit Common Config",
"editCommonConfigTitle": "Edit Codex Common Config Snippet",
"commonConfigHint": "This snippet will be appended to the end of config.toml when 'Write Common Config' is checked",
"wizardHint": "Enter key parameters, the system will automatically generate standard auth.json and config.toml configuration.",
"apiKeyLabel": "API Key *",
"apiKeyPlaceholder": "sk-your-api-key-here",
"supplierNameLabel": "Provider Name *",
"supplierNamePlaceholder": "e.g., Codex Official",
"supplierNameHint": "Will be displayed in the provider list, can use Chinese",
"supplierCodeLabel": "Provider Code (English)",
"supplierCodePlaceholder": "custom (optional)",
"supplierCodeHint": "Will be used as identifier in config file, defaults to custom",
"apiUrlLabel": "API Request URL *",
"apiUrlPlaceholder": "https://your-api-endpoint.com/v1",
"websiteLabel": "Website URL",
"websitePlaceholder": "https://example.com",
"websiteHint": "Official website address (optional)",
"modelNameLabel": "Model Name *",
"modelNamePlaceholder": "gpt-5-codex",
"configPreview": "Configuration Preview",
"applyConfig": "Apply Configuration"
},
"kimiSelector": {
"modelConfig": "Model Configuration",
"mainModel": "Main Model",
"fastModel": "Fast Model",
"refreshModels": "Refresh Model List",
"pleaseSelectModel": "Please select a model",
"noModels": "No models available",
"fillApiKeyFirst": "Please fill in API Key first",
"requestFailed": "Request failed: {{error}}",
"invalidData": "Invalid response data format",
"fetchModelsFailed": "Failed to fetch model list",
"apiKeyHint": "💡 Fill in API Key to automatically fetch available model list"
},
"presetSelector": {
"title": "Select Configuration Type",
"custom": "Custom",
"customDescription": "Manually configure provider, requires complete configuration",
"officialDescription": "Official login, no API Key required",
"presetDescription": "Use preset configuration, only API Key required"
}
}

View File

@@ -17,7 +17,25 @@
"loading": "加载中...",
"success": "成功",
"error": "错误",
"unknown": "未知"
"unknown": "未知",
"enterValidValue": "请输入有效的内容"
},
"apiKeyInput": {
"placeholder": "请输入API Key",
"show": "显示API Key",
"hide": "隐藏API Key"
},
"jsonEditor": {
"mustBeObject": "配置必须是JSON对象不能是数组或其他类型",
"invalidJson": "JSON格式错误"
},
"claudeConfig": {
"configLabel": "Claude Code 配置 (JSON) *",
"writeCommonConfig": "写入通用配置",
"editCommonConfig": "编辑通用配置",
"editCommonConfigTitle": "编辑通用配置片段",
"commonConfigHint": "该片段会在勾选\"写入通用配置\"时合并到 settings.json 中",
"fullSettingsHint": "完整的 Claude Code settings.json 配置内容"
},
"header": {
"viewOnGithub": "在 GitHub 上查看",
@@ -96,7 +114,8 @@
"upToDate": "已是最新",
"releaseNotes": "更新日志",
"viewReleaseNotes": "查看该版本更新日志",
"viewCurrentReleaseNotes": "查看当前版本更新日志"
"viewCurrentReleaseNotes": "查看当前版本更新日志",
"exportFailedError": "导出配置失败:"
},
"apps": {
"claude": "Claude Code",
@@ -120,5 +139,114 @@
"selectConfigDirFailed": "选择配置目录失败:",
"getDefaultConfigDirFailed": "获取默认配置目录失败:",
"openReleaseNotesFailed": "打开更新日志失败:"
},
"providerForm": {
"supplierName": "供应商名称",
"supplierNameRequired": "供应商名称 *",
"supplierNamePlaceholder": "例如Anthropic 官方",
"websiteUrl": "官网地址",
"websiteUrlPlaceholder": "https://example.com可选",
"apiEndpoint": "请求地址",
"apiEndpointPlaceholder": "https://your-api-endpoint.com",
"codexApiEndpointPlaceholder": "https://your-api-endpoint.com/v1",
"manageAndTest": "管理与测速",
"configContent": "配置内容",
"useConfigWizard": "使用配置向导",
"manualConfig": "手动配置供应商,需要填写完整的配置信息,或者",
"officialNoApiKey": "官方登录无需填写 API Key直接保存即可",
"codexOfficialNoApiKey": "官方无需填写 API Key直接保存即可",
"kimiApiKeyHint": "填写后可获取模型列表",
"apiKeyAutoFill": "只需要填这里,下方配置会自动填充",
"codexApiKeyAutoFill": "只需要填这里,下方 auth.json 会自动填充",
"getApiKey": "获取 API Key",
"parameterConfig": "参数配置 - {{name}} *",
"mainModel": "主模型 (可选)",
"mainModelPlaceholder": "例如: GLM-4.5",
"fastModel": "快速模型 (可选)",
"fastModelPlaceholder": "例如: GLM-4.5-Air",
"modelHint": "💡 留空将使用供应商的默认模型",
"apiHint": "💡 填写兼容 Claude API 的服务端点地址",
"fillSupplierName": "请填写供应商名称",
"fillConfigContent": "请填写配置内容",
"fillParameter": "请填写 {{label}}",
"configJsonError": "配置JSON格式错误请检查语法",
"authJsonRequired": "auth.json 必须是 JSON 对象",
"authJsonError": "auth.json 格式错误请检查JSON语法",
"fillAuthJson": "请填写 auth.json 配置",
"fillApiKey": "请填写 OPENAI_API_KEY",
"visitWebsite": "访问 {{url}}"
},
"endpointTest": {
"title": "请求地址管理",
"endpoints": "个端点",
"autoSelect": "自动选择",
"testSpeed": "测速",
"testing": "测速中",
"addEndpointPlaceholder": "https://api.example.com",
"done": "完成",
"noEndpoints": "暂无端点",
"failed": "失败",
"enterValidUrl": "请输入有效的 URL",
"invalidUrlFormat": "URL 格式不正确",
"onlyHttps": "仅支持 HTTP/HTTPS",
"urlExists": "该地址已存在",
"saveFailed": "保存失败,请重试",
"loadEndpointsFailed": "加载自定义端点失败:",
"addEndpointFailed": "添加自定义端点失败:",
"removeEndpointFailed": "删除自定义端点失败:",
"pleaseAddEndpoint": "请先添加端点",
"testUnavailable": "测速功能不可用",
"noResult": "未返回结果",
"testFailed": "测速失败: {{error}}"
},
"codexConfig": {
"quickWizard": "快速配置向导",
"authJson": "auth.json (JSON) *",
"authJsonPlaceholder": "{\n \"OPENAI_API_KEY\": \"sk-your-api-key-here\"\n}",
"authJsonHint": "Codex auth.json 配置内容",
"configToml": "config.toml (TOML)",
"configTomlHint": "Codex config.toml 配置内容",
"writeCommonConfig": "写入通用配置",
"editCommonConfig": "编辑通用配置",
"editCommonConfigTitle": "编辑 Codex 通用配置片段",
"commonConfigHint": "该片段会在勾选'写入通用配置'时追加到 config.toml 末尾",
"wizardHint": "输入关键参数,系统将自动生成标准的 auth.json 和 config.toml 配置。",
"apiKeyLabel": "API 密钥 *",
"apiKeyPlaceholder": "sk-your-api-key-here",
"supplierNameLabel": "供应商名称 *",
"supplierNamePlaceholder": "例如Codex 官方",
"supplierNameHint": "将显示在供应商列表中,可使用中文",
"supplierCodeLabel": "供应商代号(英文)",
"supplierCodePlaceholder": "custom可选",
"supplierCodeHint": "将用作配置文件中的标识符,默认为 custom",
"apiUrlLabel": "API 请求地址 *",
"apiUrlPlaceholder": "https://your-api-endpoint.com/v1",
"websiteLabel": "官网地址",
"websitePlaceholder": "https://example.com",
"websiteHint": "官方网站地址(可选)",
"modelNameLabel": "模型名称 *",
"modelNamePlaceholder": "gpt-5-codex",
"configPreview": "配置预览",
"applyConfig": "应用配置"
},
"kimiSelector": {
"modelConfig": "模型配置",
"mainModel": "主模型",
"fastModel": "快速模型",
"refreshModels": "刷新模型列表",
"pleaseSelectModel": "请选择模型",
"noModels": "暂无模型",
"fillApiKeyFirst": "请先填写 API Key",
"requestFailed": "请求失败: {{error}}",
"invalidData": "返回数据格式错误",
"fetchModelsFailed": "获取模型列表失败",
"apiKeyHint": "💡 填写 API Key 后将自动获取可用模型列表"
},
"presetSelector": {
"title": "选择配置类型",
"custom": "自定义",
"customDescription": "手动配置供应商,需要填写完整的配置信息",
"officialDescription": "官方登录,不需要填写 API Key",
"presetDescription": "使用预设配置,只需填写 API Key"
}
}