Пример #1
0
// translate the str, into a given lang. Only two languages are supported english( en )
// and swahili( sw )
func translate(lang, str string, a ...interface{}) string {
	l := i18n.CloneLang()
	switch lang {
	case "sw":
		l.SetTarget("sw")
		return l.T(str, a...)
	case "en":
		l.SetTarget("en")
		return l.T(str, a...)
	}
	l.SetTarget("en")
	return l.T(str, a...)
}
Пример #2
0
//NewValid creates a new Valid instance
func NewValid(lang string) *Valid {
	l := i18n.CloneLang()
	l.SetTarget(lang)
	return &Valid{l}
}
Пример #3
0
// New returns a new Form with laguage Target set to lang
func New(lang string) *Form {
	l := i18n.CloneLang()
	l.SetTarget(lang)
	return &Form{l}
}