class-description NEWS COMMUNITY STORE TUTORIALS SIGN UP LOGIN LOGOUT ROKOJORI NEWSLETTER SIGN UP LOGIN LOGOUT NEWS COMMUNITY STORE TUTORIALS TOGGLE FULLSCREEN VOLLBILD AN/AUS Object TranslationServer
The server responsible for language translations.

The server that manages all language translations. Translations can be added to or removed from it.

bool pseudolocalization_enabled<>():bool

If true, enables the use of pseudolocalization. See ProjectSettings.internationalization/pseudolocalization/use_pseudolocalization for details.

void add_translation<>( Translation translation=, translation:Translation=, ):void

Adds a Translation resource.

void clear<>():void

Clears the server from all translations.

int compare_locales<>( String locale_a=, locale_a:String=, String locale_b=, locale_b:String=, ):int

Compares two locales and returns a similarity score between 0 (no match) and 10 (full match).

PackedStringArray get_all_countries<>():PackedStringArray

Returns an array of known country codes.

PackedStringArray get_all_languages<>():PackedStringArray

Returns array of known language codes.

PackedStringArray get_all_scripts<>():PackedStringArray

Returns an array of known script codes.

String get_country_name<>( String country=, country:String=, ):String

Returns a readable country name for the country code.

String get_language_name<>( String language=, language:String=, ):String

Returns a readable language name for the language code.

PackedStringArray get_loaded_locales<>():PackedStringArray

Returns an array of all loaded locales of the project.

String get_locale<>():String

Returns the current locale of the project.

See also OS.get_locale and OS.get_locale_language to query the locale of the user system.

String get_locale_name<>( String locale=, locale:String=, ):String

Returns a locale's language and its variant (e.g. "en_US" would return "English (United States)").

String get_script_name<>( String script=, script:String=, ):String

Returns a readable script name for the script code.

String get_tool_locale<>():String

Returns the current locale of the editor.

Note: When called from an exported project returns the same value as get_locale.

Translation get_translation_object<>( String locale=, locale:String=, ):Translation

Returns the Translation instance based on the locale passed in.

It will return null if there is no Translation instance that matches the locale.

StringName pseudolocalize<>( StringName message=, message:StringName=, ):StringName

Returns the pseudolocalized string based on the message passed in.

void reload_pseudolocalization<>():void

Reparses the pseudolocalization options and reloads the translation.

void remove_translation<>( Translation translation=, translation:Translation=, ):void

Removes the given translation from the server.

void set_locale<>( String locale=, locale:String=, ):void

Sets the locale of the project. The locale string will be standardized to match known locales (e.g. en-US would be matched to en_US).

If translations have been loaded beforehand for the new locale, they will be applied.

String standardize_locale<>( String locale=, locale:String=, ):String

Returns a locale string standardized to match known locales (e.g. en-US would be matched to en_US).

StringName translate<>( StringName message=, message:StringName=, StringName context="", context:StringName="", ):StringName

Returns the current locale's translation for the given message (key) and context.

StringName translate_plural<>( StringName message=, message:StringName=, StringName plural_message=, plural_message:StringName=, int n=, n:int=, StringName context="", context:StringName="", ):StringName

Returns the current locale's translation for the given message (key), plural message and context.

The number n is the number or quantity of the plural object. It will be used to guide the translation system to fetch the correct plural form for the selected language.




All social media brands are registrated trademarks and belong to their respective owners.





CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
We are using cookies on this site. Read more... Wir benutzen Cookies auf dieser Seite. Mehr lesen...