Documentation ¶
Index ¶
- Variables
- func AddLocale(validationTranslator ValidationTranslator) error
- func Locale(c *gin.Context) string
- func SetLocale(c *gin.Context, locale string)
- func Translate(messageID string, data map[string]interface{}, langName string) string
- func Translator(v *validator.Validate, translator string) (trans ut.Translator, found bool)
- type RegisterDefaultTranslations
- type UnmarshalFunc
- type ValidationTranslator
Constants ¶
This section is empty.
Variables ¶
View Source
var LocalizerMap map[string]*i18n.Localizer
View Source
var UniversalTranslator *ut.UniversalTranslator
Functions ¶
func AddLocale ¶
func AddLocale(validationTranslator ValidationTranslator) error
func Translator ¶
Types ¶
type RegisterDefaultTranslations ¶
type RegisterDefaultTranslations func(v *validator.Validate, trans ut.Translator) (err error)
type UnmarshalFunc ¶
type UnmarshalFunc = i18n.UnmarshalFunc
type ValidationTranslator ¶
type ValidationTranslator interface { RegisterDefaultTranslations(v *validator.Validate, trans ut.Translator) (err error) Locale() string LocalesTranslator() locales.Translator }
Click to show internal directories.
Click to hide internal directories.