From 8d65dbdd04b39f6d2830a708bfb843b1d006a44e Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" <219766164+opencode-agent[bot]@users.noreply.github.com> Date: Fri, 7 Aug 2026 03:06:23 +0000 Subject: [PATCH] fix(app): complete translation coverage (#40981) Co-authored-by: Hona <10430890+Hona@users.noreply.github.com> --- packages/app/AGENTS.md | 3 +++ .../app/src/components/dialog-usage-exceeded.tsx | 4 +++- packages/app/src/components/titlebar.tsx | 2 +- packages/app/src/i18n/ar.ts | 13 +++++++++++++ packages/app/src/i18n/az.ts | 13 +++++++++++++ packages/app/src/i18n/br.ts | 13 +++++++++++++ packages/app/src/i18n/bs.ts | 13 +++++++++++++ packages/app/src/i18n/da.ts | 13 +++++++++++++ packages/app/src/i18n/de.ts | 13 +++++++++++++ packages/app/src/i18n/en.ts | 1 + packages/app/src/i18n/es.ts | 13 +++++++++++++ packages/app/src/i18n/fi.ts | 13 +++++++++++++ packages/app/src/i18n/fr.ts | 13 +++++++++++++ packages/app/src/i18n/hi.ts | 13 +++++++++++++ packages/app/src/i18n/id.ts | 13 +++++++++++++ packages/app/src/i18n/it.ts | 13 +++++++++++++ packages/app/src/i18n/ja.ts | 13 +++++++++++++ packages/app/src/i18n/ko.ts | 13 +++++++++++++ packages/app/src/i18n/nl.ts | 13 +++++++++++++ packages/app/src/i18n/no.ts | 13 +++++++++++++ packages/app/src/i18n/pa.ts | 13 +++++++++++++ packages/app/src/i18n/parity.test.ts | 2 +- packages/app/src/i18n/pl.ts | 13 +++++++++++++ packages/app/src/i18n/ru.ts | 13 +++++++++++++ packages/app/src/i18n/sv.ts | 13 +++++++++++++ packages/app/src/i18n/th.ts | 13 +++++++++++++ packages/app/src/i18n/tr.ts | 13 +++++++++++++ packages/app/src/i18n/uk.ts | 13 +++++++++++++ packages/app/src/i18n/ur.ts | 13 +++++++++++++ packages/app/src/i18n/vi.ts | 13 +++++++++++++ packages/app/src/i18n/zh.ts | 13 +++++++++++++ packages/app/src/i18n/zht.ts | 13 +++++++++++++ packages/desktop/AGENTS.md | 2 ++ 33 files changed, 362 insertions(+), 3 deletions(-) diff --git a/packages/app/AGENTS.md b/packages/app/AGENTS.md index 2f587ea73d5..4972f2e3a6c 100644 --- a/packages/app/AGENTS.md +++ b/packages/app/AGENTS.md @@ -24,6 +24,9 @@ - NEVER hardcode user-visible English strings in production code. ALWAYS use an i18n key for visible copy, placeholders, accessible labels, tooltips, menus, dialogs, toasts, empty states, and displayed errors. - When migrating existing copy to i18n, preserve the English text byte-for-byte unless the task explicitly requests a copy change. - NEVER change existing English text or English keys to facilitate translation. English is intentional, designer-written source copy; adapt locale-specific translations and i18n mechanics around it. +- Keep locale complexity behind the shared typed i18n APIs. Feature and component code should use `language.t(...)` for ordinary copy and `language.plural(baseKey, count, params)` for count-sensitive copy. It must not inspect the locale, call `Intl.PluralRules`, construct or select plural-category keys such as `.one` or `.other`, or branch on locale-specific grammar. +- Prefer complete translated phrases. Do not concatenate grammatical fragments or make call sites assemble sentences. Keep placeholders to irreducible dynamic values such as names, paths, and counts. +- If a translation cannot be expressed by the current API, deepen the shared language/UI i18n module so one typed call owns locale selection, plural resolution, fallback, and interpolation. Do not leak that machinery into product code. - Do not translate from model knowledge alone. Verify terminology and grammar with Unicode CLDR locale/plural data, Microsoft Localization Style Guides and terminology, Apple localization/style guidance and localized platform UI, Mozilla localization style guides, Mozilla Pontoon, and the Firefox localization corpus at `github.com/mozilla-l10n/firefox-l10n`. - Also use the relevant language authority or official dictionary for the locale (for example RAE/Fundéu, FranceTerme, Duden, TDK, Kotus/Kielitoimiston sanakirja, Språkrådet/Bokmålsordboka, Rada Języka Polskiego/PWN, the Russian and Arabic language academies, the Ukrainian Orthography, Taiwan MOE dictionaries, or the Royal Society of Thailand). Treat the English dictionary as the semantic source of truth and preserve placeholders, code identifiers, product names, and keyboard labels. diff --git a/packages/app/src/components/dialog-usage-exceeded.tsx b/packages/app/src/components/dialog-usage-exceeded.tsx index bf5da751e22..de6451a63b6 100644 --- a/packages/app/src/components/dialog-usage-exceeded.tsx +++ b/packages/app/src/components/dialog-usage-exceeded.tsx @@ -1,4 +1,5 @@ import { usePlatform } from "@/context/platform" +import { useLanguage } from "@/context/language" import { Button } from "@opencode-ai/ui/button" import { useDialog } from "@opencode-ai/ui/context/dialog" import { Dialog } from "@opencode-ai/ui/dialog" @@ -14,6 +15,7 @@ export type DialogGoUpsellProps = { export function DialogUsageExceeded(props: DialogGoUpsellProps) { const dialog = useDialog() + const language = useLanguage() const platform = usePlatform() const runAction = () => { @@ -32,7 +34,7 @@ export function DialogUsageExceeded(props: DialogGoUpsellProps) {