Documentation
¶
Overview ¶
Package message 本地化信息的定义
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶ added in v0.28.0
type File struct {
XMLName struct{} `xml:"language" json:"-" yaml:"-" toml:"-"`
Languages []language.Tag `xml:"languages>language" json:"languages" yaml:"languages" toml:"languages"` // 如果用字符串,还需要处理大小写以及不同值表示同一个 language.Tag 对象的问题
Messages []Message `xml:"message" json:"messages" yaml:"messages" toml:"messages"`
}
File 单个本地化语言组成的文件
func (*File) Catalog ¶ added in v0.28.0
Catalog 将本地化信息附加在 catalog.Catalog 上
type LogFunc ¶ added in v0.22.0
type LogFunc = func(localeutil.Stringer)
type Message ¶ added in v0.15.0
type Message struct {
Key string `xml:"key" json:"key" yaml:"key" toml:"key"`
Message Text `xml:"message" json:"message" yaml:"message" toml:"message"`
}
Message 单条本地化内容
type Select ¶ added in v0.15.0
type Select struct {
Arg int `xml:"arg,attr" json:"arg" yaml:"arg" toml:"arg"`
Format string `xml:"format,attr,omitempty" json:"format,omitempty" yaml:"format,omitempty" toml:"format,omitempty"`
Cases []*Case `xml:"case,omitempty" json:"cases,omitempty" yaml:"cases,omitempty" toml:"cases,omitempty"`
}
type Text ¶ added in v0.15.0
type Text struct {
Msg string `xml:"msg,omitempty" json:"msg,omitempty" yaml:"msg,omitempty" toml:"msg,omitempty"`
Select *Select `xml:"select,omitempty" json:"select,omitempty" yaml:"select,omitempty" toml:"select,omitempty"`
Vars []*Var `xml:"var,omitempty" json:"vars,omitempty" yaml:"vars,omitempty" toml:"vars,omitempty"`
}
type Var ¶ added in v0.15.0
type Var struct {
Name string `xml:"name,attr" json:"name" yaml:"name" toml:"name"`
Arg int `xml:"arg,attr" json:"arg" yaml:"arg" toml:"arg"`
Format string `xml:"format,attr,omitempty" json:"format,omitempty" yaml:"format,omitempty" toml:"format,omitempty"`
Cases []*Case `xml:"case,omitempty" json:"cases,omitempty" yaml:"cases,omitempty" toml:"cases,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.