I18n
Guide: Internationalization.
Catalogs
| Export | Signature |
|---|
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
| Export | Signature |
|---|
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 |
PluralCategory | zero \| one \| two \| few \| many \| other |
Direction
| Export | Signature |
|---|
i18nIsRtl | (locale) bool |
i18nDir | (locale) []const u8 — "rtl" / "ltr" |