Localization
Localization
Materially supports four types of international languages ('en' - English, 'fr' - French, 'ro' - Romanian, 'zh' - Chinese). You can switch language from the header bar. We internationalize the main menu for all four languages, When you change it from the header, you will see the effect there. If you want to configure one more language or set a default language then continue reading below...
IntlProvider
React Intl uses the provider pattern to scope an i18n context to a tree of components. This allows configurations like the current locale and set of translated strings/messages to be provided at the root of a component tree and made available to the <FormattedMessage> components.
locale, formats, and messages
The user's current locale and what the app should be rendered in. While defaultLocale and defaultFormats are for fallbacks or during development and represent the app's default. Notice how there is no, defaultMessagesthat's because each Message Descriptor provides a defaultMessage
How does it work?
Add node modules react-intl emo
yarn add react-intl / npm install --save react-intlData for locale files exist at src\utils\locales
{
"dashboard": "Dashboard",
"default": "Default",
"widget": "Widget",
"widgets": "Widgets",
"statistic": "Statistic",
...
...
}
Open the file config and set the language.
Open file Locales and apply IntlProvider
Last updated
Was this helpful?