Skip to content

$locs

Localised text.

13 natives. Read-only natives only look things up; the rest change something. Parameter types use the language's names (Types).

get_enable_subtitles_by_default

read-only
$locs.get_enable_subtitles_by_default() -> bool

Gets whether or not to enable subtitles by default in the current language.

Returns bool: True to enable default subtitles, false otherwise.

get_keyboard_layout

read-only
$locs.get_keyboard_layout() -> int

Note this doesn't detect the actual keyboard layout. See locs.set_keyboard_layout().

Returns int: The keyboard layout as vlocs_keyboard_layout_t.

get_language

read-only
$locs.get_language() -> string

Get the current language.

Returns string: The 2-digit language code for the current language.

get_platform_appearance

read-only
$locs.get_platform_appearance() -> int

Get the current platform appearance.

Returns int: The numeric ID of the current platform appearance.

get_platform_appearance_for_gamepad

read-only
$locs.get_platform_appearance_for_gamepad(gamepad_index: int) -> int

Get the platform appearance associated with a specified gamepad index.

ParameterTypeMeaning
gamepad_indexintThe gamepad index to check.

Returns int: The platform appearance of the gamepad.

get_platform_appearance_name

read-only
$locs.get_platform_appearance_name() -> string

Get the name of the current platform appearance.

Returns string: Name of the current platform appearance.

set_formatter_value

$locs.set_formatter_value(formatter: Reference, value: var)

Set the underlying value of a number formatter.

ParameterTypeMeaning
formatterReferenceThe formatter to set the value on.
valuevarThe value to set.

set_keyboard_layout

$locs.set_keyboard_layout(keyboard_layout: int)

Sets the current keyboard layout for display. To detect the current keyboard layout, see input.detect_keyboard_layout().

ParameterTypeMeaning
keyboard_layoutintThe keyboard layout as vlocs_keyboard_layout_t.

set_language

$locs.set_language(lang: string)

Set the current language.

ParameterTypeMeaning
langstringThe 2-digit language code for the language to set.

set_platform_appearance

$locs.set_platform_appearance(platform_appearance: int)

Set the current platform appearance if on PC. This primarily affects text glyphs.

ParameterTypeMeaning
platform_appearanceintThe desired platform appearance.

string_has_current_language

read-only
$locs.string_has_current_language(text: Reference) -> bool

Returns if the localized text object has a translation for the current language.

ParameterTypeMeaning
textReferenceThe localized string data.

Returns bool: If the localized text object has a translation for the current language.

translate_ref

$locs.translate_ref(ref: Reference) -> Reference

Gets the correct object for the current language from a localized ref object.

ParameterTypeMeaning
refReferenceThe localized ref data.

Returns Reference: The translated reference.

translate_string

read-only
$locs.translate_string(text: Reference) -> string

Gets the correct translation for the current language from a localized text object.

ParameterTypeMeaning
textReferenceThe localized string data.

Returns string: The translated text.