language

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2019 License: Apache-2.0 Imports: 4 Imported by: 322

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EN = language.English.String()
	CN = language.Chinese.String()
	JP = language.Japanese.String()
	TC = language.TraditionalChinese.String()
)
View Source
var Lang = LangMap{
	language.Chinese.String():            cn,
	language.English.String():            en,
	language.Japanese.String():           jp,
	language.TraditionalChinese.String(): tc,

	"cn": cn,
	"en": en,
	"jp": jp,
	"tc": tc,
}

Functions

func Add

func Add(key string, lang map[string]string)

func Get

func Get(value string) string

func GetFromHtml

func GetFromHtml(value template.HTML, scopes ...string) template.HTML

func GetWithScope added in v1.0.0

func GetWithScope(value string, scopes ...string) string

func WithScopes added in v1.0.0

func WithScopes(value string, scopes ...string) string

Types

type LangMap

type LangMap map[string]map[string]string

func (LangMap) Get

func (lang LangMap) Get(value string) string

func (LangMap) GetWithScope added in v1.0.0

func (lang LangMap) GetWithScope(value string, scopes ...string) string

Jump to

Keyboard shortcuts

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