Added support for zh-CN locale.

This commit is contained in:
Mike Cao 2020-09-07 15:25:09 -07:00
parent e8538f6e23
commit 987fdfd57d
9 changed files with 168 additions and 124 deletions

View file

@ -18,6 +18,8 @@ const Intl = ({ children }) => {
const dispatch = useDispatch();
const locale = useSelector(state => state.app.locale);
const Wrapper = ({ children }) => <span className={locale}>{children}</span>;
useEffect(() => {
const saved = localStorage.getItem('locale');
if (saved) {
@ -26,7 +28,7 @@ const Intl = ({ children }) => {
});
return (
<IntlProvider locale={locale} messages={messages[locale]}>
<IntlProvider locale={locale} messages={messages[locale]} textComponent={Wrapper}>
{children}
</IntlProvider>
);