mirror of
https://github.com/godotengine/godot-docs.git
synced 2025-12-31 17:49:03 +03:00
117 lines
5.4 KiB
ReStructuredText
117 lines
5.4 KiB
ReStructuredText
: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/<name>/doc_classes.
|
|
|
|
.. _class_TranslationServer:
|
|
|
|
TranslationServer
|
|
=================
|
|
|
|
**Inherits:** :ref:`Object<class_Object>`
|
|
|
|
Server that manages all translations.
|
|
|
|
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`
|
|
|
|
Methods
|
|
-------
|
|
|
|
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`add_translation<class_TranslationServer_method_add_translation>` **(** :ref:`Translation<class_Translation>` translation **)** |
|
|
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear<class_TranslationServer_method_clear>` **(** **)** |
|
|
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Array<class_Array>` | :ref:`get_loaded_locales<class_TranslationServer_method_get_loaded_locales>` **(** **)** |const| |
|
|
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`String<class_String>` | :ref:`get_locale<class_TranslationServer_method_get_locale>` **(** **)** |const| |
|
|
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`String<class_String>` | :ref:`get_locale_name<class_TranslationServer_method_get_locale_name>` **(** :ref:`String<class_String>` locale **)** |const| |
|
|
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`remove_translation<class_TranslationServer_method_remove_translation>` **(** :ref:`Translation<class_Translation>` translation **)** |
|
|
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_locale<class_TranslationServer_method_set_locale>` **(** :ref:`String<class_String>` locale **)** |
|
|
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`String<class_String>` | :ref:`translate<class_TranslationServer_method_translate>` **(** :ref:`String<class_String>` message **)** |const| |
|
|
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Method Descriptions
|
|
-------------------
|
|
|
|
.. _class_TranslationServer_method_add_translation:
|
|
|
|
- void **add_translation** **(** :ref:`Translation<class_Translation>` translation **)**
|
|
|
|
Adds a :ref:`Translation<class_Translation>` resource.
|
|
|
|
----
|
|
|
|
.. _class_TranslationServer_method_clear:
|
|
|
|
- void **clear** **(** **)**
|
|
|
|
Clears the server from all translations.
|
|
|
|
----
|
|
|
|
.. _class_TranslationServer_method_get_loaded_locales:
|
|
|
|
- :ref:`Array<class_Array>` **get_loaded_locales** **(** **)** |const|
|
|
|
|
Returns an Array of all loaded locales of the game.
|
|
|
|
----
|
|
|
|
.. _class_TranslationServer_method_get_locale:
|
|
|
|
- :ref:`String<class_String>` **get_locale** **(** **)** |const|
|
|
|
|
Returns the current locale of the game.
|
|
|
|
----
|
|
|
|
.. _class_TranslationServer_method_get_locale_name:
|
|
|
|
- :ref:`String<class_String>` **get_locale_name** **(** :ref:`String<class_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<class_Translation>` translation **)**
|
|
|
|
Removes the given translation from the server.
|
|
|
|
----
|
|
|
|
.. _class_TranslationServer_method_set_locale:
|
|
|
|
- void **set_locale** **(** :ref:`String<class_String>` locale **)**
|
|
|
|
Sets the locale of the game.
|
|
|
|
----
|
|
|
|
.. _class_TranslationServer_method_translate:
|
|
|
|
- :ref:`String<class_String>` **translate** **(** :ref:`String<class_String>` message **)** |const|
|
|
|
|
Returns the current locale's translation for the given message (key).
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
|
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
|
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|