I18nProvider
Provides the locale for the application to all child components.
install | yarn add react-aria |
---|---|
version | 3.19.0 |
usage | import {I18nProvider} from 'react-aria' |
Introduction#
I18nProvider
allows you to override the default locale as determined by the browser/system setting
with a locale defined by your application (e.g. application setting). This should be done by wrapping
your entire application in the provider, which will be cause all child elements to receive the new locale
information via useLocale.
Props#
Name | Type | Default | Description |
children | ReactNode | — | Contents that should have the locale applied. |
locale | string | — | The locale to apply to the children. |
Example#
import {I18nProvider} from 'react-aria';
<I18nProvider locale="fr-FR">
<YourApp />
</I18nProvider>
import {I18nProvider} from 'react-aria';
<I18nProvider locale="fr-FR">
<YourApp />
</I18nProvider>
import {I18nProvider} from 'react-aria';
<I18nProvider locale="fr-FR">
<YourApp />
</I18nProvider>