lang

package
v0.1.0-nightly.1552475310 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2019 License: MIT Imports: 26 Imported by: 0

Documentation

Index

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 Locale

func Locale(c *gin.Context) string

func SetLocale

func SetLocale(c *gin.Context, locale string)

func Translate

func Translate(messageID string, data map[string]interface{}, langName string) string

func Translator

func Translator(v *validator.Validate, translator string) (trans ut.Translator, found bool)

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL