L10n gives your models the ability to localize for different Locales.
It can be a catalyst for the adaptation of a product, application, or document content to meet the language, cultural, and other requirements of a specific target market.
Define a struct
Define a struct that requires embed
Also this struct must implement
PrimarySlug() string and
PrimaryColumnValuesBySlug(slug string) map[string]string.
Init a l10n builder
Register locales here.
You can use
GetSupportLocaleCodesFromRequestFunc to determine who can use which locales.
Configure the model builder
l10n_view.Configure() func to configure l10n view.
Switch Locale ui will appear below the
Localize ui will appear in the
RowMenuItem under the
Edit and the
Localize button is used to copy a piece of data from the current locale to the other locales.