Documentation
¶
Index ¶
- Constants
- func FormatValidationError(c *gin.Context, err error) string
- func FromContext(c *gin.Context) *i18n_lib.Localizer
- func GetLocalizer(langs ...string) *i18n_lib.Localizer
- func GetTranslatorFromContext(c *gin.Context) interface{}
- func GetValidatorTranslator(locale string) (ut.Translator, bool)
- func InitValidator() error
- func Initialize(localesPath string, defaultLang language.Tag) error
- func Middleware() gin.HandlerFunc
- func T(localizer *i18n_lib.Localizer, messageID string, templateData interface{}) string
- func Translate(c *gin.Context, messageID string, templateData ...interface{}) string
Constants ¶
View Source
const ( ContextKey = "i18nLocalizer" ValidatorContextKey = "validatorTranslator" LocaleHeader = "Accept-Language" DefaultLanguage = "en" )
Variables ¶
This section is empty.
Functions ¶
func GetLocalizer ¶
func GetValidatorTranslator ¶
func GetValidatorTranslator(locale string) (ut.Translator, bool)
func InitValidator ¶
func InitValidator() error
func Middleware ¶
func Middleware() gin.HandlerFunc
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.