Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultLang language.Tag = language.English
View Source
var FuncMap = template.FuncMap{ "quote": func(v any) string { return strconv.Quote(fmt.Sprint(v)) }, }
FuncMap contains the custom template functions used for rendering i18n templates.
Functions ¶
This section is empty.
Types ¶
type Bundle ¶
type Bundle struct {
// contains filtered or unexported fields
}
func (Bundle) RenderEcode ¶
func (b Bundle) RenderEcode(ecode string, data any) (*EcodeDetail, error)
type EcodeDetail ¶
type EcodeDetail struct {
Desc string `yaml:"desc"`
Text string `yaml:"text"`
Help string `yaml:"help"`
Fields []EcodeField `yaml:"fields"`
}
type EcodeField ¶ added in v0.15.0
EcodeField maps field name -> field type
func (EcodeField) ImportPath ¶ added in v0.15.0
func (f EcodeField) ImportPath() string
ImportPath returns the import path.
func (EcodeField) Name ¶ added in v0.15.0
func (f EcodeField) Name() string
Name returns the field name.
func (EcodeField) Type ¶ added in v0.15.0
func (f EcodeField) Type() string
Type returns the field type.
func (EcodeField) Validate ¶ added in v0.15.0
func (f EcodeField) Validate() bool
type I18N ¶ added in v0.15.0
type I18N struct {
// contains filtered or unexported fields
}
var Default *I18N
func (*I18N) GetDefault ¶ added in v0.15.0
func (*I18N) RenderEcode ¶ added in v0.15.0
Click to show internal directories.
Click to hide internal directories.