Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Global = "en-US"
Global global language
Functions ¶
func IsLocalizable ¶
IsLocalizable return model is localizable or not
func RegisterCallbacks ¶
RegisterCallbacks register callback into GORM DB
Types ¶
type Locale ¶
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
type LocaleCodes ¶
type LocaleCodes struct {
LanguageAvailableCode pq.StringArray `gorm:"type:varchar(64)[]" json:"LanguageAvailableCode" l10n:"sync"`
}
type LocaleCreatable ¶
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 ¶
func (LocaleCreatable) CreatableFromLocale()
CreatableFromLocale a method to allow your mod=el be creatable from locales
type LocalizeActionArgument ¶
LocalizeActionArgument localize action's argument