lang

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

README

Lang

such as The {0} field is required {1}

Optimization principle referred to in the OpenResty string concatenation using Lua table

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dir added in v1.1.7

func Dir(dir string) error

Dir translator dir

func File added in v1.1.7

func File(file string) error

File translator file

func Register

func Register(lang string, ts map[string]string) error

Register a translator provide by the trans name

func RegisterKey

func RegisterKey(lang string, key, tran string)

RegisterKey a translator provide by the key tran name

func RegisterKeys

func RegisterKeys(lang string, ks map[string]string)

RegisterKeys a translator provide by the key trans name

func Trans

func Trans(lang, key string, param ...string) string

Trans translator

func TransFile added in v1.1.7

func TransFile(f string) error

TransFile translator dir or file

func Transk added in v1.1.7

func Transk(lang, key string) string

Transk translator of key

Types

This section is empty.

Jump to

Keyboard shortcuts

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