![]() |
sol.language
lets you get and set the current language and manage language-specific data.
Each language is identified by a code (like "en"
, "fr"
) and has a human-readable name (like "English"
, "Français"
). The language code corresponds to the name of the directory with files translated
in this language (sprites, strings and dialogs).
The list of languages available in your quest is specified in the quest resource list project_db.dat.
Returns the code of the current language.
nil
if no language was set.Changes the current language.
code
(string): The code that identifies the new language to set. It must be a valid code as defined in project_db.dat.Returns the human-readable name of a language.
code
(string, optional): The code of a language (no value means the current language).Returns the list of available languages.
project_db.dat
.Returns a string translated in the current language.
Translated strings are defined in the file text/strings.dat of the language-specific directory (e.g. languages/en/text/strings.dat
).
key
(string): Key of the string to get. The corresponding key-value pair must be defined in text/strings.dat.nil
if it does not exist.Returns a dialog translated in the current language.
Translated dialogs are defined in the file text/dialogs.dat of the language-specific directory (e.g. languages/en/text/dialogs.dat
).
dialog_id
(string): Id of the dialog to get.nil
if it does not exist. The dialog is a table with at least the following two entries:
dialog_id
(string): Id of the dialog.text
(string): Text of the dialog. The table also contains all custom entries defined in text/dialogs.dat for this dialog. These custom entries always have string keys and string
values. Values that were defined as numbers in "text/dialogs.dat"
are replaced in this table by their string representation, and values that were defined as booleans are replaced by the string "1"
for true
and "0"
for false
.