i18n
Message catalogs and locale resolution. Source: pkg/i18n.
pkg/i18n translates the user interface. Each language is one JSON catalog: shipped ones (en-US, es, fr-CA) are embedded, and more load from ~/.blitz/locales, so a language can be added or corrected without rebuilding. Lookups fall back along the locale chain (fr-CA → fr → en-US), so a partial catalog works. Placeholders are {name}; plurals use .one and .other keys.
The desktop page reads the same catalogs. A lint test keeps every key in every shipped catalog. See translating.
| Name | |
|---|---|
T(key, args…), N(key, count, args…) |
Translate, and pluralize |
Bundle, NewBundle(dirs…) |
The catalogs, embedded and external |
Localizer, Current, SetCurrent |
The active language |
ReplyInstruction |
Tells the model which language to reply in |
PseudoLocale (en-XA) |
A pseudo-translation, for spotting untranslated text |
apps/cli, apps/cli/internal/tui, pkg/client, pkg/engine, pkg/engine/runtime, pkg/engine/tools.
Spec: i18n.