Expand description
§nwnrs-localization
nwnrs-localization defines the small vocabulary that recurs across TLK, GFF,
SSF, and installation-facing resource loading.
§Scope
- represent NWN language identifiers
- represent dialog string references
- represent the male/female selector used by TLK lookup
- keep those foundational concepts consistent across the workspace
The relevant entry points are Language, StrRef, and
resolve_language.
§Public Surface
§Core types
StrRefLanguageGender
§Constants and parsing
BAD_STRREFParseLanguageErrorresolve_language
§Important Language operations
Language::idLanguage::short_codeLanguage::from_idFromStr for Language
§Logical Edges
BAD_STRREFis the sentinel for “no string” and must be treated as such by higher layersLanguageis an NWN-specific vocabulary, not a general i18n abstractionGenderis here because TLK lookup has male/female layering semanticsresolve_languageandFromStrform the normalization boundary between user input, install directory naming, and the typed language enum
§See also
nwnrs-tlk, which usesLanguage,Gender, andStrReffor dialog-table lookupnwnrs-gff, which usesStrRefandLanguagefor localized string fieldsnwnrs-ssf, which storesStrRefvalues in soundset slot entriesnwnrs-encoding, which provides the byte-level text encoding that this crate builds on
§Why This Crate Exists
Without a single localization vocabulary, every crate that touched TLK or
language roots would reinterpret the same concepts independently.
Modules§
- prelude
- Common imports for consumers of this crate.
Structs§
- Parse
Language Error - An error returned when a language identifier cannot be parsed.
Enums§
Constants§
- BAD_
STRREF - The sentinel string reference used for “no string”.
Functions§
- resolve_
language - Resolves a language from a numeric id, short code, or English name.
Type Aliases§
- StrRef
- A TLK string reference.