mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-05-12 06:41:05 +08:00
fix(i18n): add providerAdvanced i18n keys and fix failover toast parameter
- Add providerAdvanced.* i18n keys to en.json, zh.json, and ja.json - Fix failover toggleFailed toast to pass detail parameter - Remove Chinese fallback text from UI for English/Japanese users
This commit is contained in:
@@ -96,9 +96,7 @@ pub fn convert_to_opencode_format(spec: &Value) -> Result<Value, AppError> {
|
||||
result.insert("enabled".into(), json!(true));
|
||||
}
|
||||
_ => {
|
||||
return Err(AppError::McpValidation(format!(
|
||||
"Unknown MCP type: {typ}"
|
||||
)));
|
||||
return Err(AppError::McpValidation(format!("Unknown MCP type: {typ}")));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -500,9 +500,7 @@ pub(crate) fn remove_opencode_provider_from_live(provider_id: &str) -> Result<()
|
||||
|
||||
// Check if OpenCode config directory exists
|
||||
if !opencode_config::get_opencode_dir().exists() {
|
||||
log::debug!(
|
||||
"OpenCode config directory doesn't exist, skipping removal of '{provider_id}'"
|
||||
);
|
||||
log::debug!("OpenCode config directory doesn't exist, skipping removal of '{provider_id}'");
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
|
||||
@@ -450,6 +450,22 @@
|
||||
"testFailed": "Speed test failed: {{error}}",
|
||||
"status": "Status: {{code}}"
|
||||
},
|
||||
"providerAdvanced": {
|
||||
"testConfig": "Model Test Config",
|
||||
"useCustomConfig": "Use separate config",
|
||||
"testConfigDesc": "Configure separate model testing parameters for this provider. Uses global settings when disabled.",
|
||||
"testModel": "Test Model",
|
||||
"testModelPlaceholder": "Leave empty to use global config",
|
||||
"timeoutSecs": "Timeout (seconds)",
|
||||
"testPrompt": "Test Prompt",
|
||||
"degradedThreshold": "Degraded Threshold (ms)",
|
||||
"maxRetries": "Max Retries",
|
||||
"proxyConfig": "Proxy Config",
|
||||
"useCustomProxy": "Use separate proxy",
|
||||
"proxyConfigDesc": "Configure separate network proxy for this provider. Uses system proxy or global settings when disabled.",
|
||||
"proxyUsername": "Username (optional)",
|
||||
"proxyPassword": "Password (optional)"
|
||||
},
|
||||
"codexConfig": {
|
||||
"authJson": "auth.json (JSON) *",
|
||||
"authJsonPlaceholder": "{\n \"OPENAI_API_KEY\": \"sk-your-api-key-here\"\n}",
|
||||
|
||||
@@ -450,6 +450,22 @@
|
||||
"testFailed": "速度テストに失敗しました: {{error}}",
|
||||
"status": "ステータス: {{code}}"
|
||||
},
|
||||
"providerAdvanced": {
|
||||
"testConfig": "モデルテスト設定",
|
||||
"useCustomConfig": "個別設定を使用",
|
||||
"testConfigDesc": "このプロバイダーに個別のモデルテストパラメータを設定します。無効の場合はグローバル設定を使用します。",
|
||||
"testModel": "テストモデル",
|
||||
"testModelPlaceholder": "空白の場合はグローバル設定を使用",
|
||||
"timeoutSecs": "タイムアウト(秒)",
|
||||
"testPrompt": "テストプロンプト",
|
||||
"degradedThreshold": "低下閾値(ミリ秒)",
|
||||
"maxRetries": "最大リトライ回数",
|
||||
"proxyConfig": "プロキシ設定",
|
||||
"useCustomProxy": "個別プロキシを使用",
|
||||
"proxyConfigDesc": "このプロバイダーに個別のネットワークプロキシを設定します。無効の場合はシステムプロキシまたはグローバル設定を使用します。",
|
||||
"proxyUsername": "ユーザー名(任意)",
|
||||
"proxyPassword": "パスワード(任意)"
|
||||
},
|
||||
"codexConfig": {
|
||||
"authJson": "auth.json (JSON) *",
|
||||
"authJsonPlaceholder": "{\n \"OPENAI_API_KEY\": \"sk-your-api-key-here\"\n}",
|
||||
|
||||
@@ -450,6 +450,22 @@
|
||||
"testFailed": "测速失败: {{error}}",
|
||||
"status": "状态码:{{code}}"
|
||||
},
|
||||
"providerAdvanced": {
|
||||
"testConfig": "模型测试配置",
|
||||
"useCustomConfig": "使用单独配置",
|
||||
"testConfigDesc": "为此供应商配置单独的模型测试参数,不启用时使用全局配置。",
|
||||
"testModel": "测试模型",
|
||||
"testModelPlaceholder": "留空使用全局配置",
|
||||
"timeoutSecs": "超时时间(秒)",
|
||||
"testPrompt": "测试提示词",
|
||||
"degradedThreshold": "降级阈值(毫秒)",
|
||||
"maxRetries": "最大重试次数",
|
||||
"proxyConfig": "代理配置",
|
||||
"useCustomProxy": "使用单独代理",
|
||||
"proxyConfigDesc": "为此供应商配置单独的网络代理,不启用时使用系统代理或全局设置。",
|
||||
"proxyUsername": "用户名(可选)",
|
||||
"proxyPassword": "密码(可选)"
|
||||
},
|
||||
"codexConfig": {
|
||||
"authJson": "auth.json (JSON) *",
|
||||
"authJsonPlaceholder": "{\n \"OPENAI_API_KEY\": \"sk-your-api-key-here\"\n}",
|
||||
|
||||
@@ -257,6 +257,7 @@ export function useSetAutoFailoverEnabled() {
|
||||
t("common.unknown", { defaultValue: "未知错误" });
|
||||
toast.error(
|
||||
t("failover.toggleFailed", {
|
||||
detail,
|
||||
defaultValue: `操作失败: ${detail}`,
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user