Documentation ¶
Index ¶
Constants ¶
View Source
const UnknownTheKeyStrf = "the key is '%v', unknown meaning"
UnknownTheCodeStrf const define unknow code
View Source
const UnknownTheLanguageStrf = "the language code is '%s', unknown meaning"
UnknownTheLanguageStrf define unknow language
Variables ¶
View Source
var EmptyLanguageSetting = map[string]LanguageMap{}
EmptyLanguageSetting empty language setting
Functions ¶
func LoadLanguageResourceFromDir ¶
func LoadLanguageResourceFromDir(dir string) (map[string]LanguageMap, error)
LoadLanguageResourceFromDir load language resource from file
Types ¶
type CCLanguageIf ¶
type CCLanguageIf interface { // CreateDefaultCCLanguageIf create new language error interface instance CreateDefaultCCLanguageIf(language string) DefaultCCLanguageIf // Language returns an content with key Language(language, key string) string // Languagef returns an content with key Languagef(language, key string, args ...interface{}) string Load(res map[string]LanguageMap) }
CCLanguageIf defines error information conversion
func New ¶
func New(dir string) (CCLanguageIf, error)
New create new Language instance, dir is directory of language description resource
func NewFromCtx ¶
func NewFromCtx(lang map[string]LanguageMap) CCLanguageIf
NewFromCtx get lange helper
Click to show internal directories.
Click to hide internal directories.