Documentation
¶
Overview ¶
[Translation]s are resources that can be loaded and unloaded on demand. They map a collection of strings to their individual translations, and they also provide convenience methods for pluralization.
Index ¶
- type Advanced
- type Any
- type Expanded
- func (self Expanded) AddMessage(src_message string, xlated_message string, context string)
- func (self Expanded) AddPluralMessage(src_message string, xlated_messages []string, context string)
- func (self Expanded) EraseMessage(src_message string, context string)
- func (self Expanded) GetMessage(src_message string, context string) string
- func (self Expanded) GetPluralMessage(src_message string, src_plural_message string, n int, context string) string
- type Extension
- type ID
- type Implementation
- type Instance
- func (self Instance) AddMessage(src_message string, xlated_message string)
- func (self Instance) AddPluralMessage(src_message string, xlated_messages []string)
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) AsTranslation() Instance
- func (self Instance) EraseMessage(src_message string)
- func (self Instance) GetMessage(src_message string) string
- func (self Instance) GetMessageCount() int
- func (self Instance) GetMessageList() []string
- func (self Instance) GetPluralMessage(src_message string, src_plural_message string, n int) string
- func (self Instance) GetTranslatedMessageList() []string
- func (self Instance) ID() ID
- func (self Instance) Locale() string
- func (self Instance) SetLocale(value string)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) Virtual(name string) reflect.Value
- type Interface
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.Translation
func (Expanded) AddMessage ¶
Adds a message if nonexistent, followed by its translation. An additional context could be used to specify the translation context or differentiate polysemic words.
func (Expanded) AddPluralMessage ¶
Adds a message involving plural translation if nonexistent, followed by its translation. An additional context could be used to specify the translation context or differentiate polysemic words.
func (Expanded) EraseMessage ¶
Erases a message.
func (Expanded) GetMessage ¶
Returns a message's translation.
func (Expanded) GetPluralMessage ¶
func (self Expanded) GetPluralMessage(src_message string, src_plural_message string, n int, context string) string
Returns a message's translation involving plurals. 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]) AsResource ¶
func (*Extension[T]) AsTranslation ¶
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 Implementation ¶
type Implementation = implementation
Implementation implements Interface with empty methods.
type Instance ¶
type Instance [1]gdclass.Translation
Instance of the class with convieniently typed arguments and results. See Interface for methods that can be overridden by a [Class] that extends it.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddMessage ¶
Adds a message if nonexistent, followed by its translation. An additional context could be used to specify the translation context or differentiate polysemic words.
func (Instance) AddPluralMessage ¶
Adds a message involving plural translation if nonexistent, followed by its translation. An additional context could be used to specify the translation context or differentiate polysemic words.
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) AsTranslation ¶
func (Instance) EraseMessage ¶
Erases a message.
func (Instance) GetMessage ¶
Returns a message's translation.
func (Instance) GetMessageCount ¶
Returns the number of existing messages.
func (Instance) GetMessageList ¶
Returns all the messages (keys).
func (Instance) GetPluralMessage ¶
Returns a message's translation involving plurals. 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.
func (Instance) GetTranslatedMessageList ¶
Returns all the messages (translated text).