Primitives / foldkit-primitives/state

Locale

const · packages/primitives/src/state/locale.ts:17

Args{ default: string }
Model{ locale: string }
MessagesSetLocale { locale: string }
Its full type
const Locale: Bundle.Bundle<
  'Locale',
  { readonly default: string },
  { readonly locale: string },
  { readonly _tag: 'SetLocale'; readonly locale: string },
  never,
  never,
  never,
  void,
  {},
  {}
>

Locale as a bundle: the current locale string in the Model. Starts from navigator.language where available, falling back to the configured default; changes arrive as Messages. No subscriptions: language changes take effect on reload.

In the guides