Documentation ¶
Index ¶
- Variables
- func GetAvailableLocales(req *http.Request, currentUser qor.CurrentUser) []string
- func GetEditableLocales(req *http.Request, currentUser qor.CurrentUser) []string
- type AvailableLocalesInterface
- type Backend
- type EditableLocalesInterface
- type I18n
- func (i18n *I18n) AddTransaltion(translation *Translation)
- func (i18n *I18n) DeleteTransaltion(translation *Translation)
- func (i18n *I18n) InjectQorAdmin(res *admin.Resource)
- func (i18n *I18n) SaveTransaltion(translation *Translation)
- func (i18n *I18n) Scope(scope string) admin.I18n
- func (i18n *I18n) T(locale, key string, args ...interface{}) string
- type I18nController
- type Translation
- type ViewableLocalesInterface
Constants ¶
This section is empty.
Variables ¶
View Source
var Default = "en-US"
Functions ¶
func GetAvailableLocales ¶
func GetAvailableLocales(req *http.Request, currentUser qor.CurrentUser) []string
func GetEditableLocales ¶
func GetEditableLocales(req *http.Request, currentUser qor.CurrentUser) []string
Types ¶
type AvailableLocalesInterface ¶
type AvailableLocalesInterface interface {
AvailableLocales() []string
}
type Backend ¶
type Backend interface { LoadTranslations() []*Translation SaveTranslation(*Translation) DeleteTranslation(*Translation) }
type EditableLocalesInterface ¶
type EditableLocalesInterface interface {
EditableLocales() []string
}
type I18n ¶
type I18n struct { Backends []Backend Translations map[string]map[string]*Translation // contains filtered or unexported fields }
func (*I18n) AddTransaltion ¶
func (i18n *I18n) AddTransaltion(translation *Translation)
func (*I18n) DeleteTransaltion ¶
func (i18n *I18n) DeleteTransaltion(translation *Translation)
func (*I18n) InjectQorAdmin ¶
func (*I18n) SaveTransaltion ¶
func (i18n *I18n) SaveTransaltion(translation *Translation)
type I18nController ¶
type I18nController struct {
*I18n
}
func (*I18nController) Index ¶
func (controller *I18nController) Index(context *admin.Context)
func (*I18nController) Update ¶
func (controller *I18nController) Update(context *admin.Context)
type Translation ¶
type ViewableLocalesInterface ¶
type ViewableLocalesInterface interface {
ViewableLocales() []string
}
Click to show internal directories.
Click to hide internal directories.