Documentation ¶
Index ¶
Constants ¶
View Source
const EN = "en-US"
View Source
const ZH = "zh-CN"
Variables ¶
This section is empty.
Functions ¶
func GetLocaleNameByRequest ¶
GetLocaleNameByRequest 从request获取语言名称
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.