Skip to content

LocalizationTable ​

Inherits: Resource

The translations of one collection (the text of one type of database resource, or the words of the toolkit's interface): for every text a key, the source text, and for every language the translation and the fingerprint of the source text it was written for. A translation whose fingerprint no longer matches the source is marked "needs review". The file is res://src/data/localization/tables/<collection>.tres.

Properties ​

Stringcollection""
Dictionarysources{}
Dictionarytexts{}
Dictionaryreviewed{}

Methods ​

Stringget_text( language: String, key: String )
voidset_text( language: String, key: String, text: String )
boolneeds_review( language: String, key: String )
intkey_count()
inttranslated_count( language: String )
Array[String]stale_keys( language: String )

Property descriptions ​

String collection = "" ​

The name of the collection: a database type ("item", "quest") or "toolkit"

Dictionary sources = ​

The source text of every key: key -> text, as it was when the table was last updated from the data

Dictionary texts = ​

The translations: language code -> { key -> text }

Dictionary reviewed = ​

The fingerprint of the source text each translation was written for: language code -> { key -> int }

Method descriptions ​

String get_text( language: String, key: String ) ​

The translation of a key in a language, or "" when there is none

void set_text( language: String, key: String, text: String ) ​

Sets the translation of a key and remembers which source text it was written for

bool needs_review( language: String, key: String ) ​

Has the source text changed since this translation was written?

int key_count() ​

The number of keys in the table

int translated_count( language: String ) ​

The number of keys that have a translation in a language

Array[String] stale_keys( language: String ) ​

The keys whose translation needs review in a language