i18n

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Zh alias of Get("zh", ...) function
	Zh = Alias("zh")
	// En alias of Get("en", ...) function
	En = Alias("en")
	// T alias of Get function
	T = Get
	// Tr alias of Get function
	Tr = Get
	// M alias of Get function
	M = Get
	// N alias of Get function
	N = Get
)

Functions

func Add

func Add(name string, kvs map[string]string, fn ...func())

Add add kv translate asset by name

func Get

func Get(name string, key string, value ...string) (res string)

Get get value by name and key, return default value if not empty

func Register

func Register(assets map[string]map[string]string, fn ...func())

Register register translate assets

Types

type AliasFn

type AliasFn func(string, ...string) string

AliasFn alias of kv function

func Alias

func Alias(name string) AliasFn

Alias alias kv function by give name

Jump to

Keyboard shortcuts

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