123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- :github_url: hide
- .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
- .. DO NOT EDIT THIS FILE, but the Translation.xml source instead.
- .. The source is found in doc/classes or modules/<name>/doc_classes.
- .. _class_Translation:
- Translation
- ===========
- **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
- **Inherited By:** :ref:`PHashTranslation<class_PHashTranslation>`
- Language Translation.
- Description
- -----------
- Translations are resources that can be loaded and unloaded on demand. They map a string to another string.
- Tutorials
- ---------
- - :doc:`../tutorials/i18n/internationalizing_games`
- - :doc:`../tutorials/i18n/locales`
- Properties
- ----------
- +-----------------------------+--------------------------------------------------+----------+
- | :ref:`String<class_String>` | :ref:`locale<class_Translation_property_locale>` | ``"en"`` |
- +-----------------------------+--------------------------------------------------+----------+
- Methods
- -------
- +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`_get_message<class_Translation_method__get_message>` **(** :ref:`String<class_String>` src_message **)** |virtual| |
- +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`add_message<class_Translation_method_add_message>` **(** :ref:`String<class_String>` src_message, :ref:`String<class_String>` xlated_message **)** |
- +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`erase_message<class_Translation_method_erase_message>` **(** :ref:`String<class_String>` src_message **)** |
- +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`get_message<class_Translation_method_get_message>` **(** :ref:`String<class_String>` src_message **)** |const| |
- +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_message_count<class_Translation_method_get_message_count>` **(** **)** |const| |
- +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_message_list<class_Translation_method_get_message_list>` **(** **)** |const| |
- +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
- Property Descriptions
- ---------------------
- .. _class_Translation_property_locale:
- - :ref:`String<class_String>` **locale**
- +-----------+-------------------+
- | *Default* | ``"en"`` |
- +-----------+-------------------+
- | *Setter* | set_locale(value) |
- +-----------+-------------------+
- | *Getter* | get_locale() |
- +-----------+-------------------+
- The locale of the translation.
- Method Descriptions
- -------------------
- .. _class_Translation_method__get_message:
- - :ref:`String<class_String>` **_get_message** **(** :ref:`String<class_String>` src_message **)** |virtual|
- Virtual method to override :ref:`get_message<class_Translation_method_get_message>`.
- ----
- .. _class_Translation_method_add_message:
- - void **add_message** **(** :ref:`String<class_String>` src_message, :ref:`String<class_String>` xlated_message **)**
- Adds a message if nonexistent, followed by its translation.
- ----
- .. _class_Translation_method_erase_message:
- - void **erase_message** **(** :ref:`String<class_String>` src_message **)**
- Erases a message.
- ----
- .. _class_Translation_method_get_message:
- - :ref:`String<class_String>` **get_message** **(** :ref:`String<class_String>` src_message **)** |const|
- Returns a message's translation.
- ----
- .. _class_Translation_method_get_message_count:
- - :ref:`int<class_int>` **get_message_count** **(** **)** |const|
- Returns the number of existing messages.
- ----
- .. _class_Translation_method_get_message_list:
- - :ref:`PoolStringArray<class_PoolStringArray>` **get_message_list** **(** **)** |const|
- Returns all the messages (keys).
- .. |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.)`
|