W3cubDocs

/Godot 3.1

TranslationServer

Inherits: Object

Category: Core

Brief Description

Server that manages all translations.

Methods

void add_translation ( Translation translation )
void clear ( )
String get_locale ( ) const
String get_locale_name ( String locale ) const
void remove_translation ( Translation translation )
void set_locale ( String locale )
String translate ( String message ) const

Description

Server that manages all translations. Translations can be set to it and removed from it.

Tutorials

Method Descriptions

void add_translation ( Translation translation )

Adds a Translation resource.

void clear ( )

Clears the server from all translations.

String get_locale ( ) const

Returns the current locale of the game.

String get_locale_name ( String locale ) const

Returns a locale’s language and its variant (e.g. “en_US” would return “English (United States)”).

void remove_translation ( Translation translation )

Removes the given translation from the server.

void set_locale ( String locale )

Sets the locale of the game.

String translate ( String message ) const

Returns the current locale’s translation for the given message (key).

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