Skip to content

fix(i18n): correct Catalan (ca) locale and add ca glossary - #42842

Closed
Qjammer wants to merge 1 commit into
anomalyco:devfrom
Qjammer:fix/catalan-locale
Closed

fix(i18n): correct Catalan (ca) locale and add ca glossary#42842
Qjammer wants to merge 1 commit into
anomalyco:devfrom
Qjammer:fix/catalan-locale

Conversation

@Qjammer

@Qjammer Qjammer commented Aug 16, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #42837

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

I'm a native Catalan speaker. The ca locale added in #40992 has strings that say something
different from the English, not merely awkward ones:

Key English Was What it said
ui.basicTool.called Called {{tool}} Es diu {{tool}} "it is named", not invoked
settings.general.row.showCustomAgents.title Show agent Agent d'espectacles "entertainment agent"
provider.connect.method.apiKey (×4) API key tecla API "API keyboard-key"
settings.general.row.shell.title Terminal shell Carcassa terminal "terminal casing"
context.stats.inputTokens (×6) Input Tokens Fitxes d'entrada "input filing-cards"
context.breakdown.tool Tool Calls Trucades d'eines "phone calls of tools"

Three self-inconsistencies too: shell was rendered five different ways; web switched gender
inside a single popover; and workspace.resetting.title / workspace.reset.success.title were
byte-identical, so in-progress and finished were indistinguishable.

The rest is grammar. Catalan uses the singular imperative for menu and button labels, and the
vós plural for messages addressed to the user (Softcatalà style guide, Formes verbals). The
locale mixed them arbitrarily — desktop.menu.restart was Reinicieu in packages/app but
Reinicia in packages/desktop. Labels that used the infinitive (Tancar, Enviar, Publicar,
Desfer, Tallar) are now imperatives — Catalan doesn't allow the infinitive for commands. Bare
gerunds became S'està….

244 values changed across the three files. No English string or key is touched.

I also added .opencode/glossary/ca.md, which is arguably the actual fix:
.opencode/command/translate.md loads .opencode/glossary/<locale>.md when present, and Catalan
was translated without one while 16 other locales have theirs. Term choices there are backed by the
Catalan translation memories Softcatalà publishes (KDE, GNOME, LibreOffice, Microsoft Terminology,
Chromium) plus Git's for Git vocabulary, with segment counts cited per row so each can be checked
without reading Catalan. Happy to split it into its own PR if you'd rather review them separately.

How did you verify your code works?

No behaviour changes, so I verified structure and consistency rather than runtime:

  • Key sets still match en.ts exactly — nothing added, removed or renamed. The only extras
    are the Catalan CLDR .many plural forms English doesn't have, and the desktop.* keys every
    locale already carries.
  • Placeholders preserved. Every {{var}} and \n matches the English for all 1,246 keys that
    have an English counterpart. The 8 .many keys have no English counterpart, so I checked those
    against their own .one/.other siblings instead.
  • All three files parse.
  • The repo's own i18n tests pass against this branch: packages/app/src/i18n/parity.test.ts
    (5 pass, 979 assertions) and packages/app/src/i18n/desktop-native.test.ts (8 pass, 455
    assertions). parity.test.ts is the locale-coverage test and already lists ca. I couldn't run
    packages/ui/src/context/i18n.test.ts locally as it needs React installed, but it covers the
    i18n machinery rather than locale content, which this PR doesn't touch.

Easiest confirmation for a reviewer: git diff --stat shows the three locale files at +166/−166,
+70/−70 and +8/−8 — exactly balanced, so only values changed and nothing structural.

Screenshots / recordings

N/A — locale strings only, no layout or component changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Aug 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Aug 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@github-actions github-actions Bot mentioned this pull request Aug 18, 2026
6 tasks
@Enough1122

Copy link
Copy Markdown

AI code review — automated review for reference; please use your judgment.

Reviewed the Catalan locale correction plus glossary. Mechanical checks over the diff all pass: pure value-only edits (app 152, desktop-renderer 6, ui 68 — zero keys added or removed), interpolation placeholders preserved in every changed string, no quote-escaping hazards, and the straight-apostrophe style matches the files' existing convention. Sampled corrections (ComproveuComprova, Desfer/TallarDesfés/Retalla, CòpiaCopia) correctly implement the glossary's verb-register and Avoid rules. Remaining suggestions:

  1. packages/desktop/src/renderer/i18n/ca.ts — only 6 strings were corrected here while app (152) and ui (68) received sweeping fixes for the same error classes (infinitive commands, anglicisms, register) — the same patterns very likely survive in this file's untouched strings — re-audit the full desktop renderer dictionary against the new glossary, especially the Guidance section's tu/vós split.
  2. .opencode/glossary/ca.md — the rules are thorough but enforced only by human memory — 226 hand-edited strings will silently regress in future PRs — add a lightweight lint/test that parses the ca dicts and fails on Do-Not-Translate violations (translated OpenCode, tool ids like doom_loop) and known-bad terms («closca», «carcassa», infinitive menu commands), driven directly by the glossary tables.
  3. .opencode/glossary/ca.md (Guidance) — the user→computer singular / computer→user vós split is the easiest rule to break and mixes were explicitly listed under Avoid — run a targeted sweep for residual vós imperatives (-eu endings: Comproveu, Trieu, Voleu…) inside user-action keys (desktop.menu.*, palette/button labels) and the inverse in dialog/status keys.
  4. packages/app/src/i18n/ca.ts / packages/ui/src/i18n/ca.ts — where an English source string contains both workspace and worktree, verify the translation keeps the «espai de treball» / «arbre de treball» distinction the glossary mandates — collapsed distinctions are invisible in per-string diffs and only show up in context.
  5. Test coverage — none of the touched i18n packages appear to guard dictionary shape — a small parity test asserting every ca key exists in the reference (en) dict would catch accidental key drops mechanically and costs almost nothing.

The ca locale was machine-generated in anomalyco#40992 without a locale glossary.
This corrects mistranslations (Called -> "Es diu", Show agent -> "Agent
d'espectacles", API key -> "tecla API", shell -> "closca"/"Carcassa",
tool calls -> "trucades"), applies the Softcatala rule of singular
imperative for commands and vos for messages, and replaces bare gerunds
with "S'esta ...".

Adds .opencode/glossary/ca.md so future translation passes have the
locale guidance the other 16 locales already have.

Fixes anomalyco#42837
@Qjammer Qjammer closed this Aug 22, 2026
@Qjammer
Qjammer force-pushed the fix/catalan-locale branch from 35c35a7 to ed3dec1 Compare August 22, 2026 20:09
@Qjammer

Qjammer commented Aug 22, 2026

Copy link
Copy Markdown
Author

Thanks for the review — I've checked these against the branch, and a few of the facts are a little different:

  • The desktop renderer file is 22 keys, and it wasn't under-fixed relative to the others — 8 of 22 changed (~36%), the same rate as ui (70 of 197, ~36%) and higher than app (166 of 1124, ~15%). The "only 6 corrected" framing reads as if the rest were skipped, but the untouched strings are the vós dialog/status messages (Trieu una carpeta, Voleu instal·lar-la…), which are correct as they are.
  • Glossary lint: no locale enforces its glossary via lint here — the glossaries are prose read by /translate as guidance ("a glossary hit is evidence, not permission", per AGENTS.md). Term-level lint would be brand-new infrastructure with no precedent in this repo, and I'd rather not gate this PR on inventing it.
  • The residual vós hits are onboarding prose, e.g. Open {{distro}} once to finish setup — computer→user instructions where vós is right, not buttons or menu labels.
  • worktree: fair — dialog.project.edit.worktree.startup.description keeps (worktree) untranslated while the glossary says arbre de treball. I'll update that one for consistency.
  • A parity test already existspackages/app/src/i18n/parity.test.ts asserts every non-English locale carries every English key plus its plural variants, and that placeholders match, across app, ui and desktop for all locales including ca. It passes against this branch (13 tests, 1434 assertions), so key-drop coverage is already in place.

@Qjammer

Qjammer commented Aug 22, 2026

Copy link
Copy Markdown
Author

My agent messed up a rebase and force-pushed a parent-less commit. I've reopened the PR at #44232.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Catalan (ca) locale has systematic mistranslations

2 participants