:github_url: hide .. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the TranslationServer.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_TranslationServer: TranslationServer ================= **Inherits:** :ref:`Object` **Category:** Core Brief Description ----------------- Server that manages all translations. Methods ------- +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_translation` **(** :ref:`Translation` translation **)** | +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear` **(** **)** | +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`get_loaded_locales` **(** **)** const | +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_locale` **(** **)** const | +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_locale_name` **(** :ref:`String` locale **)** const | +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_translation` **(** :ref:`Translation` translation **)** | +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_locale` **(** :ref:`String` locale **)** | +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`translate` **(** :ref:`String` message **)** const | +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ Description ----------- Server that manages all translations. Translations can be set to it and removed from it. Tutorials --------- - :doc:`../tutorials/i18n/internationalizing_games` - :doc:`../tutorials/i18n/locales` Method Descriptions ------------------- .. _class_TranslationServer_method_add_translation: - void **add_translation** **(** :ref:`Translation` translation **)** Adds a :ref:`Translation` resource. ---- .. _class_TranslationServer_method_clear: - void **clear** **(** **)** Clears the server from all translations. ---- .. _class_TranslationServer_method_get_loaded_locales: - :ref:`Array` **get_loaded_locales** **(** **)** const ---- .. _class_TranslationServer_method_get_locale: - :ref:`String` **get_locale** **(** **)** const Returns the current locale of the game. ---- .. _class_TranslationServer_method_get_locale_name: - :ref:`String` **get_locale_name** **(** :ref:`String` locale **)** const Returns a locale's language and its variant (e.g. "en_US" would return "English (United States)"). ---- .. _class_TranslationServer_method_remove_translation: - void **remove_translation** **(** :ref:`Translation` translation **)** Removes the given translation from the server. ---- .. _class_TranslationServer_method_set_locale: - void **set_locale** **(** :ref:`String` locale **)** Sets the locale of the game. ---- .. _class_TranslationServer_method_translate: - :ref:`String` **translate** **(** :ref:`String` message **)** const Returns the current locale's translation for the given message (key).