-
-
Notifications
You must be signed in to change notification settings - Fork 344
Closed
Labels
Description
Is your feature request related to a problem? Please describe.
Currently, useLocale returns a string. This is mostly fine, but APIs that ask for strictly typed locales (e.g. locale of getPathname currently) make this not easy to assign.
The reason for this is that the locales are passed to a navigation factory function, but not useLocale (which is imported from next-intl).
Describe the solution you'd like
Either all APIs should use a strictly typed locale or none—a mixture requires workarounds.
Similar to strictly typed messages and formats, we could allow the user to provide the list of locales globally. This would work for both global APIs like useLocale as well as the navigation APIs. At this point we could consider registering all global shapes under a single type namespace.
nhducit and stefanprobst