@applica-software-guru/react-admin 1.2.115 → 1.2.117

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applica-software-guru/react-admin",
3
- "version": "1.2.115",
3
+ "version": "1.2.117",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,6 +9,7 @@ import { useChildren, useIsActive } from './hooks';
9
9
  import { ExpandLess, ExpandMore } from '@mui/icons-material';
10
10
  import { getLevel } from './utils';
11
11
  import { useThemeConfig } from '../../../hooks';
12
+ import { useTranslate } from 'ra-core';
12
13
 
13
14
  type IBaseNavMenuItemProps = React.PropsWithChildren<{
14
15
  id: string;
@@ -42,7 +43,8 @@ function NavMenu() {
42
43
  }
43
44
 
44
45
  function NavMenuItem(props: INavMenuItemProps) {
45
- const navMenuItemProps = useNavMenuItem(props),
46
+ const translate = useTranslate() ?? _.identity,
47
+ navMenuItemProps = useNavMenuItem(props),
46
48
  { selected, label, icon, onClick: _onClick, badge, items, isGroup, level } = navMenuItemProps,
47
49
  { spacing } = useThemeConfig(),
48
50
  [open, setOpen] = useState(selected),
@@ -61,7 +63,7 @@ function NavMenuItem(props: INavMenuItemProps) {
61
63
  <ListItem {...listItemProps} disablePadding>
62
64
  <ListItemButton selected={selected && !isGroup} onClick={onClick} sx={{ pl: spacing * level }}>
63
65
  {hasIcon && <ListItemIcon>{icon}</ListItemIcon>}
64
- <ListItemText inset={!hasIcon} primary={label} />
66
+ <ListItemText inset={!hasIcon} primary={translate(label)} />
65
67
  {badge && (
66
68
  <ListItemAvatar>
67
69
  <Avatar type="filled" size="xs" color={badge.color ?? 'default'}>
package/src/index.jsx CHANGED
@@ -66,6 +66,7 @@ export {
66
66
  useGetOne,
67
67
  useInput,
68
68
  useListContext,
69
+ useLocaleState,
69
70
  useNotify,
70
71
  usePermissions,
71
72
  useRecordContext,