code wiki / _hdl_build / nx_cms_i18n.nx

nx_cms_i18n.nx

buildroot/runtime/_hdl_build/nx_cms_i18n.nx

3141 B63 linesdepth 3pulls 3 transitivereach 2 importersview sourcekind librarytopic cms
docsdependenciesstructsconstsfunctions

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

nx_cms_store.nx nx_syscalls.nx nx_cms_i18n.nx nx_aw_devserver.nx nx_cms_i18n_gate.nx

imports: nx_cms_store.nxnx_syscalls.nx

imported by: nx_aw_devserver.nxnx_cms_i18n_gate.nx

structs

none

consts

13const NX_I18N_EXACT: i64 = 0 // matched the requested tag verbatim
14const NX_I18N_TRUNC: i64 = 1 // matched a truncated tag (region/script subtag dropped)
15const NX_I18N_DEFAULT: i64 = 2 // fell back to the configured default locale
16const NX_I18N_BARE: i64 = 3 // fell back to the un-tagged bare field
17const NX_I18N_NONE: i64 = 0 - 1 // no value at any tier (honest miss)

functions

20func i18n_key(out: *u8, field: *u8, locale: *u8) -> i64
called by 2: i18n_resolvemain
33func i18n_resolve(store: *u8, n: i64, field: *u8, locale: *u8, deflocale: *u8, out: *u8, cap: i64, out_tier: *i64) -> i64
called by 1: main calls 3: sys_mmapi18n_keycst_get