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 ​
String | collection | "" |
Dictionary | sources | {} |
Dictionary | texts | {} |
Dictionary | reviewed | {} |
Methods ​
String | get_text( language: String, key: String ) |
void | set_text( language: String, key: String, text: String ) |
bool | needs_review( language: String, key: String ) |
int | key_count() |
int | translated_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