I18nProvider
Provides the locale for the application to all child components.
install | yarn add @react-aria/i18n |
---|---|
version | 3.3.8 |
usage | import {I18nProvider} from '@react-aria/i18n' |
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/i18n';
<I18nProvider locale="fr-FR">
<YourApp />
</I18nProvider>
import {I18nProvider} from '@react-aria/i18n';
<I18nProvider locale="fr-FR">
<YourApp />
</I18nProvider>
import {I18nProvider} from '@react-aria/i18n';
<I18nProvider locale="fr-FR">
<YourApp />
</I18nProvider>