Documentation ¶
Index ¶
- Variables
- func Add(key string, lang map[string]string)
- func AppendTo(lang string, set map[string]string)
- func FixedLanguageKey(key string) string
- func Get(value string) string
- func GetFromHtml(value template.HTML, scopes ...string) template.HTML
- func GetWithLang(value, lang string) string
- func GetWithScope(value string, scopes ...string) string
- func GetWithScopeAndLanguageSet(value, lang string, scopes ...string) string
- func JoinScopes(scopes []string) string
- func WithScopes(value string, scopes ...string) string
- type LangMap
- type LangSet
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() PTBR = language.BrazilianPortuguese.String() )
View Source
var Lang = LangMap{ language.Chinese.String(): cn, language.English.String(): en, language.Japanese.String(): jp, language.TraditionalChinese.String(): tc, language.BrazilianPortuguese.String(): ptbr, "cn": cn, "en": en, "jp": jp, "tc": tc, "pt-br": ptbr, }
Lang is the global LangMap.
Functions ¶
func FixedLanguageKey ¶ added in v1.2.8
func GetFromHtml ¶
GetFromHtml return the value of given scopes and template.HTML value.
func GetWithLang ¶ added in v1.2.18
GetWithLang return the value of given language set.
func GetWithScope ¶ added in v1.0.0
GetWithScope return the value of given scopes.
func GetWithScopeAndLanguageSet ¶ added in v1.2.18
GetWithScopeAndLanguageSet return the value of given scopes and language set.
func JoinScopes ¶ added in v1.1.6
func WithScopes ¶ added in v1.0.0
WithScopes join scopes prefix and the value.
Types ¶
Click to show internal directories.
Click to hide internal directories.