LocalizedFields ​
Inherits: RefCounted
Which text of which type of database resource is translated. The audit (docs/systems/localization-audit.md) decided each field:
Description ​
- T (translate): text the player reads, always in the tables.
- S (if shown): text the toolkit does not show today but a game might; in the tables only when the Localization tab has it switched on (
LocalizationConfig.shown_fields).
A type that is not here has no text for the player (events, conversations (their own text is a part), loot tables, scripts, growth profiles ...). The parts inside a resource (skill nodes, reputation levels, quest objectives ...) are collected by LocalizationGenerator, and given their keys by assign_keys.
Methods ​
bool | is_collected( type: String, field: String, config: LocalizationConfig ) static |
Array[String] | shown_field_ids() static |
bool | effect_name_is_shown( effect: Effect, config: LocalizationConfig ) static |
void | assign_keys( resource: DatabaseResource ) static |
void | assign_action_keys( prefix: String, actions: Array ) static |
void | assign_config_keys( config: GameplayConfig ) static |
Array[SpeechLine] | find_lines( resource: Resource ) static |
void | assign_chat_keys( config: ChatConfig ) static |
Constants ​
StringT ="T"StringS ="S"DictionaryFIELDS ={- type -> { field -> T or S }
Method descriptions ​
bool is_collected( type: String, field: String, config: LocalizationConfig ) ​
Is this field of this type collected, with the choices of the config about the "if shown" text?
Array[String] shown_field_ids() ​
The "if shown" fields of every type: "type.field" (the Localization tab lists them).
bool effect_name_is_shown( effect: Effect, config: LocalizationConfig ) ​
Is the name of this effect translated? Only an effect that lasts (a buff, a debuff, an aura, a status) is on the buff bar; for the others the name is "if shown".
void assign_keys( resource: DatabaseResource ) ​
Gives the parts inside a resource their keys (skill nodes, reputation levels ...): Localization.key_of needs the prefix of the owner. Called for every resource when the database loads it, and by the generator.
void assign_action_keys( prefix: String, actions: Array ) ​
Gives the actions of a list (and the actions inside an If or a Switch) their keys: the prefix and the position, <prefix>/action/<index> (<index>/true/<index> inside an If)
void assign_config_keys( config: GameplayConfig ) ​
The inventory styles of the Gameplay Config (the characters, the NPCs and the containers): the names of their encumbrance steps are translated
Array[SpeechLine] find_lines( resource: Resource ) ​
Every line (SpeechLine) inside a resource, found by walking its properties, always in the same order (so the key of a line stays the same while the data does not change)
void assign_chat_keys( config: ChatConfig ) ​
Gives the channels of the chat settings the keys of their name and text: chat/<id>/display_name and chat/<id>/template