i18n

package
v0.115.1 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: Apache-2.0 Imports: 20 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TranslationProvider

type TranslationProvider struct {
	// contains filtered or unexported fields
}

TranslationProvider provides translation handling, i.e. loading of bundles etc.

func NewTranslationProvider

func NewTranslationProvider() *TranslationProvider

NewTranslationProvider creates a new translation provider.

func (*TranslationProvider) CloneResource added in v0.112.0

func (tp *TranslationProvider) CloneResource(dst, src *deps.Deps) error

CloneResource sets the language func for the new language.

func (*TranslationProvider) NewResource added in v0.112.0

func (tp *TranslationProvider) NewResource(dst *deps.Deps) error

Update updates the i18n func in the provided Deps.

type Translator

type Translator struct {
	// contains filtered or unexported fields
}

Translator handles i18n translations.

func NewTranslator

func NewTranslator(b *i18n.Bundle, cfg config.AllProvider, logger loggers.Logger) Translator

NewTranslator creates a new Translator for the given language bundle and configuration.

func (Translator) Func

func (t Translator) Func(lang string) translateFunc

Func gets the translate func for the given language, or for the default configured language if not found.

Jump to

Keyboard shortcuts

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