The server that manages all language translations. Translations can be added to or removed from it.
If true
, enables the use of pseudolocalization. See ProjectSettings.internationalization/pseudolocalization/use_pseudolocalization for details.
Adds a Translation resource.
Clears the server from all translations.
Compares two locales and returns a similarity score between 0
(no match) and 10
(full match).
Returns an array of known country codes.
Returns array of known language codes.
Returns an array of known script codes.
Returns a readable country name for the country
code.
Returns a readable language name for the language
code.
Returns an array of all loaded locales of the project.
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.
Returns a locale's language and its variant (e.g. "en_US"
would return "English (United States)"
).
Returns a readable script name for the script
code.
Returns the current locale of the editor.
Note: When called from an exported project returns the same value as get_locale.
Returns the Translation instance based on the locale
passed in.
It will return null
if there is no Translation instance that matches the locale
.
Returns the pseudolocalized string based on the message
passed in.
Reparses the pseudolocalization options and reloads the translation.
Removes the given translation from the server.
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.
Returns a locale
string standardized to match known locales (e.g. en-US
would be matched to en_US
).
Returns the current locale's translation for the given message (key) and context.
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.