i10n

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

README

i10n

Go i18n/i10n pkg like Java

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddResource

func AddResource(tag language.Tag, key string, value string)

AddResource add resource by tag and key

func AddTagMap added in v0.2.0

func AddTagMap(tag language.Tag, m map[string]string)

func E

func E(key string, tag language.Tag, arg ...interface{}) string

E Expend resource/translated of tag

func GetDefaultTag

func GetDefaultTag() language.Tag

func GetExact

func GetExact(key string, tag language.Tag) string

func Nearest added in v0.2.1

func Nearest(locale string, languages []string) string

Nearest suppose locale is longest, languages should be less

func ParseTag added in v0.2.0

func ParseTag(name string) (tag language.Tag, err error)

func ParseTagWithDefault added in v0.2.0

func ParseTagWithDefault(name string) (tag language.Tag)

func Reset

func Reset()

func SetDefaultLang

func SetDefaultLang(lang string) error

SetDefaultLang set default lang

func SetDefaultTag

func SetDefaultTag(tag language.Tag)

func T

func T(key string, arg ...interface{}) string

T Get default tag resource/translated

func TT

func TT(key string, tag language.Tag) string

TT Get resource/translated according to key and tag

Types

This section is empty.

Jump to

Keyboard shortcuts

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