Skip to content

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

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

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

Conversation

@Qjammer

@Qjammer Qjammer commented Aug 22, 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à….

248 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 +170/−170,
+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

@Enough1122

Copy link
Copy Markdown

AI code review — automated review for reference, author can ignore or act on any point.

High-quality correction pass. Verified structurally across packages/app/src/i18n/ca.ts: all changed hunks keep keys identical and alter values only, and every interpolation placeholder ({{version}}, {{provider}}, {{distro}}, {{color}}, {{example}}, …) survives in the replacement strings, so no lookup or formatting breakage is expected. The new .opencode/glossary/ca.md is notably rigorous — cited corpora counts, explicit do-not-translate list, and reasoned choices for token/diff/fork.

Two possible misses consistent with the PR's own goals:

  1. provider.connect.apiKey.label still reads "Tecla {{provider}} API." (context line just below the hunk at @@ -191), while the four tecla API. occurrences (method.apiKey, apiKey.placeholder, custom.field.apiKey.label, custom.field.apiKey.placeholder) were all corrected. This sibling looks like the same "keyboard key" mistranslation left behind — likely worth fixing here or in a fast-follow.
  2. provider.connect.toast.connected.description remains "{{provider}} ara es poden utilitzar models.", whose word order reads garbled ("X now can be used models"); it may predate this PR but sits adjacent to heavily edited strings.

Since this touches only the ca dictionary plus a markdown glossary, risk is low; a key-parity/typecheck run should be sufficient CI coverage. The before/after table in the description is exactly the right way to document semantic (not just grammatical) changes for reviewers who don't read Catalan.

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
@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

@Qjammer

Qjammer commented Sep 23, 2026

Copy link
Copy Markdown
Author

Requesting a reopen — not because this is still in progress, but because it's finished. It was closed on age and reaction count, not on anything about its state.

Where it stands:

  • Rebased onto current dev (1d6c3c0e), no conflicts — the v2 changes didn't touch these files.
  • The two items from the review are fixed. provider.connect.apiKey.label was still "Tecla {{provider}} API.", a fifth instance of the "keyboard key" mistranslation this PR exists to fix — now "Clau API de {{provider}}". And provider.connect.toast.connected.description read "{{provider}} ara es poden utilitzar models.", which back-translates as "X now can be used models" — now "Ja es poden utilitzar els models de {{provider}}."
  • packages/app/src/i18n/parity.test.ts passes against the branch (5 tests, 979 assertions), and key sets and placeholders are identical to en.ts.

It closes #42837, which is still open, and .opencode/glossary/ca.md still doesn't exist on dev — Catalan remains the one locale being machine-translated with no glossary while 16 others have one.

Ready to merge whenever there's review capacity. Happy to rebase again if it drifts.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Catalan (ca) locale has systematic mistranslations

2 participants