mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
classref: Sync with latest 4.0-alpha
This commit is contained in:
@@ -35,31 +35,47 @@ Properties
|
||||
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| |
|
||||
+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Translation<class_Translation>` | :ref:`get_translation_object<class_TranslationServer_method_get_translation_object>` **(** :ref:`String<class_String>` locale **)** |
|
||||
+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`StringName<class_StringName>` | :ref:`pseudolocalize<class_TranslationServer_method_pseudolocalize>` **(** :ref:`StringName<class_StringName>` message **)** |const| |
|
||||
+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`reload_pseudolocalization<class_TranslationServer_method_reload_pseudolocalization>` **(** **)** |
|
||||
+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| 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:`StringName<class_StringName>` | :ref:`translate<class_TranslationServer_method_translate>` **(** :ref:`StringName<class_StringName>` message, :ref:`StringName<class_StringName>` context="" **)** |const| |
|
||||
+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`StringName<class_StringName>` | :ref:`translate_plural<class_TranslationServer_method_translate_plural>` **(** :ref:`StringName<class_StringName>` message, :ref:`StringName<class_StringName>` plural_message, :ref:`int<class_int>` n, :ref:`StringName<class_StringName>` context="" **)** |const| |
|
||||
+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`add_translation<class_TranslationServer_method_add_translation>` **(** :ref:`Translation<class_Translation>` translation **)** |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`clear<class_TranslationServer_method_clear>` **(** **)** |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`compare_locales<class_TranslationServer_method_compare_locales>` **(** :ref:`String<class_String>` locale_a, :ref:`String<class_String>` locale_b **)** |const| |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_all_countries<class_TranslationServer_method_get_all_countries>` **(** **)** |const| |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_all_languages<class_TranslationServer_method_get_all_languages>` **(** **)** |const| |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_all_scripts<class_TranslationServer_method_get_all_scripts>` **(** **)** |const| |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | :ref:`get_country_name<class_TranslationServer_method_get_country_name>` **(** :ref:`String<class_String>` country **)** |const| |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | :ref:`get_language_name<class_TranslationServer_method_get_language_name>` **(** :ref:`String<class_String>` language **)** |const| |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :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| |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | :ref:`get_script_name<class_TranslationServer_method_get_script_name>` **(** :ref:`String<class_String>` script **)** |const| |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Translation<class_Translation>` | :ref:`get_translation_object<class_TranslationServer_method_get_translation_object>` **(** :ref:`String<class_String>` locale **)** |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`StringName<class_StringName>` | :ref:`pseudolocalize<class_TranslationServer_method_pseudolocalize>` **(** :ref:`StringName<class_StringName>` message **)** |const| |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`reload_pseudolocalization<class_TranslationServer_method_reload_pseudolocalization>` **(** **)** |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| 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:`standardize_locale<class_TranslationServer_method_standardize_locale>` **(** :ref:`String<class_String>` locale **)** |const| |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`StringName<class_StringName>` | :ref:`translate<class_TranslationServer_method_translate>` **(** :ref:`StringName<class_StringName>` message, :ref:`StringName<class_StringName>` context="" **)** |const| |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`StringName<class_StringName>` | :ref:`translate_plural<class_TranslationServer_method_translate_plural>` **(** :ref:`StringName<class_StringName>` message, :ref:`StringName<class_StringName>` plural_message, :ref:`int<class_int>` n, :ref:`StringName<class_StringName>` context="" **)** |const| |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
@@ -97,6 +113,54 @@ Clears the server from all translations.
|
||||
|
||||
----
|
||||
|
||||
.. _class_TranslationServer_method_compare_locales:
|
||||
|
||||
- :ref:`int<class_int>` **compare_locales** **(** :ref:`String<class_String>` locale_a, :ref:`String<class_String>` locale_b **)** |const|
|
||||
|
||||
Compares two locales and return similarity score between ``0``\ (no match) and ``10``\ (full match).
|
||||
|
||||
----
|
||||
|
||||
.. _class_TranslationServer_method_get_all_countries:
|
||||
|
||||
- :ref:`PackedStringArray<class_PackedStringArray>` **get_all_countries** **(** **)** |const|
|
||||
|
||||
Returns array of known country codes.
|
||||
|
||||
----
|
||||
|
||||
.. _class_TranslationServer_method_get_all_languages:
|
||||
|
||||
- :ref:`PackedStringArray<class_PackedStringArray>` **get_all_languages** **(** **)** |const|
|
||||
|
||||
Returns array of known language codes.
|
||||
|
||||
----
|
||||
|
||||
.. _class_TranslationServer_method_get_all_scripts:
|
||||
|
||||
- :ref:`PackedStringArray<class_PackedStringArray>` **get_all_scripts** **(** **)** |const|
|
||||
|
||||
Returns array of known script codes.
|
||||
|
||||
----
|
||||
|
||||
.. _class_TranslationServer_method_get_country_name:
|
||||
|
||||
- :ref:`String<class_String>` **get_country_name** **(** :ref:`String<class_String>` country **)** |const|
|
||||
|
||||
Returns readable country name for the ``country`` code.
|
||||
|
||||
----
|
||||
|
||||
.. _class_TranslationServer_method_get_language_name:
|
||||
|
||||
- :ref:`String<class_String>` **get_language_name** **(** :ref:`String<class_String>` language **)** |const|
|
||||
|
||||
Returns readable language name for the ``language`` code.
|
||||
|
||||
----
|
||||
|
||||
.. _class_TranslationServer_method_get_loaded_locales:
|
||||
|
||||
- :ref:`Array<class_Array>` **get_loaded_locales** **(** **)** |const|
|
||||
@@ -123,13 +187,21 @@ Returns a locale's language and its variant (e.g. ``"en_US"`` would return ``"En
|
||||
|
||||
----
|
||||
|
||||
.. _class_TranslationServer_method_get_script_name:
|
||||
|
||||
- :ref:`String<class_String>` **get_script_name** **(** :ref:`String<class_String>` script **)** |const|
|
||||
|
||||
Returns readable script name for the ``script`` code.
|
||||
|
||||
----
|
||||
|
||||
.. _class_TranslationServer_method_get_translation_object:
|
||||
|
||||
- :ref:`Translation<class_Translation>` **get_translation_object** **(** :ref:`String<class_String>` locale **)**
|
||||
|
||||
Returns the :ref:`Translation<class_Translation>` instance based on the ``locale`` passed in.
|
||||
|
||||
It will return a ``nullptr`` if there is no :ref:`Translation<class_Translation>` instance that matches the ``locale``.
|
||||
It will return ``null`` if there is no :ref:`Translation<class_Translation>` instance that matches the ``locale``.
|
||||
|
||||
----
|
||||
|
||||
@@ -167,6 +239,14 @@ If translations have been loaded beforehand for the new locale, they will be app
|
||||
|
||||
----
|
||||
|
||||
.. _class_TranslationServer_method_standardize_locale:
|
||||
|
||||
- :ref:`String<class_String>` **standardize_locale** **(** :ref:`String<class_String>` locale **)** |const|
|
||||
|
||||
Retunrs ``locale`` string standardized to match known locales (e.g. ``en-US`` would be matched to ``en_US``).
|
||||
|
||||
----
|
||||
|
||||
.. _class_TranslationServer_method_translate:
|
||||
|
||||
- :ref:`StringName<class_StringName>` **translate** **(** :ref:`StringName<class_StringName>` message, :ref:`StringName<class_StringName>` context="" **)** |const|
|
||||
|
||||
Reference in New Issue
Block a user