How to use Ant Design LocaleProvider with React-Boilerplate ?
We have started using React-Boilerplate . Also we are trying to integrate Ant Design for it's awesome components .
From the docs of Ant Design I have created a wrapper around AppWrapper of React-boilerplate like this -
import { LocaleProvider } from 'antd';
import enUS from 'antd/lib/locale-provider/en_US';
return (
<LocaleProvider locale={enUS}>
<AppWrapper>
...
</AppWrapper>
</LocaleProvider>
);
And it's working perfect for antd components.
I wanted to know how can I use this with i18n of react-boilerplate . Or if this above way is a correct way of doing this ?
In the case of React-Boilerplate the locale is stored in Redux. For antd to be able to update locale when the app does,
So app.js needs to become something like:
<Provider store={store}>
<LanguageProvider messages={messages}>
<LocaleProvider locale={...}>
<Router ... />
</LocaleProvider>
</LanguageProvider>
</Provider>,
Unfortunately this is not enough, since antd's LocaleProvider does not take a simple locale id string as its argument, but rather an object with the locale info itself.
This means that it is not possible to just insert
Closing due to inactivity
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.