type
LocaleAvailability
type LocaleAvailability func(
LocaleAvailabilityContext,
) ([]schema.LocaleCode, error)Dynamically limit content locales shown to one author.
This callback runs for an admin request and controls only which already-configured locales the author can select. It is presentation, not authorization: API clients may still request any configured locale, and ordinary access rules remain authoritative.
Return a non-empty list of unique configured codes in display order. Unknown or duplicate codes and an empty result fail the request with locale_availability_failed. Fallbacks outside the returned set are removed, and if the configured default is absent, the first returned locale becomes the request schema default.
Example
AvailableLocales: func(
input core.LocaleAvailabilityContext,
) ([]schema.LocaleCode, error) {
if input.Actor == nil {
return []schema.LocaleCode{"en"}, nil
}
return []schema.LocaleCode{"en", "fr"}, nil
}Related types
LocaleAvailabilityContextRequest input for dynamic admin locale visibility.
LocaleCodeA validated locale identity used by operations, manifests, and storage.