Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
TranslationDomainΒΆ
Inherits: RefCounted < Object
A self-contained collection of Translation resources.
DescriptionΒΆ
TranslationDomain is a self-contained collection of Translation resources. Translations can be added to or removed from it.
If you're working with the main translation domain, it is more convenient to use the wrap methods on TranslationServer.
MethodsΒΆ
void |
add_translation(translation: Translation) |
void |
clear() |
get_translation_object(locale: String) const |
|
void |
remove_translation(translation: Translation) |
translate(message: StringName, context: StringName = &"") const |
|
translate_plural(message: StringName, message_plural: StringName, n: int, context: StringName = &"") const |
Method DescriptionsΒΆ
void add_translation(translation: Translation) π
Adds a translation.
void clear() π
Removes all translations.
Translation get_translation_object(locale: String) const π
Returns the Translation instance that best matches locale. Returns null if there are no matches.
void remove_translation(translation: Translation) π
Removes the given translation.
StringName translate(message: StringName, context: StringName = &"") const π
Returns the current locale's translation for the given message and context.
StringName translate_plural(message: StringName, message_plural: StringName, n: int, context: StringName = &"") const π
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.