Localization

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 l10n.Locale.
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

Use l10n_view.Configure() func to configure l10n view.
The Switch Locale ui will appear below the Brand.
The Localize ui will appear in the RowMenuItem under the Edit and the Delete.
Localize button is used to copy a piece of data from the current locale to the other locales.

Full Example