Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMessage ¶
GetMessage get the i18n message with error handling param is one of these type: messageID, *i18n.LocalizeConfig Example: GetMessage(context, "hello") // messageID is hello
GetMessage(context, &i18n.LocalizeConfig{
MessageID: "welcomeWithName",
TemplateData: map[string]string{
"name": context.Param("name"),
},
})
func MustGetMessage ¶
MustGetMessage get the i18n message without error handling param is one of these type: messageID, *i18n.LocalizeConfig Example: MustGetMessage(context, "hello") // messageID is hello
MustGetMessage(context, &i18n.LocalizeConfig{
MessageID: "welcomeWithName",
TemplateData: map[string]string{
"name": context.Param("name"),
},
})
Types ¶
type BundleCfg ¶
type BundleCfg struct {
DefaultLanguage language.Tag
FormatBundleFile string
AcceptLanguage []language.Tag
RootPath string
UnmarshalFunc i18n.UnmarshalFunc
Loader Loader
}
BundleCfg ...
type EmbedLoader ¶
func (*EmbedLoader) LoadMessage ¶
func (c *EmbedLoader) LoadMessage(path string) ([]byte, error)
type GetLngHandler ¶
GetLngHandler ...
Source Files
¶
- constant.go
- embed.go
- ginContext.go
- ginI18n.go
- i18n.go
- interface.go
- option.go
- type.go
Click to show internal directories.
Click to hide internal directories.