l10n: github.com/qor/l10n Index | Files | Directories

package l10n

import "github.com/qor/l10n"

Index

Package Files

callbacks.go l10n.go scope.go

Variables

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:20" 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 {
    Locale
}

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) CreatableFromLocale Uses

func (LocaleCreatable) CreatableFromLocale()

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

type LocalizeActionArgument Uses

type LocalizeActionArgument struct {
    From string
    To   []string
}

LocalizeActionArgument localize action's argument

Directories

PathSynopsis
publish

Package l10n imports 11 packages (graph) and is imported by 18 packages. Updated 2018-11-01. Refresh now. Tools for package owners.