l10n.go 397 B

12345678910111213141516
  1. package l10n
  2. // Locale embed this struct into GROM-backend models to enable localization feature for your model
  3. type Locale struct {
  4. LocaleCode string `sql:"size:20" gorm:"primary_key;default:''"`
  5. }
  6. // GetLocale get model's locale
  7. func (l *Locale) GetLocale() string {
  8. return l.LocaleCode
  9. }
  10. // SetLocale set model's locale
  11. func (l *Locale) SetLocale(locale string) {
  12. l.LocaleCode = locale
  13. }