Localization
A book’s FULL, DESC and CNAM are LStringS fields: inline bytes, or a string table id when
the plugin’s TES4 sets Localized. The decode is in
Plugin file format, the table layout in
BSA archive format. This page
covers how the exporter turns an id or inline bytes into text, per language.
Which table for which field
| Field | Table |
|---|---|
BOOK FULL | .strings |
BOOK DESC | .dlstrings |
BOOK CNAM | .dlstrings, see assumptions |
FULL of a referenced SPEL or AVIF, of a WRLD | .strings |
.ilstrings holds interface strings; nothing the exporter reads uses it.
Where the tables live
At Strings\<plugin>_<language>.<extension>, for example Strings\skyrim_english.dlstrings,
looked up by that path in the load order’s
archive file system. Vanilla packs every master’s
tables in Skyrim - Interface.bsa; a mod ships its own in its plugin archive or loose. A table
outside Strings\ isn’t read. The languages come from these file names, not from a hardcoded list.
Encoding
Text/GameTextDecoder tries each string as strict UTF-8, then the language’s secondary encoding
(Game/Vanilla/StringEncodings.SecondaryFallback, from the UESP table), then a lenient UTF-8
decode. SkyrimStringTable.Decode counts the fallbacks in FallbackCount, and its callers warn
when it isn’t 0. The missing secondary encodings and the decode rules are in
assumptions; alias substitution and font
coverage, which the exporter doesn’t handle, in
not implemented.
A non-localized plugin keeps its inline text as raw bytes (LStringS.InlineBytes), decoded per
export language with the same rule by Game/Assets/LStringResolver, see
inline string encoding.
Resolution pipeline
| Step | Code |
|---|---|
| Read string tables from the archive file system, list the languages | Game/Assets/LocalizationSource |
Decode one plugin’s .strings and .dlstrings for one language | Game/Assets/StringTableLoader |
| Replace each id with its text, decode inline bytes | Game/Assets/LStringResolver, Datasets/Books/BookLocalizationResolver |
| Do it for every plugin of a load order, warning about missing ids | Datasets/Books/BookLocalization |
| Localize the name of each record a book teaches, in its own plugin’s tables | Pipelines/Books/BookReferences.LocalizeAsync |
A missing id is exported as (localized, (XXXXXXXX)) rather than dropped. Id 0 means “no string”,
see assumptions.
Why resolution happens before merging
An id is only meaningful in its own plugin’s tables, and BookMerger loses which plugin wrote a
field. So each plugin’s books are localized first, then merged.
The SPEL and AVIF names a book points at and a worldspace’s WRLD name are the exception: the
Datasets/Lookups/NamedRecords lookup and WorldspaceMerger keep, with each merged name, the
plugin that wrote it (NameSource), so those names resolve after merging.