Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ENUS for English in USA style ENUS lang = "en_US.UTF-8" // ZHCN for Chinese in China style ZHCN lang = "zh_CN.UTF-8" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Localer ¶
type Localer struct {
// contains filtered or unexported fields
}
Localer include of system languange and message set In linux the value of lang depend on systemctl env 'LANG'
func (*Localer) GetLang ¶
GetLang get language of system return a string like locale ex.en_US.utf8 zh_CN.utf8
func (*Localer) GetMsg ¶
GetMsg return message in system lang kind return english kind of message if system language isn.t exist in msgSets If messages ket isn't exist it will return ""
func (*Localer) GetMsgWithError ¶
GetMsgWithError return a message in system language kind If message sets isn't exist it will return message in English format return error if msgKey isn't exist in msgSet
Click to show internal directories.
Click to hide internal directories.