- {t("providerPreset.label", { defaultValue: "预设供应商" })}
+ {t("providerPreset.label")}
{/* 自定义按钮 */}
@@ -41,7 +41,7 @@ export function ProviderPresetSelector({
: "bg-gray-100 dark:bg-gray-800 text-gray-500 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"
}`}
>
- {t("providerPreset.custom", { defaultValue: "自定义配置" })}
+ {t("providerPreset.custom")}
{/* 预设按钮 */}
diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json
index 739df61..f5a7d69 100644
--- a/src/i18n/locales/en.json
+++ b/src/i18n/locales/en.json
@@ -73,13 +73,15 @@
"sortUpdateFailed": "Failed to update sort order",
"configureUsage": "Configure usage query",
"name": "Provider Name",
+ "namePlaceholder": "e.g., Claude Official",
"websiteUrl": "Website URL",
"configJson": "Config JSON",
"writeCommonConfig": "Write common config",
"editCommonConfigButton": "Edit common config",
"configJsonHint": "Please fill in complete Claude Code configuration",
"editCommonConfigTitle": "Edit common config snippet",
- "editCommonConfigHint": "Common config snippet will be merged into all providers that enable it"
+ "editCommonConfigHint": "Common config snippet will be merged into all providers that enable it",
+ "addProvider": "Add Provider"
},
"notifications": {
"providerSaved": "Provider configuration saved",
@@ -297,6 +299,48 @@
"other": "Other",
"hint": "You can continue to adjust the fields below after selecting a preset."
},
+ "usage": {
+ "queryFailed": "Query failed",
+ "refreshUsage": "Refresh usage",
+ "planUsage": "Plan usage",
+ "invalid": "Expired",
+ "total": "Total:",
+ "used": "Used:",
+ "remaining": "Remaining:"
+ },
+ "usageScript": {
+ "title": "Configure Usage Query",
+ "enableUsageQuery": "Enable usage query",
+ "presetTemplate": "Preset template",
+ "queryScript": "Query script (JavaScript)",
+ "timeoutSeconds": "Timeout (seconds)",
+ "scriptHelp": "Script writing instructions:",
+ "configFormat": "Configuration format:",
+ "extractorFormat": "Extractor return format (all fields optional):",
+ "tips": "💡 Tips:",
+ "testing": "Testing...",
+ "testScript": "Test script",
+ "format": "Format",
+ "saveConfig": "Save config",
+ "scriptEmpty": "Script configuration cannot be empty",
+ "mustHaveReturn": "Script must contain return statement",
+ "testSuccess": "Test successful!",
+ "testFailed": "Test failed",
+ "formatSuccess": "Format successful",
+ "formatFailed": "Format failed",
+ "variablesHint": "Supported variables: {{apiKey}}, {{baseUrl}} | extractor function receives API response JSON object",
+ "fieldIsValid": "• isValid: Boolean, whether plan is valid",
+ "fieldInvalidMessage": "• invalidMessage: String, reason for expiration (shown when isValid is false)",
+ "fieldRemaining": "• remaining: Number, remaining quota",
+ "fieldUnit": "• unit: String, unit (e.g., \"USD\")",
+ "fieldPlanName": "• planName: String, plan name",
+ "fieldTotal": "• total: Number, total quota",
+ "fieldUsed": "• used: Number, used quota",
+ "fieldExtra": "• extra: String, custom display text",
+ "tip1": "• Variables {{apiKey}} and {{baseUrl}} are automatically replaced",
+ "tip2": "• Extractor function runs in sandbox environment, supports ES2020+ syntax",
+ "tip3": "• Entire config must be wrapped in () to form object literal expression"
+ },
"kimiSelector": {
"modelConfig": "Model Configuration",
"mainModel": "Main Model",
diff --git a/src/i18n/locales/zh.json b/src/i18n/locales/zh.json
index 09a6632..5857112 100644
--- a/src/i18n/locales/zh.json
+++ b/src/i18n/locales/zh.json
@@ -73,13 +73,15 @@
"sortUpdateFailed": "排序更新失败",
"configureUsage": "配置用量查询",
"name": "供应商名称",
+ "namePlaceholder": "例如:Claude 官方",
"websiteUrl": "官网链接",
"configJson": "配置 JSON",
"writeCommonConfig": "写入通用配置",
"editCommonConfigButton": "编辑通用配置",
"configJsonHint": "请填写完整的 Claude Code 配置",
"editCommonConfigTitle": "编辑通用配置片段",
- "editCommonConfigHint": "通用配置片段将合并到所有启用它的供应商配置中"
+ "editCommonConfigHint": "通用配置片段将合并到所有启用它的供应商配置中",
+ "addProvider": "添加供应商"
},
"notifications": {
"providerSaved": "供应商配置已保存",
@@ -297,6 +299,48 @@
"other": "其他",
"hint": "选择预设后可继续调整下方字段。"
},
+ "usage": {
+ "queryFailed": "查询失败",
+ "refreshUsage": "刷新用量",
+ "planUsage": "套餐用量",
+ "invalid": "已失效",
+ "total": "总:",
+ "used": "使用:",
+ "remaining": "剩余:"
+ },
+ "usageScript": {
+ "title": "配置用量查询",
+ "enableUsageQuery": "启用用量查询",
+ "presetTemplate": "预设模板",
+ "queryScript": "查询脚本(JavaScript)",
+ "timeoutSeconds": "超时时间(秒)",
+ "scriptHelp": "脚本编写说明:",
+ "configFormat": "配置格式:",
+ "extractorFormat": "extractor 返回格式(所有字段均为可选):",
+ "tips": "💡 提示:",
+ "testing": "测试中...",
+ "testScript": "测试脚本",
+ "format": "格式化",
+ "saveConfig": "保存配置",
+ "scriptEmpty": "脚本配置不能为空",
+ "mustHaveReturn": "脚本必须包含 return 语句",
+ "testSuccess": "测试成功!",
+ "testFailed": "测试失败",
+ "formatSuccess": "格式化成功",
+ "formatFailed": "格式化失败",
+ "variablesHint": "支持变量: {{apiKey}}, {{baseUrl}} | extractor 函数接收 API 响应的 JSON 对象",
+ "fieldIsValid": "• isValid: 布尔值,套餐是否有效",
+ "fieldInvalidMessage": "• invalidMessage: 字符串,失效原因说明(当 isValid 为 false 时显示)",
+ "fieldRemaining": "• remaining: 数字,剩余额度",
+ "fieldUnit": "• unit: 字符串,单位(如 \"USD\")",
+ "fieldPlanName": "• planName: 字符串,套餐名称",
+ "fieldTotal": "• total: 数字,总额度",
+ "fieldUsed": "• used: 数字,已用额度",
+ "fieldExtra": "• extra: 字符串,扩展字段,可自由补充需要展示的文本",
+ "tip1": "• 变量 {{apiKey}} 和 {{baseUrl}} 会自动替换",
+ "tip2": "• extractor 函数在沙箱环境中执行,支持 ES2020+ 语法",
+ "tip3": "• 整个配置必须用 () 包裹,形成对象字面量表达式"
+ },
"kimiSelector": {
"modelConfig": "模型配置",
"mainModel": "主模型",