Repository navigation
feat(i18n): add English (UK) locale - #303
Open
Mallard-Marsh wants to merge 1 commit into
Open
Mallard-Marsh wants to merge 1 commit into
Mallard-Marsh wants to merge 1 commit into
Conversation
|
Sorry @Mallard-Marsh, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 7 days by commenting |
Reviewer's GuideAdds English (UK) as a fully supported locale by generating an ICU-safe, British-spelled catalog from English (US), applying targeted terminology overrides, wiring the locale through frontend and backend metadata and AI descriptions, and enforcing catalog freshness in tests and i18n checks. Sequence diagram for English UK locale selectionsequenceDiagram
participant User
participant Picker as Locale picker
participant App
participant Backend
participant AI as AI service
User->>Picker: Select English UK
Picker->>App: Store locale en-GB
App->>Backend: Request with locale en-GB
Backend->>AI: Generate description with British English
AI-->>Backend: British English description
Backend-->>App: Localized response
App-->>User: Display English UK catalog
Flow diagram for generated English UK locale catalogsflowchart LR
EN[English US message catalogs] --> GEN[gen-en-GB.mjs]
OV[en-GB overrides] --> GEN
GEN --> UK[English UK catalogs]
UK --> CHECK[i18n check --check]
EN --> CHECK
CHECK -->|stale or missing| FAIL[Check fails]
CHECK -->|up to date| PASS[Check passes]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Adds en-GB as a supported locale so UK users see Trousers, Jumper, Trainers, Autumn and Grey instead of Pants, Sweater, Sneakers, Fall and Gray, with British spelling throughout (colour, favourite, analyse). messages/en-GB/ is generated from messages/en by scripts/gen-en-gb.mjs: a spelling pass over every string (ICU argument names and selectors are masked) plus whole-string replacements in i18n/en-GB-overrides.json for words that need context. The files are full copies because request.ts merges a locale over en only per namespace and i18n:parity requires every key. `npm run i18n:en-gb` regenerates them and i18n:check fails while they are stale. The backend gets "British English" as the AI description language, and the picker labels en as English (US) next to English (UK). Refs Anyesh#269 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mallard-Marsh
force-pushed
the
pr/en-gb
branch
from
October 28, 2026 07:04
b487280 to
5b050e3
Compare
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.
Description
Adds English (UK) as a supported language, so UK users see Trousers, Jumper, Trainers, Waistcoat, Autumn and Grey instead of Pants, Sweater, Sneakers, Vest, Fall and Gray, with British spelling throughout (colour, favourite, analyse).
messages/en-GB/is generated frommessages/enbyscripts/gen-en-gb.mjs: a spelling pass over every string (ICU argument names and selectors are masked so placeholders and plural keys are never changed), plus whole-string replacements ini18n/en-GB-overrides.jsonfor the words that need more than spelling (garment names, Autumn, Grey, a few subtypes and two analytics sentences).request.tsmerges a locale overenonly per namespace andi18n:parityrequires every key.npm run i18n:en-gbregenerates them;npm run i18n:checknow also fails when they are stale, so a newenstring can't be forgotten.en-GBis added tobackend/app/data/locales.json(and the generatedlib/generated/locales.ts), with aLOCALE_METADATAentry. The picker labelsenas English (US) next to English (UK).en-GB) now resolves to English (UK) on first visit; other English browsers still geten.en-GB, so item descriptions follow the user's language like the other locales.enstrings.Contributors don't need to translate anything by hand for en-GB: editing
messages/enand runningnpm run i18n:en-gbkeeps it in step.Related Issue
Fixes #269
Type of Change
Checklist
Testing
Test Environment
Tests Performed
tsc --noEmit,vitest(706 passing),npm run i18n:check(keys, parity, scan, and the new stale-en-GB check),npm run vocab:check.tests/en-gb-locale.test.tscovers the spelling pass (capitalisation kept, ICU argument names untouched, whole-word matching, clothing words swapped but not words containing them), the generated catalogues (British clothing words, keys unchanged) and browser detection (a British browser gets en-GB, other English browsers get en).ruff, fullpytest(same 4 macOS-only failures asmain: 2 intest_tagging_durability, 2[utc]timezone cases); the locale list and description-language tests updated foren-GB.main; regenerating en-GB after the rebase produced no changes.Additional Notes
Two small related fixes from the same testing are in my fork and can follow as separate PRs if useful: a new device adopting the account's saved language instead of the browser's, and promoting a type name the AI returns as the subtype ("sneakers" as the subtype of "shoes").
Summary by Sourcery
Support English (UK) across the frontend and backend with generated British-English catalogues, locale detection, and localized AI descriptions.
New Features:
Enhancements:
Build:
Documentation:
Tests: