feat(app): add global locale coverage (#40992)

Co-authored-by: Luke Parker <10430890+Hona@users.noreply.github.com>
This commit is contained in:
opencode-agent[bot]
2026-08-07 05:41:11 +00:00
committed by GitHub
parent 4abddbbfdd
commit 741244b69d
143 changed files with 47929 additions and 334 deletions
+54 -1
View File
@@ -65,7 +65,16 @@ describe("translate app", () => {
"packages/ui/src/i18n/fr.ts",
"packages/desktop/src/renderer/i18n/fr.ts",
])
expect(targetFiles("tr")).toEqual(["packages/app/src/i18n/tr.ts", "packages/ui/src/i18n/tr.ts"])
expect(targetFiles("tr")).toEqual([
"packages/app/src/i18n/tr.ts",
"packages/ui/src/i18n/tr.ts",
"packages/desktop/src/renderer/i18n/tr.ts",
])
expect(targetFiles("dv")).toEqual([
"packages/app/src/i18n/dv.ts",
"packages/ui/src/i18n/dv.ts",
"packages/desktop/src/renderer/i18n/dv.ts",
])
})
test("maps product locale codes to their glossaries", () => {
@@ -83,6 +92,48 @@ describe("translate app", () => {
).toEqual({ missing: ["missing"], extra: ["extra"], placeholders: ["changed"] })
})
test("accepts locale-specific CLDR plural variants", () => {
expect(
findDrift(
{ "files.one": "{{count}} file", "files.other": "{{count}} files" },
{
"files.one": "{{count}} ملف",
"files.two": "ملفان: {{count}}",
"files.few": "{{count}} ملفات",
"files.many": "{{count}} ملفًا",
"files.zero": "{{count}} ملف",
"files.other": "{{count}} ملف",
},
"ar",
),
).toEqual({ missing: [], extra: [], placeholders: [] })
})
test("reports missing locale-specific CLDR plural variants", () => {
const drift = findDrift(
{ "files.one": "{{count}} file", "files.other": "{{count}} files" },
{ "files.one": "{{count}} ملف", "files.other": "{{count}} ملف" },
"ar",
)
expect(drift.missing).toContain("files.few")
})
test("reports placeholder drift in locale-specific CLDR plural variants", () => {
const drift = findDrift(
{ "files.one": "{{count}} file", "files.other": "{{count}} files" },
{
"files.one": "{{count}} ملف",
"files.two": "ملفان: {{count}}",
"files.few": "{{count}} ملفات",
"files.many": "ملفات كثيرة",
"files.zero": "{{count}} ملف",
"files.other": "{{count}} ملف",
},
"ar",
)
expect(drift.placeholders).toContain("files.many")
})
test("runs work with the requested maximum concurrency", async () => {
const active = new Set<number>()
const peaks: number[] = []
@@ -143,6 +194,8 @@ opencode/next
expect(config.share).toBe("disabled")
expect(config.formatter).toBe(false)
expect(config.lsp).toBe(false)
expect(config.agent["translate-app-fr"].permission.webfetch).toBe("allow")
expect(config.agent["translate-app-fr"].permission.websearch).toBe("allow")
expect(config.agent["translate-app-fr"].permission.edit).toEqual({
"*": "deny",
"packages/app/src/i18n/fr.ts": "allow",