i18n: complete internationalization for provider and usage query panels

- Add 45+ new translation keys for usage query and usage script features
- Fix duplicate provider object in translation files that caused missing translations
- Remove all hardcoded Chinese text and defaultValue fallbacks from components
- Add proper translations for:
  * Usage footer (query status, plan usage display)
  * Usage script modal (script editor, validation, test controls)
  * Provider forms (basic fields, endpoints, model selectors)
  * Provider dialogs (add/edit hints and titles)

Modified 16 files:
- 2 translation files (zh.json, en.json)
- 14 component files (removed defaultValue, added t() calls)

All UI text now properly supports Chinese/English switching.
This commit is contained in:
Jason
2025-10-19 11:55:46 +08:00
parent bae6a1cf55
commit eb6948a562
16 changed files with 176 additions and 125 deletions

View File

@@ -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",