i18n: a locale per app, catalogs of messages, mirrored stacks

i18n::I18n is a gpui global holding the shown locale and one catalog of
messages per locale. text fills each {name} from its arguments; a
missing key, argument or catalog fails, and every catalog holds the
first one's keys. Locale writes numbers with its separators and dates
in CLDR's short numeric form; Hebrew replaces Arabic, whose Egyptian
digits Ely does not write. Direction::row mirrors a stack and
Direction::align sets text against the reading side. The gallery's
chapter 40 shows the messages in seven locales, every locale's number
and date, and a file list that mirrors under Hebrew.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-09-27 18:59:45 -04:00
1 parent 8c3ff2c584
commit 2a91218fd8
9 files changed
+616 -4

No files matched your search

+4 -4
View File
@@ -273,10 +273,10 @@
## T40a i18n — `src/i18n`
- [ ] I18nProvider
- [ ] Trans / LocalizedText
- [ ] LocaleNumber / LocaleDate
- [ ] RTL layout — prove: mirrored stacks
- [x] I18nProvider → `i18n::I18n`, a gpui global: the shown locale and one catalog per locale
- [x] Trans / LocalizedText → `I18n::text`, a message with its `{name}` arguments filled
- [x] LocaleNumber / LocaleDate → `Locale::number` and `Locale::date`, CLDR's separators and short dates
- [x] RTL layout — proven: `Direction::row` mirrors a stack and `Direction::align` sets its text's side; Ely's other components stay left to right
## T40b a11y — `src/i18n`