Skip to content

i18n: split Spanish into es (Spain) / es-419 (Latin America) + peninsular lexicon - #7111

Open
Pomy1 wants to merge 5 commits into
stablyai:mainfrom
Pomy1:feat/split-spanish-locale
Open

Pomy1 wants to merge 5 commits into
stablyai:mainfrom
Pomy1:feat/split-spanish-locale

Conversation

@Pomy1

@Pomy1 Pomy1 commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Orca's Spanish catalog is a single region-neutral (Latin-American) es, and the locale resolver drops the region for every language except Chinese — so es-ES and es-MX load the same catalog. This PR splits Spanish into two regional catalogs and gives the Spain variant a peninsular-Spanish lexicon.

Rebased onto latest main. The earlier version of this PR also fixed Git-term false friends (sucursal→rama, comprometer→commit) and CSS that had been translated by mistake — those have since been fixed upstream (#7359, #7408, #7422, and fix(pet): stop i18n from corrupting CSS keyframes), so this PR now focuses on the region split and the remaining peninsular lexicon.

1. Split Spanish into es (Spain) and es-419 (Latin America)

  • es.json becomes the Spain (es-ES) catalog and the generic es fallback.
  • es-419.json is a frozen copy of the current es translation, served to Latin-American regions (es-MX, es-AR, es-419, …). No content change for those users.
  • normalizeSupportedUiLocale routes Spanish by region (Spain / bare es → es; other es-* → es-419), mirroring the existing zh handling. Lazy loaders wired in both the renderer and the main process.
  • Language picker gains “Español (Latinoamérica)”; the existing entry is relabelled “Español (España)”.

2. Peninsular-Spanish lexicon in the Spain catalog

The es catalog keeps Latin-American vocabulary; correct it for Spain (Latin America keeps it via es-419.json):

  • agregar → añadir (conjugation-aware: Añadir / Añade / Añadiendo / Añadido / Añada …)
  • computadora → ordenador, with gender agreement (la computadora activa → el ordenador activo, de la computadora → del ordenador)
  • ingresar → introducir / introduzca (the “enter a value” sense — none of these are the Enter key)
  • presionar → pulsar
  • verb “Supports:” → “Admite:” (the noun soporte for technical support is kept — it is correct in Spain)

~250 strings. es-419.json is untouched.

Testing

  • typecheck — pass (3 tsgo projects)
  • i18n / locale / AppearancePane unit tests — pass (61); region-routing expectations updated
  • Key parity across all 6 catalogs (10 169 keys each)
  • check:max-lines-ratchet — pass

Notes

  • At the split step there is no visible change for current users: es-419.json equals today's es.json.
  • A few unrelated pre-existing catalog gaps (keys referenced in some SSH/host dialogs that are missing from en.json) are left as-is — they are not part of this change.

ELI5

Spanish splits into Spain (es) and Latin America (es-419) with region-aware catalogs. Spain gets peninsular wording instead of one neutral catalog for everyone.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c6b3d3ec-9e7f-47fb-8ab6-d2d98cc9db65

📥 Commits

Reviewing files that changed from the base of the PR and between dbf8086 and 9655a98180092f5fa4c3deb04046ddae49de9177.

📒 Files selected for processing (12)
  • src/main/i18n/main-i18n.ts
  • src/renderer/src/i18n/i18n.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es-419.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/supported-languages.ts
  • src/shared/ui-language.ts
  • src/shared/ui-locale.test.ts
  • src/shared/ui-locale.ts
👮 Files not reviewed due to content moderation or server errors (11)
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/supported-languages.ts
  • src/shared/ui-language.ts
  • src/renderer/src/i18n/i18n.ts
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/ui-locale.test.ts
  • src/shared/ui-locale.ts
  • src/main/i18n/main-i18n.ts

📝 Walkthrough

[!WARNING]

Walkthrough skipped

File diffs could not be summarized.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Pomy1 added 2 commits July 8, 2026 08:28
The locale resolver dropped the region for every language except Chinese,
so es-ES and es-MX loaded the same catalog. Make Spanish region-aware:

- es.json becomes the Spain (es-ES) catalog and the generic `es` fallback.
- es-419.json is a frozen copy of the current translation, served to
  Latin-American regions (es-MX, es-AR, es-419, …).
- normalizeSupportedUiLocale routes Spanish by region (Spain / bare es -> es;
  other es-* -> es-419), mirroring the existing zh handling. Lazy loaders
  wired in both the renderer and the main process.
- Language picker gains 'Español (Latinoamérica)'; the existing entry is
  relabelled 'Español (España)'.

No visible string change at this step: es-419.json equals the current es.json.
Now that es.json is the Spain catalog, replace the Latin-American lexicon
that upstream's es keeps (es-419.json preserves it for Latin America):

- agregar -> añadir (conjugation-aware: Añadir/Añade/Añadiendo/Añadido/Añada…)
- computadora -> ordenador (with gender agreement: 'la computadora activa'
  -> 'el ordenador activo', 'de la computadora' -> 'del ordenador')
- ingresar (enter a value, never the Enter key) -> introducir / introduzca
- presionar -> pulsar
- verb 'Supports:' -> 'Admite:' (kept the noun 'soporte' for tech support)

~250 strings. es-419.json is unchanged.
@Pomy1
Pomy1 force-pushed the feat/split-spanish-locale branch from 9655a98 to c246cde Compare July 8, 2026 06:34
@Pomy1 Pomy1 changed the title i18n: split Spanish into es (Spain) / es-419 (Latin America), fix Git terms and broken CSS i18n: split Spanish into es (Spain) / es-419 (Latin America) + peninsular lexicon Jul 8, 2026
@AmethystLiang

Copy link
Copy Markdown
Contributor

@brennanb2025 when you review this, maybe can refer to other established open source project to see the best coding practice for this split

@nwparker nwparker added the enhancement New feature or request label Jul 27, 2026
@greptile-apps

greptile-apps Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR splits the single neutral Spanish catalog into two regional variants — es (Spain) and es-419 (Latin America) — and updates the locale resolver, lazy loaders, language picker, and ~250 strings in the Spain catalog with peninsular vocabulary.

  • Locale routing: normalizeSupportedUiLocale now routes es and es-ES → es, and all other es-* subtags (es-MX, es-AR, es-419, …) → es-419, mirroring the existing Chinese region-split pattern.
  • Catalogs: es-419.json is a frozen copy of the previous neutral catalog (no change for LatAm users); es.json replaces LatAm vocabulary (agregar, computadora, ingresar, presionar) with peninsular equivalents (añadir, ordenador, introducir, pulsar).
  • Wiring: Lazy loaders added in both renderer (i18n.ts) and main process (main-i18n.ts); UI_LANGUAGE_SPANISH_LATAM constant added to the BuiltInUiLanguage union and the language picker.

Confidence Score: 5/5

Safe to merge — the region routing is self-contained and symmetrically wired in both the renderer and main process, LatAm users see no change, and the previously flagged test-structure issue is resolved in the current HEAD.

The locale-routing logic is straightforward and mirrors the existing Chinese split pattern; all new code paths are covered by unit tests; the es-419.json catalog is a frozen copy so there is zero risk of regression for LatAm users; the test file is correctly structured with all blocks properly closed.

Files Needing Attention: No files require special attention. The previous concern about ui-locale.test.ts (unclosed it callback) is resolved in the current HEAD.

Important Files Changed

Filename Overview
src/shared/ui-locale.ts Adds Spanish region routing: Spain (es) and Latin America (es-419), mirroring the existing Chinese handling; logic and guard conditions are correct.
src/shared/ui-locale.test.ts Test block previously flagged as unclosed is correctly closed in the current HEAD; all it() blocks and the describe are properly delimited.
src/shared/ui-language.ts Adds UI_LANGUAGE_SPANISH_LATAM = 'es-419' constant and includes it in the BuiltInUiLanguage union type and UI_LANGUAGE_VALUES set.
src/renderer/src/i18n/i18n.ts Adds lazy loader for es-419.json in the renderer, consistent with the existing loader pattern.
src/main/i18n/main-i18n.ts Adds lazy loader for es-419.json in the main process, symmetric with the renderer change.
src/renderer/src/i18n/supported-languages.ts Adds UI_LANGUAGE_SPANISH_LATAM to the language picker choices and fallback labels; existing entry relabelled to Español (España).
src/renderer/src/i18n/locales/es-419.json New 14,353-line Latin-American Spanish catalog, frozen copy of the previous neutral es catalog; retains LatAm vocabulary (computadora, agregar, ingresar, presionar).
src/renderer/src/i18n/locales/es.json ~250 strings updated to peninsular Spanish (añadir, ordenador, introducir, pulsar); adds spanishLatam key for the language picker.
src/renderer/src/components/settings/AccountsPane.test.tsx Regex updated from agregan to añaden to match the Spain-catalog vocabulary change.

Reviews (2): Last reviewed commit: "fix(i18n): close LatAm Spanish test bloc..." | Re-trigger Greptile

… account copy test

- Add missing }) that left the describe block unclosed (Greptile P1)
- Sync es-419.json to full parity with en.json (inherit Spanish for new keys, drop obsolete keys; existing LatAm content unchanged)
- Update AccountsPane test for peninsular 'se añaden'
@nwparker

nwparker commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Thanks @Pomy1, and apologies for the slow reply.

Splitting es into es (peninsular) and es-419 means taking on a sixth UI locale, and we are not adding locales right now — we are working through correctness bugs in the five we already ship first. The per-locale cost is real: glossary and override rules in the build-time repair policy, plus re-translation of every new English string.

The peninsular lexicon work is the interesting half though, and it does not require a split. If you want to open a PR that just corrects the Latin-American-flavoured strings inside the existing es catalog, that is squarely in scope and I would take it. Closing this one for the split itself.

@nwparker nwparker closed this Aug 4, 2026
@nwparker

nwparker commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

@Pomy1 — I'm sorry, I closed this and that was the wrong call. Reopening it.

What I said still holds (splitting es into es / es-419 means taking on a sixth built-in locale, and we aren't adding those right now), but closing your PR was not the right way to act on it. You did the work, it sat for months, and then it got closed with an explanation of our constraints. I apologize.

The direction we're working toward is plugin language packs, so locale maintenance can sit with people who actually speak the language rather than becoming in-tree debt. Most of the mechanism is already in the repo: a manifest declares contributes.languagePacks: [{ locale, path }], the pack is a plain catalog JSON matching en.json's key shape, packs are integrity-verified and approval-gated at install, they show up in Settings → Appearance → Language, and Intl formatting resolves through the declared locale tag. es-419 would be a clean fit for that.

What's missing is the authoring side: no guide, no scaffolding from en.json, no re-sync when English changes, and the glossary/repair tooling isn't exposed to pack authors yet. That's what we're building. No date I can promise.

The separate offer stands and doesn't depend on any of the above: the peninsular lexicon fixes don't need the split. If you open a PR correcting the Latin-American-flavoured strings inside the existing es catalog, that's squarely in scope today and I'll review it properly.

Sorry again for the handling.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants