chore: add i18n
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Divider, Menu, Tooltip } from 'antd';
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
interface SiderMenuProps {
|
||||
collapsed: boolean;
|
||||
@@ -12,6 +13,7 @@ export default function SiderMenu({
|
||||
selectedKey,
|
||||
hangleMenuClick,
|
||||
}: SiderMenuProps) {
|
||||
const { t } = useTranslation();
|
||||
const collapseStyle = collapsed
|
||||
? { fontSize: '12px' }
|
||||
: { fontSize: '12px', paddingLeft: '52px' };
|
||||
@@ -37,7 +39,9 @@ export default function SiderMenu({
|
||||
icon: (
|
||||
<img src="./icons/sider/process-diagram.svg" alt="process diagram" />
|
||||
),
|
||||
label: <Tooltip title="Схемы процессов">Схемы процессов</Tooltip>,
|
||||
label: (
|
||||
<Tooltip title={t('processDiagrams')}>{t('processDiagrams')}</Tooltip>
|
||||
),
|
||||
},
|
||||
{
|
||||
key: '/running-processes',
|
||||
@@ -47,7 +51,9 @@ export default function SiderMenu({
|
||||
alt="running processes"
|
||||
/>
|
||||
),
|
||||
label: <Tooltip title="Запущенные процессы">Запущенные процессы</Tooltip>,
|
||||
label: (
|
||||
<Tooltip title={t('runningProcesses')}>{t('runningProcesses')}</Tooltip>
|
||||
),
|
||||
},
|
||||
!collapsed
|
||||
? {
|
||||
@@ -65,33 +71,33 @@ export default function SiderMenu({
|
||||
{
|
||||
key: 'sub1',
|
||||
icon: <img src="./icons/sider/settings.svg" alt="settings" />,
|
||||
label: 'Настройки',
|
||||
label: t('settings'),
|
||||
className: 'no-expand-icon',
|
||||
children: [
|
||||
{
|
||||
key: '/accounts',
|
||||
label: !collapsed ? (
|
||||
<Tooltip title="Учетные записи">Учетные записи</Tooltip>
|
||||
<Tooltip title={t('accounts')}>{t('accounts')}</Tooltip>
|
||||
) : (
|
||||
'Учетные записи'
|
||||
t('accounts')
|
||||
),
|
||||
style: collapseStyle,
|
||||
},
|
||||
{
|
||||
key: '/events-list',
|
||||
label: !collapsed ? (
|
||||
<Tooltip title="Справочник событий">Справочник событий</Tooltip>
|
||||
<Tooltip title={t('eventsList')}>{t('eventsList')}</Tooltip>
|
||||
) : (
|
||||
'Справочник событий'
|
||||
t('eventsList')
|
||||
),
|
||||
style: collapseStyle,
|
||||
},
|
||||
{
|
||||
key: '/configuration',
|
||||
label: !collapsed ? (
|
||||
<Tooltip title="Конфигурация">Конфигурация</Tooltip>
|
||||
<Tooltip title={t('configuration')}>{t('configuration')}</Tooltip>
|
||||
) : (
|
||||
'Конфигурация'
|
||||
t('configuration')
|
||||
),
|
||||
style: collapseStyle,
|
||||
},
|
||||
|
Reference in New Issue
Block a user