Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMessage ¶
GetMessage get the i18n message
param is one of these type: messageID, *i18n.LocalizeConfig Example: GetMessage("hello") // messageID is hello GetMessage(&i18n.LocalizeConfig{ MessageID: "welcomeWithName", TemplateData: map[string]string{ "name": context.Param("name"), }, })
func Localize ¶
func Localize(opts ...Option) app.HandlerFunc
func MustGetMessage ¶
MustGetMessage get the i18n message without error handling
param is one of these type: messageID, *i18n.LocalizeConfig Example: MustGetMessage("hello") // messageID is hello MustGetMessage(&i18n.LocalizeConfig{ MessageID: "welcomeWithName", TemplateData: map[string]string{ "name": context.Param("name"), }, })
Types ¶
type EmbedLoader ¶
func (*EmbedLoader) LoadMessage ¶
func (e *EmbedLoader) LoadMessage(path string) ([]byte, error)
type GetLangHandler ¶
type LoaderFunc ¶
func (LoaderFunc) LoadMessage ¶
func (f LoaderFunc) LoadMessage(path string) ([]byte, error)
type Option ¶
type Option func(impl *hertzI18nImpl)
func WithGetLangHandle ¶
func WithGetLangHandle(handler GetLangHandler) Option
Click to show internal directories.
Click to hide internal directories.