i18n(zai): localize entrypoint labels and model descriptions; use i18n keys in UI; keep brand string 'Z AI' unlocalized

This commit is contained in:
Hannes Rudolph 2025-09-18 13:50:11 -06:00
parent 7bc72915cb
commit 3ad654de9a
5 changed files with 48 additions and 3 deletions

View file

@ -102,12 +102,20 @@ export const ModelInfoView = ({
const infoItems = shouldShowTierPricingTable ? baseInfoItems : [...baseInfoItems, ...priceInfoItems]
// Localize provider-specific model descriptions when available
const zaiDescKey = `settings:providers.zaiModels.${selectedModelId}.description`
const zaiLocalizedDesc = apiProvider === "zai" ? t(zaiDescKey) : undefined
const descriptionToUse =
apiProvider === "zai" && zaiLocalizedDesc && zaiLocalizedDesc !== zaiDescKey
? zaiLocalizedDesc
: modelInfo?.description
return (
<>
{modelInfo?.description && (
{descriptionToUse && (
<ModelDescriptionMarkdown
key="description"
markdown={modelInfo.description}
markdown={descriptionToUse}
isExpanded={isDescriptionExpanded}
setIsExpanded={setIsDescriptionExpanded}
/>

View file

@ -38,9 +38,10 @@ export const ZAi = ({ apiConfiguration, setApiConfigurationField }: ZAiProps) =>
className={cn("w-full")}>
{zaiApiLineSchema.options.map((zaiApiLine) => {
const config = zaiApiLineConfigs[zaiApiLine]
const label = t(`settings:providers.zaiEntrypointOptions.${zaiApiLine}`)
return (
<VSCodeOption key={zaiApiLine} value={zaiApiLine} className="p-2">
{config.name} ({config.baseUrl})
{label} ({config.baseUrl})
</VSCodeOption>
)
})}

View file

@ -294,6 +294,18 @@
"getZaiApiKey": "Get Z AI API Key",
"zaiEntrypoint": "Z AI Entrypoint",
"zaiEntrypointDescription": "Please select the appropriate API entrypoint based on your location. If you are in China, choose open.bigmodel.cn. Otherwise, choose api.z.ai.",
"zaiEntrypointOptions": {
"international": "International",
"china": "China"
},
"zaiModels": {
"glm-4.5": {
"description": "GLM-4.5 is Zhipu's latest featured model. Its comprehensive capabilities in reasoning, coding, and agent reach the state-of-the-art (SOTA) level among open-source models, with a context length of up to 128k."
},
"glm-4.5-air": {
"description": "GLM-4.5-Air is the lightweight version of GLM-4.5. It balances performance and cost-effectiveness, and can flexibly switch to hybrid thinking models."
}
},
"geminiApiKey": "Gemini API Key",
"getGroqApiKey": "Get Groq API Key",
"groqApiKey": "Groq API Key",

View file

@ -295,6 +295,18 @@
"getZaiApiKey": "获取 Z AI API 密钥",
"zaiEntrypoint": "Z AI 服务站点",
"zaiEntrypointDescription": "请根据您的位置选择适当的 API 服务站点。如果您在中国,请选择 open.bigmodel.cn。否则,请选择 api.z.ai。",
"zaiEntrypointOptions": {
"international": "国际",
"china": "中国"
},
"zaiModels": {
"glm-4.5": {
"description": "GLM-4.5 是智谱最新的旗舰模型。在推理、编程与智能体方面具备领先能力,达到了开源模型的先进水平,支持最长 128k 上下文。"
},
"glm-4.5-air": {
"description": "GLM-4.5-Air 是 GLM-4.5 的轻量版,在性能与成本之间取得良好平衡,并可灵活切换到混合思维模式。"
}
},
"geminiApiKey": "Gemini API 密钥",
"getGroqApiKey": "获取 Groq API 密钥",
"groqApiKey": "Groq API 密钥",

View file

@ -295,6 +295,18 @@
"getZaiApiKey": "取得 Z AI API 金鑰",
"zaiEntrypoint": "Z AI 服務端點",
"zaiEntrypointDescription": "請根據您的位置選擇適當的 API 服務端點。如果您在中國,請選擇 open.bigmodel.cn。否則,請選擇 api.z.ai。",
"zaiEntrypointOptions": {
"international": "國際",
"china": "中國"
},
"zaiModels": {
"glm-4.5": {
"description": "GLM-4.5 是智譜最新的旗艦模型,在推理、程式設計與智能體方面具備頂尖能力,達到開源模型的先進水準,支援最長 128k 上下文。"
},
"glm-4.5-air": {
"description": "GLM-4.5‑Air 是 GLM-4.5 的輕量版,在效能與成本之間取得平衡,並可彈性切換至混合思維模式。"
}
},
"geminiApiKey": "Gemini API 金鑰",
"getGroqApiKey": "取得 Groq API 金鑰",
"groqApiKey": "Groq API 金鑰",