W3cubDocs

/Godot 3.1

Translation

Inherits: Resource < Reference < Object

Inherited By: PHashTranslation

Category: Core

Brief Description

Language Translation.

Properties

String locale

Methods

void add_message ( String src_message, String xlated_message )
void erase_message ( String src_message )
String get_message ( String src_message ) const
int get_message_count ( ) const
PoolStringArray get_message_list ( ) const

Description

Translations are resources that can be loaded/unloaded on demand. They map a string to another string.

Tutorials

Property Descriptions

String locale

Setter set_locale(value)
Getter get_locale()

The locale of the translation.

Method Descriptions

void add_message ( String src_message, String xlated_message )

Adds a message if nonexistent, followed by its translation.

void erase_message ( String src_message )

Erases a message.

String get_message ( String src_message ) const

Returns a message’s translation.

int get_message_count ( ) const

Returns the number of existing messages.

PoolStringArray get_message_list ( ) const

Returns all the messages (keys).

© 2014–2019 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
http://docs.godotengine.org/en/3.1/classes/class_translation.html