The server responsible for language translations.
The translation server is the API backend that manages all language translations.
Translations are stored in TranslationDomains, which can be accessed by name. The most commonly used translation domain is the main translation domain. It always exists and can be accessed using an empty StringName. The translation server provides wrapper methods for accessing the main translation domain directly, without having to fetch the translation domain first. Custom translation domains are mainly for advanced usages like editor plugins. Names starting with godot. are reserved for engine internals.
If true, enables the use of pseudolocalization on the main translation domain. See ProjectSettings.internationalization/pseudolocalization/use_pseudolocalization for details.
Returns the Translation instances in the main translation domain that match locale (see compare_locales()). If exact is true, only instances whose locale exactly equals locale will be returned.
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 the translation domain with the specified name. An empty translation domain will be created and added if it does not exist.
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 that best matches locale in the main translation domain. Returns null if there are no matches.
Returns all available Translation instances in the main translation domain as added by add_translation().
Returns true if there are any Translation instances in the main translation domain that match locale (see compare_locales()). If exact is true, only instances whose locale exactly equals locale are considered.
Returns the pseudolocalized string based on the message passed in.
Note: This method always uses the main translation domain.
Reparses the pseudolocalization options and reloads the translation for the main translation domain.
Removes the translation domain with the specified name.
Note: Trying to remove the main translation domain is an error.
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). If add_defaults is true, the locale may have a default script or country added.
Returns the current locale's translation for the given message and context.
Note: This method always uses the main translation domain.
Returns the current locale's translation for the given message, 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.
Note: This method always uses the main translation domain.