Documentation
¶
Index ¶
- Constants
- func FetchCurrentLanguageTag(accept string, supportTags []language.Tag) language.Tag
- func FormatMessage(ctx context.Context, message *i18n2.Message, args map[string]interface{}) string
- func FormatText(ctx context.Context, msgId string, defaultText string) string
- func FormatTextWithData(ctx context.Context, msgId string, defaultText string, ...) string
- func NewBundle(tag language.Tag, configs ...string) *i18n2.Bundle
- func SetDefaultLangHeaderKey(key string)
- type I18nMiddleware
Constants ¶
View Source
const I18nKey = "SpectatorNan/goi18nx"
Variables ¶
This section is empty.
Functions ¶
func FetchCurrentLanguageTag ¶ added in v0.1.2
func FormatMessage ¶
func FormatTextWithData ¶
func SetDefaultLangHeaderKey ¶ added in v0.1.1
func SetDefaultLangHeaderKey(key string)
SetDefaultLangHeaderKey sets the default value of the lang header key. need to be set before use
Types ¶
type I18nMiddleware ¶
type I18nMiddleware struct {
// contains filtered or unexported fields
}
func NewI18nMiddleware ¶
func (*I18nMiddleware) Handle ¶
func (m *I18nMiddleware) Handle(next http.HandlerFunc) http.HandlerFunc
Click to show internal directories.
Click to hide internal directories.