Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultLangOption = "Default"
DefaultLangOption default language option. If user config the language is default, the language option is admin choose.
Variables ¶
View Source
var GlobalTrans i18n.Translator
View Source
var ( // LanguageOptions language LanguageOptions []*LangOption )
View Source
var ProviderSet = wire.NewSet(NewTranslator)
ProviderSet is providers.
Functions ¶
func CheckLanguageIsValid ¶ added in v0.3.0
CheckLanguageIsValid check user input language is valid
func NewTranslator ¶
func NewTranslator(c *I18n) (tr i18n.Translator, err error)
NewTranslator new a translator
Types ¶
type I18n ¶
type I18n struct {
BundleDir string `json:"bundle_dir" mapstructure:"bundle_dir" yaml:"bundle_dir"`
}
I18n i18n config
type LangOption ¶ added in v0.3.0
type LangOption struct { Label string `json:"label"` Value string `json:"value"` // Translation completion percentage Progress int `json:"progress"` }
LangOption language option
Click to show internal directories.
Click to hide internal directories.