summaryrefslogtreecommitdiff
path: root/doc/classes/TranslationServer.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/TranslationServer.xml')
-rw-r--r--doc/classes/TranslationServer.xml69
1 files changed, 65 insertions, 4 deletions
diff --git a/doc/classes/TranslationServer.xml b/doc/classes/TranslationServer.xml
index 8a6fa3571a..a4cf070ede 100644
--- a/doc/classes/TranslationServer.xml
+++ b/doc/classes/TranslationServer.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="TranslationServer" inherits="Object" version="4.0">
+<class name="TranslationServer" inherits="Object" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Server that manages all translations.
</brief_description>
@@ -7,8 +7,8 @@
Server that manages all translations. Translations can be set to it and removed from it.
</description>
<tutorials>
- <link title="Internationalizing games">https://docs.godotengine.org/en/latest/tutorials/i18n/internationalizing_games.html</link>
- <link title="Locales">https://docs.godotengine.org/en/latest/tutorials/i18n/locales.html</link>
+ <link title="Internationalizing games">$DOCS_URL/tutorials/i18n/internationalizing_games.html</link>
+ <link title="Locales">$DOCS_URL/tutorials/i18n/locales.html</link>
</tutorials>
<methods>
<method name="add_translation">
@@ -24,6 +24,46 @@
Clears the server from all translations.
</description>
</method>
+ <method name="compare_locales" qualifiers="const">
+ <return type="int" />
+ <argument index="0" name="locale_a" type="String" />
+ <argument index="1" name="locale_b" type="String" />
+ <description>
+ Compares two locales and return similarity score between [code]0[/code](no match) and [code]10[/code](full match).
+ </description>
+ </method>
+ <method name="get_all_countries" qualifiers="const">
+ <return type="PackedStringArray" />
+ <description>
+ Returns array of known country codes.
+ </description>
+ </method>
+ <method name="get_all_languages" qualifiers="const">
+ <return type="PackedStringArray" />
+ <description>
+ Returns array of known language codes.
+ </description>
+ </method>
+ <method name="get_all_scripts" qualifiers="const">
+ <return type="PackedStringArray" />
+ <description>
+ Returns array of known script codes.
+ </description>
+ </method>
+ <method name="get_country_name" qualifiers="const">
+ <return type="String" />
+ <argument index="0" name="country" type="String" />
+ <description>
+ Returns readable country name for the [code]country[/code] code.
+ </description>
+ </method>
+ <method name="get_language_name" qualifiers="const">
+ <return type="String" />
+ <argument index="0" name="language" type="String" />
+ <description>
+ Returns readable language name for the [code]language[/code] code.
+ </description>
+ </method>
<method name="get_loaded_locales" qualifiers="const">
<return type="Array" />
<description>
@@ -44,12 +84,26 @@
Returns a locale's language and its variant (e.g. [code]"en_US"[/code] would return [code]"English (United States)"[/code]).
</description>
</method>
+ <method name="get_script_name" qualifiers="const">
+ <return type="String" />
+ <argument index="0" name="script" type="String" />
+ <description>
+ Returns readable script name for the [code]script[/code] code.
+ </description>
+ </method>
+ <method name="get_tool_locale">
+ <return type="String" />
+ <description>
+ Returns the current locale of the editor.
+ [b]Note:[/b] When called from an exported project returns the same value as [method get_locale].
+ </description>
+ </method>
<method name="get_translation_object">
<return type="Translation" />
<argument index="0" name="locale" type="String" />
<description>
Returns the [Translation] instance based on the [code]locale[/code] passed in.
- It will return a [code]nullptr[/code] if there is no [Translation] instance that matches the [code]locale[/code].
+ It will return [code]null[/code] if there is no [Translation] instance that matches the [code]locale[/code].
</description>
</method>
<method name="pseudolocalize" qualifiers="const">
@@ -80,6 +134,13 @@
If translations have been loaded beforehand for the new locale, they will be applied.
</description>
</method>
+ <method name="standardize_locale" qualifiers="const">
+ <return type="String" />
+ <argument index="0" name="locale" type="String" />
+ <description>
+ Returns [code]locale[/code] string standardized to match known locales (e.g. [code]en-US[/code] would be matched to [code]en_US[/code]).
+ </description>
+ </method>
<method name="translate" qualifiers="const">
<return type="StringName" />
<argument index="0" name="message" type="StringName" />