feat: internationalize sidebar collapse and expand labels using translation keys
This commit is contained in:
@@ -2,7 +2,7 @@ import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { Link, useLocation } from 'react-router-dom';
|
||||
import { Box, NavLink, Stack, Tooltip, ActionIcon, Divider, Menu, TextInput } from '@repo/ui/components';
|
||||
import { useCoreAppShell } from '@repo/ui/components';
|
||||
import { ChevronsLeft, ChevronsRight, PanelTopClose, PanelTopOpen, Search, X } from 'lucide-react';
|
||||
import { ChevronsLeft, ChevronsRight, PanelTopClose, PanelTopOpen, Search, X } from 'lucide-react';
|
||||
import type { MenuItemType } from '../types/menu.types';
|
||||
import type { SidebarVariant } from '@repo/ui/components';
|
||||
import { useTranslation } from '@repo/core-i18n';
|
||||
@@ -387,7 +387,7 @@ export const SidebarMenu = memo(function SidebarMenu({
|
||||
<>
|
||||
<Divider />
|
||||
<Stack align="center" p="xs">
|
||||
<Tooltip label="Expand sidebar" position="right" withArrow>
|
||||
<Tooltip label={t('common:expandSidebar')} position="right" withArrow>
|
||||
<ActionIcon variant="subtle" color="gray" size="lg" onClick={handleToggle} aria-label="Expand sidebar">
|
||||
<ChevronsRight size={18} />
|
||||
</ActionIcon>
|
||||
@@ -485,7 +485,7 @@ export const SidebarMenu = memo(function SidebarMenu({
|
||||
<Divider />
|
||||
<Box p="xs">
|
||||
<NavLink
|
||||
label="Collapse"
|
||||
label={t('common:collapse')}
|
||||
leftSection={<ChevronsLeft size={18} />}
|
||||
onClick={handleToggle}
|
||||
variant="subtle"
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
"systemNotificationsDesc": "View and manage all system notifications.",
|
||||
"expandAll": "Expand all menu",
|
||||
"collapseAll": "Collapse all menu",
|
||||
"searchMenu": "Search menu"
|
||||
"searchMenu": "Search menu",
|
||||
"collapse": "Collapse",
|
||||
"expandSidebar": "Expand Sidebar"
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,8 @@
|
||||
"systemNotificationsDesc": "Lihat dan kelola semua notifikasi sistem.",
|
||||
"expandAll": "Buka semua menu",
|
||||
"collapseAll": "Tutup semua menu",
|
||||
"searchMenu": "Cari menu"
|
||||
"searchMenu": "Cari menu",
|
||||
"collapse": "Tutup",
|
||||
"expandSidebar": "Perluas Sidebar"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user