feat(i18n): add Spanish (es-419) locale support - #9870
GuidoMaxier wants to merge 6 commits into
Conversation
d5d3102 to
275c401
Compare
|
Rebased onto the current What changed since the original revision:
Local gates on this revision: Two things that need a maintainer:
@SivanCola @esengine — could you take a look when you have a moment? |
internal/i18n: new Spanish catalogue (messages_es.go, 556 fields), ArgLanguageEs in every locale, setLanguage/normalize mapping for es*, /language es completion in cli+control, config SetLanguage persistence (extracted to edit_language.go), and parity/placeholder/code-token/plan-choice test coverage.
locales/es.ts: full 3,527-key es-419 dictionary (1:1 with en.ts); startup wiring (Locale union, LANGUAGE_PREFS, SPINNER_WORDS.es, detect/preload); auxiliary dictionaries retyped Record<Exclude<Locale,"es">, ...> with existing ?? en fallbacks; SetTrayLocale accepts es; bundle-budget gates updated for the es startup wiring and the lazy es-*.js chunk.
The i18n section now describes the multi-catalogue flow (messages_es.go as the Spanish baseline) and the setLanguage/normalize, /language, and parity-test steps.
After rebasing onto main-v2: add ProviderErrWaitExhaustedFmt to messages_es.go; add the 100 new en.ts keys to es.ts, drop the 66 preset keys upstream removed (superseded by the catalog structure), and re-measure the es-*.js chunk budget (62.2 KiB -> 62.3 KiB ceiling).
Drop the two leftover conflict markers and re-align the Spanish catalogue with the permission-preset wording that main-v2 adopted (esengine#10209).
The es-419 dictionary is 3,332 keys on the current main-v2 and measures 59567 B (58.171 KiB) gzip, so the 56.8 KiB ceiling no longer holds. Keep the next one-decimal ceiling with bounded headroom, like the Chinese dialects.
275c401 to
da3a165
Compare
|
Rebased onto the current
Local gates on this revision: CI evidence. The single red job there is Still needs a maintainer: approving the workflow runs on this PR so the CI of the repository can run here. @SivanCola @esengine |
Summary
Adds Spanish (es-419, neutral Latin American) interface support to both layers, rebased onto the current
main-v2(v1.38.7).internal/i18n/messages_es.go(field-identical to the English baseline, including theReadStatus*,OperationNeedsUser,SearchModelUnavailableandProviderErrNotFoundfields added upstream after the original revision),ArgLanguageEsin every locale,setLanguage/normalizemapping fores/es-ES/es-419/POSIX forms, a selectable/language esoption (CLI + slash completion), andconfig.SetLanguagepersistence fores.SetLanguage/SetReasoningLanguagelive ininternal/config/edit_language.goto stay inside the repolint file-size ratchet.desktop/frontend/src/locales/es.tsdictionary — 3,234 keys, verified 1:1 againsten.ts(same key set, same order, same{placeholder}names) — plus the locale wiring (Localeunion,SPINNER_WORDS.es,detectLocale/preloadLocale, settings picker with an "Español" option, tray locale). Auxiliary per-locale dictionaries are retyped toRecord<Exclude<Locale, "es">, ...>and keep their existing?? enfallbacks until Spanish copy lands there.es-*.jslazy chunk (its filter previously matched onlyzh/zh-TW, so the Spanish chunk went unmeasured) and budgets it at its measured size: 58,071 B gzip (56.710 KiB), 56.8 KiB ceiling. The zh/zh-TW dialect ceilings are unchanged.Verification (run locally on this rebased revision)
gofmt,go vet ./...cleangolangci-lint run ./...(CI pin) -> 0 issuesgo run ./tools/repolint-> cleango test ./internal/i18n/ ./internal/config/ ./internal/control/ ./internal/cli/ ./internal/tool/builtin/passtsc --noEmit0 errors,eslint "src/**/*.{ts,tsx}"clean,pnpm buildpasses (vite + bundle budgets, including the measuredes-*.jschunk)internal/bootreports 7 session-context failures that reproduce identically on a pristineupstream/main-v2worktree (environment-dependent, unrelated to this diff)Tests
Catalog parity guards cover the Spanish catalogue (completeness,
%placeholder counts, code-token sets);TestNormalize/DetectLanguagecoveres; CLI completion and config persistence tests cover/language es. The desktop dictionary is enforced 1:1 againsten.tsby itsRecord<DictKey, string>annotation.Cache-impact: none - the provider-visible system-prompt prefix is byte-identical; catalogues are client-side UI strings and
config.SetLanguageonly selects which catalogue loads.Cache-guard: existing - no prompt/tool/prefix code path changed (internal/i18n scope is CLI text; desktop dictionaries load lazily per locale).
System-prompt-review: maintainers - the diff touches internal/config (UI-language persistence only); no system-prompt, memory-prefix, output-style, or skill-index content changes.
Documentation-impact: none - the embedded
docs/*.mdcorpus is unchanged;CONTRIBUTING.md(repo root) was updated to document the multi-catalogue locale flow.