feat(i18n): add Spanish (Español) locale - #129
Merged
Merged
Conversation
Second language added under the per-locale structure from amirlehmam#120, and the two-edit claim holds: a locales/es.ts file plus one row in REGISTRY. Language, SUPPORTED_LANGUAGES, the Settings dropdown and the isLanguage() persistence guard all derive from that table and picked up `es` on their own; the only other change is the test that deliberately pins the shipped language set, which fails by design when the set grows. Coverage is complete: es 107/107 keys, so nothing falls back to English. detectDefaultLanguage() now resolves es-*, so a fresh profile on a Spanish-display Windows starts in Spanish instead of English (the issue amirlehmam#56 case). Existing installs keep whatever they persisted. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137J8T5Ckm8GodkfkJc1MQi
Owner
|
Merged, thank you — and thanks for the unusually complete write-up. Verified locally before merging:
On the 5 failures you saw in Good call flagging that the pinned language-set assertion is the guard from #120 working as designed — that's exactly why it's pinned. Shipping in v0.39.0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Spanish as a shipped UI language, following the per-locale structure introduced in #120.
That PR closed with a claim: "Adding a language is now two edits: a
locales/xx.tsfile and one row inREGISTRY." This is the second language added under it, and the claim holds — the third file changed only because a test is designed to fail when the shipped set grows.src/renderer/i18n/locales/es.tssrc/renderer/i18n/core.ts{ code: 'es', label: 'Español', dict: es }tests/unit/i18n.test.tsescasesEverything else derived from
REGISTRYon its own: the Settings dropdown,isLanguage()insettings-slice.ts(so the setting persists across restarts — case #5 from #120 stays closed), and the stale-key test, which now runs foreswithout being told to.esis placed afterenin the registry to keep the table in code order; the Settings dropdown follows that same order.Coverage
Complete — nothing falls back to English:
Spanish as spoken in Spain, addressing the user informally ("Haz clic para…"), matching the direct tone of the English source.
wmux,Ctrl+S,HKCU,markdown setand the other command/UI literals are left untranslated. Terminology follows the existing Spanish translation on the website (site/i18n.js): barra lateral, pestañas, navegador integrado.Behavior change
detectDefaultLanguage()now resolveses-*, so on a Spanish-display Windows a fresh profile starts in Spanish instead of English — the issue #56 case, now covering Spanish. Existing installs keep whatever they persisted.Verification
npm run typecheck→ 0npm test→ 507 passed, 5 failed. The 5 failures are intests/unit/orchestration-status-vocab.test.tsand are pre-existing onmaster: they shell out tobashwith a Windows path (/bin/bash: C:UsersAlejandroCastillo-Ap...: No such file or directory) and fail identically with these changes stashed.tests/unit/i18n.test.ts→ 15/15.npx eslint src/renderer/i18n/→ clean.npm run lint→ the same 32 repo-wide problems as base, unchanged.Test changes
Three edits, all in
tests/unit/i18n.test.ts:['en', 'es', 'fr', 'it', 'zh']— the guard from refactor(i18n): one file per locale with keys typed against English; add Italian #120 working as designed, since the shipped set cannot grow unnoticed.translate('es', 'settings.title')→'Ajustes', alongside the existingfr/zhcases.es-ESadded to the OS display-language test, next tofr-CAandzh-Hans-CN, pinning the regional-tag → base-tag mapping for the new language.