adsa-cms: Index | Files | Directories

package l10n

import ""


Package Files

callbacks.go l10n.go scope.go


var Global = "en-US"

Global global language

func IsLocalizable Uses

func IsLocalizable(scope *gorm.Scope) (IsLocalizable bool)

IsLocalizable return model is localizable or not

func RegisterCallbacks Uses

func RegisterCallbacks(db *gorm.DB)

RegisterCallbacks register callback into GORM DB

type Locale Uses

type Locale struct {
    LanguageCode string `sql:"size:6" gorm:"primary_key"`

Locale embed this struct into GROM-backend models to enable localization feature for your model

func (*Locale) ConfigureQorResource Uses

func (l *Locale) ConfigureQorResource(res resource.Resourcer)

ConfigureQorResource configure qor locale for Qor Admin

func (Locale) IsGlobal Uses

func (l Locale) IsGlobal() bool

IsGlobal return if current locale is global

func (*Locale) SetLocale Uses

func (l *Locale) SetLocale(locale string)

SetLocale set model's locale

type LocaleCreatable Uses

type LocaleCreatable struct {

LocaleCreatable if you embed it into your model, it will make the resource be creatable from locales, by default, you can only create it from global

func (LocaleCreatable) LocaleCreatable Uses

func (LocaleCreatable) LocaleCreatable()

LocaleCreatable a method to allow your mod=el be creatable from locales



Package l10n imports 9 packages (graph) and is imported by 4 packages. Updated 2017-06-08. Refresh now. Tools for package owners.