fix(i18n): complete Simplified Chinese UI translations

This commit is contained in:
Dillon
2026-10-05 16:12:49 +08:00
parent f24bb523e8
commit eb91f18683
6 changed files with 705 additions and 612 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

@@ -15,6 +15,13 @@ test("Settings language selector switches General labels", async ({ page }) => {
await page.getByRole("menuitem", { name: "简体中文 - Simplified Chinese", exact: true }).click();
await expect(page.getByText("默认发送", { exact: true }).first()).toBeVisible();
await expect(page.getByText(/智能体运行时,Enter/).first()).toBeVisible();
const screenshotPath = test.info().outputPath("simplified-chinese-settings.png");
await page.screenshot({ path: screenshotPath, fullPage: true });
await test.info().attach("simplified-chinese-settings", {
path: screenshotPath,
contentType: "image/png",
});
await page.getByRole("button", { name: "简体中文", exact: true }).click();
await page.getByRole("menuitem", { name: "English - 英语", exact: true }).click();
+27 -1
View File
@@ -129,6 +129,32 @@ describe("translation resources", () => {
expect(countMatchingEnglishStrings(zhCN)).toBeLessThan(maxFallbackStrings);
});
it("limits Chinese English matches to names, identifiers, and command examples", () => {
const englishStrings = flattenStrings(en);
const chineseStrings = flattenStrings(zhCN);
const matchingKeys = Object.entries(englishStrings)
.filter(([key, value]) => chineseStrings[key] === value)
.map(([key]) => key)
.sort();
expect(matchingKeys).toEqual(
[
"sidebar.help.discord",
"sidebar.help.appName",
"desktop.daemon.status.pid",
"settings.general.language.options.en",
"settings.appearance.theme.options.zinc",
"settings.appearance.theme.options.midnight",
"settings.appearance.theme.options.claude",
"settings.appearance.theme.options.ghostty",
"settings.host.appearance.preview.workspaceName",
"settings.host.terminalProfiles.namePlaceholder",
"settings.host.terminalProfiles.commandPlaceholder",
"settings.host.terminalProfiles.argsPlaceholder",
].sort(),
);
});
it("localizes the pull request empty state in every supported language", () => {
for (const resource of [ar, es, fr, ja, ko, ptBR, ru, zhCN]) {
expect(resource.panels.pullRequest.emptyTitle).not.toBe(en.panels.pullRequest.emptyTitle);
@@ -175,7 +201,7 @@ describe("translation resources", () => {
expect(ja.settings.providers.models.many).toBe("{{count}}つのモデル");
expect(ptBR.settings.providers.models.many).toBe("{{count}} modelos");
expect(ru.settings.providers.models.many).toBe("{{count}} моделей");
expect(zhCN.settings.providers.models.many).toBe("{{count}} 个 Model");
expect(zhCN.settings.providers.models.many).toBe("{{count}} 个模型");
});
it("preserves reviewed Korean status labels", () => {
@@ -396,7 +396,15 @@ export const pluginSettings = {
},
},
"zh-CN": {
...shared,
logs: {
action: "日志",
title: "日志:{{id}}",
loading: "正在加载日志…",
refresh: "刷新",
refreshing: "正在刷新…",
errorTitle: "无法加载插件日志",
empty: "暂无插件输出",
},
screens: {
open: "打开",
offline: "连接到此主机以打开插件设置。",
File diff suppressed because it is too large Load Diff