Install using bunx shadcn@latest add @remix-utils/locales-react.
Note
This depends on react.
This hook lets you get the locales returned by the root loader. It follows a simple convention, your root loader return value should be an object with the key locales.
You can combine it with getClientLocal to get the locales on the root loader and return that. The return value of useLocales is a Locales type which is string | string[] | undefined.
Install using
bunx shadcn@latest add @remix-utils/locales-react.This depends on
react.This hook lets you get the locales returned by the root loader. It follows a simple convention, your root loader return value should be an object with the key
locales.You can combine it with
getClientLocalto get the locales on the root loader and return that. The return value ofuseLocalesis aLocalestype which isstring | string[] | undefined.The return type of
useLocalesis ready to be used with the Intl API.Author
Sergio XalambrÃ