Skip to content

fix(i18n): correct and complete the Catalan (ca) locale, add Console ca - #50997

Open
Qjammer wants to merge 1 commit into
anomalyco:v2from
Qjammer:ca-v2
Open

Qjammer wants to merge 1 commit into
anomalyco:v2from
Qjammer:ca-v2

Conversation

@Qjammer

@Qjammer Qjammer commented Sep 23, 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. Catalan had three separate problems.

1. Strings that say something different from the English. The locale was machine-generated in
#40992 and never reviewed by a speaker:

Key English Was What it actually 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 (×5) API key tecla API "API keyboard-key"
settings.general.row.shell.title Terminal shell Carcassa terminal "terminal casing"
context.breakdown.tool Tool Calls Trucades d'eines "phone calls of tools"
context.stats.inputTokens (×6) Input Tokens Fitxes d'entrada "input filing-cards"

2. 498 keys had no Catalan at all and silently fell back to English. The most visible is
ui.messagePart.tools.used.*, which renders in the timeline as English Used 2 … next to
translated tool names. Those are now translated.

3. The Console had no Catalan dictionary at all — every string English, while 17 other locales
had one. This adds packages/console/app/src/i18n/ca.ts (728 keys).

The only code changes are the three lines needed to register the locale, and they're worth a
look since the rest of the diff is strings:

  • i18n/index.ts — one import and one branch, matching the existing pattern.
  • lib/language.ts — LOCALES, LABEL (Català), TAG (ca), and DOCS. All four are
    satisfies Record<Locale, string>, so they have to move together. DOCS maps ca to
    "root"
    — deliberately, because the docs site has no Catalan, so Catalan users correctly get
    the English docs rather than a 404.

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); bare gerunds
become S'està…; and a label that names a completed action takes a noun, not an imperative — which
matters here because those labels follow a count, so Used 2 Escriu ("used 2 write!") becomes
Used 2 Escriptura.

.opencode/glossary/ca.md is the part most likely to matter beyond this PR:
.opencode/command/translate.md loads .opencode/glossary/<locale>.md when present, and Catalan
was translated without one. Term choices cite segment counts from the Catalan translation memories
Softcatalà publishes (KDE, GNOME, LibreOffice, Microsoft Terminology, Chromium) plus Git's for
Git-specific vocabulary, so each row can be checked without reading Catalan.

No English string or key is touched.

This supersedes #44232, which I opened against dev before realising that's the v1.18.x line —
these dictionaries live at different paths there, so v2 users would never have received the fix.

How did you verify your code works?

There's no i18n parity test on this branch, so I verified by script:

  • Every en.ts key now has a ca.ts entry — 0 missing, 0 duplicates, across
    packages/app/src/runtime/i18n, packages/ui/src/i18n and packages/console/app/src/i18n.
    The Console dictionary matches en.ts exactly, 728/728.
  • Placeholders preserved — every {{var}} and \n matches the English across all 2,391 keys
    that have an English counterpart. The <strong> tags in home.growth.body balance 4/4.
  • Plural coverage — Catalan's CLDR categories are one/many/other, so all 23 plural families
    carrying {{count}} have a .many variant.
  • The only keys in ca.ts without an en.ts counterpart are the 90 desktop.* entries that live
    in desktop-native.ts — byte-identical to the set already on v2, so nothing new.
  • All dictionaries import and parse, and every touched file is prettier-clean.

To be precise about the limits: these are local static and import-level checks, not an end-to-end
run of the UI. Happy to attach a screenshot of the Console in Catalan if that would help review.

Screenshots / recordings

N/A — locale strings plus locale registration; no layout or component changes.

Checklist

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

The ca locale was machine-generated in anomalyco#40992 without a locale glossary,
and it is also incomplete: 498 keys in the app and ui dictionaries had no
Catalan at all and silently fell back to English. The Console had no
Catalan dictionary whatsoever.

- Corrects mistranslations, including Called -> "Es diu" (named, not
  invoked), Show agent -> "Agent d'espectacles" (entertainment agent),
  API key -> "tecla API" (keyboard key), Terminal shell -> "Carcassa
  terminal", Tool Calls -> "Trucades d'eines" (phone calls) and Input
  Tokens -> "Fitxes d'entrada" (filing cards).
- Translates the 498 missing app/ui keys, including
  ui.messagePart.tools.used.*, which rendered in the UI as English
  "Used 2 ...".
- Adds packages/console/app/src/i18n/ca.ts (728 keys) and registers the
  locale in i18n/index.ts and lib/language.ts. DOCS maps ca to "root"
  because the docs site has no Catalan, so Catalan users correctly get
  the English docs.
- Applies the Softcatala rule of singular imperative for commands and vos
  for messages, "S'esta ..." for progressive actions, and a noun for
  labels naming a completed action.
- Adds .opencode/glossary/ca.md so future translation passes have the
  locale guidance the other 17 locales already have.

Fixes anomalyco#42837
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

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

@Qjammer

Qjammer commented Sep 23, 2026

Copy link
Copy Markdown
Author

Closes #42837 is in the description, but the check can't see it: GitHub only creates a
closing-issue reference when a PR targets the repository's default branch. This one targets
v2, so the reference never forms.

Same text in both PRs, only the base differs:

PR base closingIssuesReferences
#44232 dev (default) [42837]
#50997 v2 []

So this will flag every PR that targets v2, not just this one. Falling back to a regex on the
body when the base isn't the default branch would fix it in the workflow.

For the record: #42837 is open, and this PR closes it.

This branch has not been deployed

No deployments
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.

1 participant