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
@@ -7,11 +7,14 @@ import {
SimpleForm,
SelectInput,
ReferenceInput,
useTranslate,
} from 'react-admin'
import { Title } from '../common'
const PlayerTitle = ({ record }) => {
return <Title subTitle={`Player ${record ? record.name : ''}`} />
const translate = useTranslate()
const resourceName = translate('resources.player.name', { smart_count: 1 })
return <Title subTitle={`${resourceName} ${record ? record.name : ''}`} />
}
const PlayerEdit = (props) => (
+7 -1
View File
@@ -13,7 +13,13 @@ import { SimpleList, Title } from '../common'
const PlayerList = (props) => {
const isXsmall = useMediaQuery((theme) => theme.breakpoints.down('xs'))
return (
<List title={<Title subTitle={'Players'} />} exporter={false} {...props}>
<List
title={
<Title subTitle={'resources.player.name'} args={{ smart_count: 2 }} />
}
exporter={false}
{...props}
>
{isXsmall ? (
<SimpleList
primaryText={(r) => r.client}