Skip to content

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 ​

boolis_collected( type: String, field: String, config: LocalizationConfig ) static
Array[String]shown_field_ids() static
booleffect_name_is_shown( effect: Effect, config: LocalizationConfig ) static
voidassign_keys( resource: DatabaseResource ) static
voidassign_action_keys( prefix: String, actions: Array ) static
voidassign_config_keys( config: GameplayConfig ) static
Array[SpeechLine]find_lines( resource: Resource ) static
voidassign_chat_keys( config: ChatConfig ) static

Constants ​

  • String T = "T"
  • String S = "S"
  • Dictionary FIELDS = { - 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