Documentation ¶
Overview ¶
message_source 用来处理国际化资源
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReFormatToPlain ¶
func ReFormatToPlain(path string)
解析gotext extract产生的json文件,包装成自己项目中的json格式 ERR开头的错误文件放前面
Types ¶
type GlobalizationMessage ¶
type GlobalizationMessage struct { Code string `json:"code"` En string `json:"en_US"` Cn string `json:"zh_CN"` }
自己定义的国际化资源
type MessageSource ¶
type MessageSource struct {
// contains filtered or unexported fields
}
func NewMessageSource ¶
func NewMessageSource() *MessageSource
func (*MessageSource) GetLocalized ¶
func (ms *MessageSource) GetLocalized(code string, lang language.Tag, a ...interface{}) string
func (*MessageSource) Load ¶
func (ms *MessageSource) Load(paths ...string)
Click to show internal directories.
Click to hide internal directories.