TranslationDomain

package
v0.0.0-...-ff35923 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 23 Imported by: 0

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

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 Any

type Any interface {
	gd.IsClass
	AsTranslationDomain() Instance
}

type Expanded

type Expanded [1]gdclass.TranslationDomain

func (Expanded) Translate

func (self Expanded) Translate(message string, context string) string

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

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

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]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsTranslationDomain

func (self *Extension[T]) AsTranslationDomain() Instance

type ID

type ID Object.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.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

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 New

func New() Instance

func (Instance) AddTranslation

func (self Instance) AddTranslation(translation Translation.Instance)

Adds a translation.

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsTranslationDomain

func (self Instance) AsTranslationDomain() Instance

func (Instance) Clear

func (self Instance) Clear()

Removes all translations.

func (Instance) Enabled

func (self Instance) Enabled() bool

func (Instance) GetLocaleOverride

func (self Instance) GetLocaleOverride() string

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) ID

func (self Instance) ID() ID

func (Instance) PseudolocalizationAccentsEnabled

func (self Instance) PseudolocalizationAccentsEnabled() bool

func (Instance) PseudolocalizationDoubleVowelsEnabled

func (self Instance) PseudolocalizationDoubleVowelsEnabled() bool

func (Instance) PseudolocalizationEnabled

func (self Instance) PseudolocalizationEnabled() bool

func (Instance) PseudolocalizationExpansionRatio

func (self Instance) PseudolocalizationExpansionRatio() Float.X

func (Instance) PseudolocalizationFakeBidiEnabled

func (self Instance) PseudolocalizationFakeBidiEnabled() bool

func (Instance) PseudolocalizationOverrideEnabled

func (self Instance) PseudolocalizationOverrideEnabled() bool

func (Instance) PseudolocalizationPrefix

func (self Instance) PseudolocalizationPrefix() string

func (Instance) PseudolocalizationSkipPlaceholdersEnabled

func (self Instance) PseudolocalizationSkipPlaceholdersEnabled() bool

func (Instance) PseudolocalizationSuffix

func (self Instance) PseudolocalizationSuffix() string

func (Instance) Pseudolocalize

func (self Instance) Pseudolocalize(message string) string

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 (self Instance) SetEnabled(value bool)

func (Instance) SetLocaleOverride

func (self Instance) SetLocaleOverride(locale string)

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) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetPseudolocalizationAccentsEnabled

func (self Instance) SetPseudolocalizationAccentsEnabled(value bool)

func (Instance) SetPseudolocalizationDoubleVowelsEnabled

func (self Instance) SetPseudolocalizationDoubleVowelsEnabled(value bool)

func (Instance) SetPseudolocalizationEnabled

func (self Instance) SetPseudolocalizationEnabled(value bool)

func (Instance) SetPseudolocalizationExpansionRatio

func (self Instance) SetPseudolocalizationExpansionRatio(value Float.X)

func (Instance) SetPseudolocalizationFakeBidiEnabled

func (self Instance) SetPseudolocalizationFakeBidiEnabled(value bool)

func (Instance) SetPseudolocalizationOverrideEnabled

func (self Instance) SetPseudolocalizationOverrideEnabled(value bool)

func (Instance) SetPseudolocalizationPrefix

func (self Instance) SetPseudolocalizationPrefix(value string)

func (Instance) SetPseudolocalizationSkipPlaceholdersEnabled

func (self Instance) SetPseudolocalizationSkipPlaceholdersEnabled(value bool)

func (Instance) SetPseudolocalizationSuffix

func (self Instance) SetPseudolocalizationSuffix(value string)

func (Instance) Translate

func (self Instance) Translate(message string) string

Returns the current locale's translation for the given message and context.

func (Instance) TranslatePlural

func (self Instance) TranslatePlural(message string, message_plural string, n int) 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.

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL