Client - application translation (wip)

This commit is contained in:
Sam
2019-09-16 10:26:02 +02:00
parent 745d102ee2
commit 77bc32d4a5
33 changed files with 651 additions and 374 deletions

View File

@ -0,0 +1,18 @@
import React from 'react'
import { Link } from 'react-router-dom'
export default class NoActivities extends React.PureComponent {
render() {
const { t } = this.props
return (
<div className="card text-center">
<div className="card-body">
{t('common:No workouts.')}{' '}
<Link to={{ pathname: '/activities/add' }}>
{t('dashboard:Upload one !')}
</Link>
</div>
</div>
)
}
}

View File

@ -28,9 +28,9 @@ export default class StatsCharts extends React.PureComponent {
render() {
const { displayedData } = this.state
const { sports, stats } = this.props
const { sports, stats, t } = this.props
if (Object.keys(stats).length === 0) {
return 'No workouts'
return t('common:No workouts.')
}
return (
<div className="chart-stats">
@ -42,7 +42,7 @@ export default class StatsCharts extends React.PureComponent {
checked={displayedData === 'distance'}
onChange={e => this.handleRadioChange(e)}
/>
distance
{t('statistics:distance')}
</label>
<label className="radioLabel col">
<input
@ -51,7 +51,7 @@ export default class StatsCharts extends React.PureComponent {
checked={displayedData === 'duration'}
onChange={e => this.handleRadioChange(e)}
/>
duration
{t('statistics:duration')}
</label>
<label className="radioLabel col">
<input
@ -60,7 +60,7 @@ export default class StatsCharts extends React.PureComponent {
checked={displayedData === 'activities'}
onChange={e => this.handleRadioChange(e)}
/>
activities
{t('statistics:activities')}
</label>
</div>
<ResponsiveContainer height={300}>

View File

@ -37,10 +37,11 @@ class Statistics extends React.PureComponent {
statistics,
statsParams,
displayEmpty,
t,
user,
} = this.props
if (!displayEmpty && Object.keys(statistics).length === 0) {
return 'No workouts'
return <span>{t('common:No workouts.')}</span>
}
const stats = formatStats(
statistics,
@ -49,7 +50,7 @@ class Statistics extends React.PureComponent {
displayedSports,
user.weekm
)
return <StatsChart sports={sports} stats={stats} />
return <StatsChart sports={sports} stats={stats} t={t} />
}
}