code wiki / _hdl_build / nx_cms_i18n.nx
nx_cms_i18n.nx
buildroot/runtime/_hdl_build/nx_cms_i18n.nx
about
nx_cms_i18n.nx -- CMS MULTILINGUAL content resolution (sovereign, offline, RFC-4647 "Lookup" correct).
The WPML/Polylang class, made Nishi-native: a content bundle stores locale-tagged fields in the
nx_cms_store record format (`@title.fr-CA`, `@title.fr`, `@title.en`, bare `@title`), and resolution
follows the RFC 4647 Lookup algorithm -- try the exact tag, then progressively drop the rightmost
subtag (fr-CA -> fr; zh-Hant-TW -> zh-Hant -> zh), then a configured default locale, then the bare
field. Sovereign + offline (no WPML cloud/license server, no per-string API call = the exceed angle),
deterministic, and it NEVER serves a wrong-locale value silently (a true miss returns -1). Composes
nx_cms_store (cst_get). license_tier: ORIGINAL
dependencies 2 imports · 2 importers
imports: nx_cms_store.nxnx_syscalls.nx
imported by: nx_aw_devserver.nxnx_cms_i18n_gate.nx
structs
| none |
consts
| 13 | const NX_I18N_EXACT: i64 = 0 // matched the requested tag verbatim |
| 14 | const NX_I18N_TRUNC: i64 = 1 // matched a truncated tag (region/script subtag dropped) |
| 15 | const NX_I18N_DEFAULT: i64 = 2 // fell back to the configured default locale |
| 16 | const NX_I18N_BARE: i64 = 3 // fell back to the un-tagged bare field |
| 17 | const NX_I18N_NONE: i64 = 0 - 1 // no value at any tier (honest miss) |
functions
| 20 | func i18n_key(out: *u8, field: *u8, locale: *u8) -> i64 |
| 33 | func i18n_resolve(store: *u8, n: i64, field: *u8, locale: *u8, deflocale: *u8, out: *u8, cap: i64, out_tier: *i64) -> i64 |