i18n

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = Configuration{}

Functions

func GetLangByIndex

func GetLangByIndex(index int) string

Get language by index id

func IndexLang

func IndexLang(lang string) int

Check language name if exist

func IsExist

func IsExist(lang string) bool

Check language name if exist

func ListLangs

func ListLangs() []string

List all locale languages

func Tr

func Tr(lang, key string, args ...interface{}) string

Tr translate content to target language.

Types

type Configuration

type Configuration struct {
	RootPath string
	// contains filtered or unexported fields
}

func (*Configuration) Close

func (this *Configuration) Close() error

func (*Configuration) Init

func (this *Configuration) Init() error

func (*Configuration) Name

func (this *Configuration) Name() string

type Locale

type Locale struct {
	Lang string
}

A Locale describles the information of localization.

func (Locale) Index

func (l Locale) Index() int

Index get lang index of LangStore

func (Locale) Tr

func (l Locale) Tr(key string, args ...interface{}) string

Tr translate content to target language.

Jump to

Keyboard shortcuts

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