Skip to content

Commit 3ad654d

Browse files
committed
i18n(zai): localize entrypoint labels and model descriptions; use i18n keys in UI; keep brand string 'Z AI' unlocalized
1 parent 7bc7291 commit 3ad654d

File tree

5 files changed

+48
-3
lines changed

5 files changed

+48
-3
lines changed

webview-ui/src/components/settings/ModelInfoView.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,20 @@ export const ModelInfoView = ({
102102

103103
const infoItems = shouldShowTierPricingTable ? baseInfoItems : [...baseInfoItems, ...priceInfoItems]
104104

105+
// Localize provider-specific model descriptions when available
106+
const zaiDescKey = `settings:providers.zaiModels.${selectedModelId}.description`
107+
const zaiLocalizedDesc = apiProvider === "zai" ? t(zaiDescKey) : undefined
108+
const descriptionToUse =
109+
apiProvider === "zai" && zaiLocalizedDesc && zaiLocalizedDesc !== zaiDescKey
110+
? zaiLocalizedDesc
111+
: modelInfo?.description
112+
105113
return (
106114
<>
107-
{modelInfo?.description && (
115+
{descriptionToUse && (
108116
<ModelDescriptionMarkdown
109117
key="description"
110-
markdown={modelInfo.description}
118+
markdown={descriptionToUse}
111119
isExpanded={isDescriptionExpanded}
112120
setIsExpanded={setIsDescriptionExpanded}
113121
/>

webview-ui/src/components/settings/providers/ZAi.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ export const ZAi = ({ apiConfiguration, setApiConfigurationField }: ZAiProps) =>
3838
className={cn("w-full")}>
3939
{zaiApiLineSchema.options.map((zaiApiLine) => {
4040
const config = zaiApiLineConfigs[zaiApiLine]
41+
const label = t(`settings:providers.zaiEntrypointOptions.${zaiApiLine}`)
4142
return (
4243
<VSCodeOption key={zaiApiLine} value={zaiApiLine} className="p-2">
43-
{config.name} ({config.baseUrl})
44+
{label} ({config.baseUrl})
4445
</VSCodeOption>
4546
)
4647
})}

webview-ui/src/i18n/locales/en/settings.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,18 @@
294294
"getZaiApiKey": "Get Z AI API Key",
295295
"zaiEntrypoint": "Z AI Entrypoint",
296296
"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.",
297+
"zaiEntrypointOptions": {
298+
"international": "International",
299+
"china": "China"
300+
},
301+
"zaiModels": {
302+
"glm-4.5": {
303+
"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."
304+
},
305+
"glm-4.5-air": {
306+
"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."
307+
}
308+
},
297309
"geminiApiKey": "Gemini API Key",
298310
"getGroqApiKey": "Get Groq API Key",
299311
"groqApiKey": "Groq API Key",

webview-ui/src/i18n/locales/zh-CN/settings.json

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/zh-TW/settings.json

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)