type

LocalizationConfig

type LocalizationConfig struct { Locales []Locale DefaultLocale schema.LocaleCode DisableFallback bool // AvailableLocales may reduce the locale list exposed to an admin request. // It does not weaken API validation or authorization and is never serialized. AvailableLocales LocaleAvailability }

Application content-locale configuration.

Source core/config.go:62

Locales[]Locale
Ordered configured content locales.
DefaultLocaleschema.LocaleCode
Locale selected when a request does not specify one.
DisableFallbackbool
Requires exact locale values instead of following fallback chains.
AvailableLocalesLocaleAvailability
Optionally reduces locales visible to one admin request without weakening API validation or authorization.

Leave Locales empty to disable content localization. When localization is enabled, DefaultLocale must name one configured locale and every fallback must also be configured.

FallbackLocales are checked in order after the requested locale unless DisableFallback is true. AvailableLocales only narrows the locale picker for the current admin request; it cannot add locales, change API validation, or grant access, and executable callbacks are never serialized into the schema manifest.

Example

go
LocalizationConfig{
  Locales: []Locale{
    {Code: "en", Label: "English"},
    {
      Code:            "fr",
      Label:           "Français",
      FallbackLocales: []schema.LocaleCode{"en"},
    },
  },
  DefaultLocale: "en",
}