1.07 - Language functions

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.

Functions of sol.language

sol.language.get_language()

Returns the code of the current language.

sol.language.set_language(code)

Changes the current language.

sol.language.get_language_name([code])

Returns the human-readable name of a language.

sol.language.get_languages()

Returns the list of available languages.

sol.language.get_string(key)

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).

sol.language.get_dialog(dialog_id)

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).