locales

package
v0.0.0-...-f01c647 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AvailableLangs = containers.NewStringSet()
	CurrentLang    = DefaultLang
	DefaultLang    = language.English
)
View Source
var Localizers map[language.Tag]*i18n.Localizer

Functions

func GetDBColumns

func GetDBColumns(values []string) ([]string, error)

func GetLocales

func GetLocales() *locales

func GetTranslator

func GetTranslator() func(id string, args ...interface{}) string

func Init

func Init()

func LoadTranslations

func LoadTranslations() error

func SetLocalizer

func SetLocalizer(lang string)

func TranslateSlice

func TranslateSlice(ids []string, args ...[]interface{}) []string

Types

type Interface

type Interface interface {
	Translate(id string, args ...interface{}) string
	TranslateCount(id string, ct int, args ...interface{}) string
	GetAvailableLocales() []string
}

type Translator

type Translator func(id string, args ...interface{}) string

Jump to

Keyboard shortcuts

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