Documentation ¶
Index ¶
Constants ¶
View Source
const EN = "en-US"
View Source
const LangHeader = "Lang"
View Source
const ZH = "zh-CN"
Variables ¶
This section is empty.
Functions ¶
func GetGoroutineBindLang ¶ added in v1.5.0
func GetGoroutineBindLang() string
func GetLocaleNameByRequest ¶
GetLocaleNameByRequest 从request获取语言名称
func SetGoroutineBindLang ¶ added in v1.5.0
func SetGoroutineBindLang(localeName string)
Types ¶
type LocaleResource ¶
type LocaleResource struct {
// contains filtered or unexported fields
}
func (*LocaleResource) ExistKey ¶
func (locale *LocaleResource) ExistKey(key string) bool
func (*LocaleResource) Get ¶
func (locale *LocaleResource) Get(key string, defaults ...string) string
func (*LocaleResource) GetTemplate ¶
func (locale *LocaleResource) GetTemplate(key string) *Template
func (*LocaleResource) Name ¶
func (locale *LocaleResource) Name() string
type LocaleResourceLoader ¶
type LocaleResourceLoader struct {
// contains filtered or unexported fields
}
func NewLoader ¶
func NewLoader() *LocaleResourceLoader
func (*LocaleResourceLoader) DefaultLocale ¶
func (loader *LocaleResourceLoader) DefaultLocale(defaultLocale string)
func (*LocaleResourceLoader) LoadDir ¶
func (loader *LocaleResourceLoader) LoadDir(dir string) error
func (*LocaleResourceLoader) LoadFile ¶
func (loader *LocaleResourceLoader) LoadFile(fileList ...string) error
func (*LocaleResourceLoader) Locale ¶
func (loader *LocaleResourceLoader) Locale(locales ...string) *LocaleResource
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
func NewTemplate ¶
Click to show internal directories.
Click to hide internal directories.