i18n

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLocalizer

func SetLocalizer(l Localizer)

SetLocalizer sets the global Localizer to the provided implementation.

Types

type Localizer

type Localizer interface {
	// NewTranslator returns a Translator for the specified language.
	NewTranslator(lang string) Translator

	// GetDefaultLanguage returns the default language setting.
	GetDefaultLanguage() string

	// GetAvailableLanguages returns a list of available languages.
	GetAvailableLanguages() []string
}

Localizer defines the methods required for language localization.

func GetLocalizer

func GetLocalizer() Localizer

GetLocalizer returns the current global Localizer instance.

type Translator

type Translator func(string) string

Translator is a function type that translates a given string to another language.

Jump to

Keyboard shortcuts

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