Documentation
¶
Overview ¶
graphics.gd/classdb/TranslationDomain is a self-contained collection of graphics.gd/classdb/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 graphics.gd/classdb/TranslationServer.
Index ¶
- type Advanced
- type Any
- type Expanded
- type Extension
- type ID
- type Instance
- func (self Instance) AddTranslation(translation Translation.Instance)
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsTranslationDomain() Instance
- func (self Instance) Clear()
- func (self Instance) Enabled() bool
- func (self Instance) GetLocaleOverride() string
- func (self Instance) GetTranslationObject(locale string) Translation.Instance
- func (self Instance) ID() ID
- func (self Instance) PseudolocalizationAccentsEnabled() bool
- func (self Instance) PseudolocalizationDoubleVowelsEnabled() bool
- func (self Instance) PseudolocalizationEnabled() bool
- func (self Instance) PseudolocalizationExpansionRatio() Float.X
- func (self Instance) PseudolocalizationFakeBidiEnabled() bool
- func (self Instance) PseudolocalizationOverrideEnabled() bool
- func (self Instance) PseudolocalizationPrefix() string
- func (self Instance) PseudolocalizationSkipPlaceholdersEnabled() bool
- func (self Instance) PseudolocalizationSuffix() string
- func (self Instance) Pseudolocalize(message string) string
- func (self Instance) RemoveTranslation(translation Translation.Instance)
- func (self Instance) SetEnabled(value bool)
- func (self Instance) SetLocaleOverride(locale string)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetPseudolocalizationAccentsEnabled(value bool)
- func (self Instance) SetPseudolocalizationDoubleVowelsEnabled(value bool)
- func (self Instance) SetPseudolocalizationEnabled(value bool)
- func (self Instance) SetPseudolocalizationExpansionRatio(value Float.X)
- func (self Instance) SetPseudolocalizationFakeBidiEnabled(value bool)
- func (self Instance) SetPseudolocalizationOverrideEnabled(value bool)
- func (self Instance) SetPseudolocalizationPrefix(value string)
- func (self Instance) SetPseudolocalizationSkipPlaceholdersEnabled(value bool)
- func (self Instance) SetPseudolocalizationSuffix(value string)
- func (self Instance) Translate(message string) string
- func (self Instance) TranslatePlural(message string, message_plural string, n int) string
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Expanded ¶
type Expanded [1]gdclass.TranslationDomain
func (Expanded) Translate ¶
Returns the current locale's translation for the given message and context.
func (Expanded) TranslatePlural ¶
func (self Expanded) TranslatePlural(message string, message_plural string, n int, context string) string
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.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsTranslationDomain ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.TranslationDomain
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddTranslation ¶
func (self Instance) AddTranslation(translation Translation.Instance)
Adds a translation.
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsTranslationDomain ¶
func (Instance) GetLocaleOverride ¶
Returns the locale override of the domain. Returns an empty string if locale override is disabled.
func (Instance) GetTranslationObject ¶
func (self Instance) GetTranslationObject(locale string) Translation.Instance
Returns the graphics.gd/classdb/Translation instance that best matches 'locale'. Returns null if there are no matches.
func (Instance) PseudolocalizationAccentsEnabled ¶
func (Instance) PseudolocalizationDoubleVowelsEnabled ¶
func (Instance) PseudolocalizationEnabled ¶
func (Instance) PseudolocalizationExpansionRatio ¶
func (Instance) PseudolocalizationFakeBidiEnabled ¶
func (Instance) PseudolocalizationOverrideEnabled ¶
func (Instance) PseudolocalizationPrefix ¶
func (Instance) PseudolocalizationSkipPlaceholdersEnabled ¶
func (Instance) PseudolocalizationSuffix ¶
func (Instance) Pseudolocalize ¶
Returns the pseudolocalized string based on the 'message' passed in.
func (Instance) RemoveTranslation ¶
func (self Instance) RemoveTranslation(translation Translation.Instance)
Removes the given translation.
func (Instance) SetEnabled ¶
func (Instance) SetLocaleOverride ¶
Sets the locale override of the domain.
If 'locale' is an empty string, locale override is disabled. Otherwise, 'locale' will be standardized to match known locales (e.g. en-US would be matched to en_US).
Note: Calling this method does not automatically update texts in the scene tree. Please propagate the [Mainloop.NotificationTranslationChanged] signal manually.
func (Instance) SetPseudolocalizationAccentsEnabled ¶
func (Instance) SetPseudolocalizationDoubleVowelsEnabled ¶
func (Instance) SetPseudolocalizationEnabled ¶
func (Instance) SetPseudolocalizationExpansionRatio ¶
func (Instance) SetPseudolocalizationFakeBidiEnabled ¶
func (Instance) SetPseudolocalizationOverrideEnabled ¶
func (Instance) SetPseudolocalizationPrefix ¶
func (Instance) SetPseudolocalizationSkipPlaceholdersEnabled ¶
func (Instance) SetPseudolocalizationSuffix ¶
func (Instance) Translate ¶
Returns the current locale's translation for the given message and context.
func (Instance) TranslatePlural ¶
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.