Interface.UsePreferredLocaleSyncOptions
Options for the usePreferredLocaleSync hook.
Generic over the locale type T (defaults to string): pass the app's own Locale union
(e.g. via supportedLocales: Object.values(Locale)) so onLocaleChange receives a precisely
typed value and no as Locale cast is needed.
Type Parameters
| Type Parameter | Default type |
|---|
T extends string | string |
Properties
| Property | Type | Description |
|---|
currentLocale? | string | (Optional) The locale currently active in the app. When provided and equal to the user's preference, onLocaleChange is skipped to avoid redundant re-application (and redundant localStorage writes) of an already-active locale. |
onLocaleChange | (locale: T) => void | Callback invoked when user's preferred locale should be applied |
supportedLocales | T[] | Array of locale codes supported by the consuming app |