mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Added support for zh-CN locale.
This commit is contained in:
parent
e8538f6e23
commit
987fdfd57d
9 changed files with 168 additions and 124 deletions
|
|
@ -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>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue