Documentation ¶
Index ¶
- Variables
- func RenderInlineEditAssets(isIncludeJQuery bool, isIncludeExtendAssetLib bool) (template.HTML, error)
- type Backend
- type I18n
- func (i18n *I18n) AddTranslation(translation *Translation) error
- func (i18n *I18n) ConfigureQorResource(res resource.Resourcer)
- func (i18n *I18n) Default(value string) admin.I18n
- func (i18n *I18n) DeleteTranslation(translation *Translation) (err error)
- func (i18n *I18n) Fallbacks(locale ...string) admin.I18n
- func (i18n *I18n) LoadTranslations() map[string]map[string]*Translation
- func (I18n) ResourceName() string
- func (i18n *I18n) SaveTranslation(translation *Translation) error
- func (i18n *I18n) Scope(scope string) admin.I18n
- func (i18n *I18n) SetCacheStore(cacheStore cache.CacheStoreInterface)
- func (i18n *I18n) T(locale, key string, args ...interface{}) template.HTML
- type Translation
Constants ¶
This section is empty.
Variables ¶
var Default = "en-US"
Default default locale for i18n
Functions ¶
func RenderInlineEditAssets ¶
func RenderInlineEditAssets(isIncludeJQuery bool, isIncludeExtendAssetLib bool) (template.HTML, error)
RenderInlineEditAssets render inline edit html, it is using: http://vitalets.github.io/x-editable/index.html You could use Bootstrap or JQuery UI by set isIncludeExtendAssetLib to false and load files by yourself
Types ¶
type Backend ¶
type Backend interface { LoadTranslations() []*Translation SaveTranslation(*Translation) error DeleteTranslation(*Translation) error }
Backend defined methods that needs for translation backend
type I18n ¶
type I18n struct { Resource *admin.Resource Backends []Backend FallbackLocales map[string][]string // contains filtered or unexported fields }
I18n struct that hold all translations
func (*I18n) AddTranslation ¶
func (i18n *I18n) AddTranslation(translation *Translation) error
AddTranslation add translation
func (*I18n) ConfigureQorResource ¶
ConfigureQorResource configure qor resource for qor admin
func (*I18n) DeleteTranslation ¶
func (i18n *I18n) DeleteTranslation(translation *Translation) (err error)
DeleteTranslation delete translation
func (*I18n) Fallbacks ¶
Fallbacks fallback to locale if translation doesn't exist in specified locale
func (*I18n) LoadTranslations ¶
func (i18n *I18n) LoadTranslations() map[string]map[string]*Translation
LoadTranslations load translations as map `map[locale]map[key]*Translation`
func (I18n) ResourceName ¶
ResourceName change display name in qor admin
func (*I18n) SaveTranslation ¶
func (i18n *I18n) SaveTranslation(translation *Translation) error
SaveTranslation save translation
func (*I18n) SetCacheStore ¶
func (i18n *I18n) SetCacheStore(cacheStore cache.CacheStoreInterface)
SetCacheStore set i18n's cache store
Directories ¶
Path | Synopsis |
---|---|
backends
|
|
database
* @Author: xiaoxu@mgtv.com * @Jira: * @Wiki: * @Date: 2020-03-01 10:23:08 * @LastEditors: xiaoxu@mgtv.com * @LastEditTime: 2020-03-01 17:12:44 * @Description: * @FilePath: \qor\i18n\backends\database\database.go
|
* @Author: xiaoxu@mgtv.com * @Jira: * @Wiki: * @Date: 2020-03-01 10:23:08 * @LastEditors: xiaoxu@mgtv.com * @LastEditTime: 2020-03-01 17:12:44 * @Description: * @FilePath: \qor\i18n\backends\database\database.go |