I18n

Guide: Internationalization.

Catalogs

ExportSignature
I18nCatalog{ entries: []I18nEntry, default_locale, supported }
I18nEntry{ locale, key, value }
.lookup(locale, key) []const u8 — fallback: default locale → key literal
I18nLazyCatalog.init(locales: []const I18nLocale, default, gpa) — parse-on-first-use JSON
I18nLocale{ tag, json } — pair a tag with an @embedFile blob
.isSupported(locale) bool

Build wiring: -Di18n-dir=<path> embeds <locale>.json files; -Di18n-default=<tag> sets the default.

Negotiation & plurals

ExportSignature
resolveLocale(catalog, request_meta, location, arena) []const u8 — cookie → query → Accept-Language → default
tPlural(catalog, locale, key_base, n, arena) ![]const u8 — CLDR category + {n} substitution
pluralCategory(locale, n) PluralCategory
PluralCategoryzero \| one \| two \| few \| many \| other

Direction

ExportSignature
i18nIsRtl(locale) bool
i18nDir(locale) []const u8"rtl" / "ltr"