feat: add en language
This commit is contained in:
24
client/src/config/AppWrapper.tsx
Normal file
24
client/src/config/AppWrapper.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import './i18n';
|
||||
import { ConfigProvider } from 'antd';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { theme } from './customTheme';
|
||||
|
||||
import en from 'antd/locale/en_US';
|
||||
import ru from 'antd/locale/ru_RU';
|
||||
|
||||
const antdLocales = {
|
||||
en: en,
|
||||
ru: ru,
|
||||
};
|
||||
|
||||
export default function AppWrapper({ children }: any) {
|
||||
const { i18n } = useTranslation();
|
||||
const currentLang = i18n.language.split('-')[0] as 'en' | 'ru';
|
||||
|
||||
return (
|
||||
<ConfigProvider locale={antdLocales[currentLang]} theme={theme}>
|
||||
{children}
|
||||
</ConfigProvider>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user