Fix NavBar title translations

This commit is contained in:
Deluan
2020-04-27 23:22:17 -04:00
parent 069de0f9ea
commit ea1d534c29
14 changed files with 97 additions and 26 deletions
+4 -1
View File
@@ -8,11 +8,14 @@ import {
required,
email,
SimpleForm,
useTranslate,
} from 'react-admin'
import { Title } from '../common'
const UserTitle = ({ record }) => {
return <Title subTitle={`User ${record ? record.name : ''}`} />
const translate = useTranslate()
const resourceName = translate('resources.user.name', { smart_count: 1 })
return <Title subTitle={`${resourceName} ${record ? record.name : ''}`} />
}
const UserEdit = (props) => (
<Edit title={<UserTitle />} {...props}>