Localization of device types

This commit is contained in:
Tomas Bures 2018-12-23 19:44:29 +00:00
parent 83ce716d94
commit 3d956ec141
2 changed files with 11 additions and 5 deletions

View file

@ -125,6 +125,16 @@ export default class StatisticsOpened extends Component {
let charts = null;
const deviceTypes = {
desktop: t('Desktop'),
tv: t('TV'),
tablet: t('Tablet'),
phone: t('Phone'),
bot: t('Bot'),
car: t('Car'),
console: t('Console')
};
if (agg === 'devices') {
charts = (
<div className={styles.charts}>
@ -137,7 +147,7 @@ export default class StatisticsOpened extends Component {
loader={<div>{t('Loading chart')}</div>}
data={[
[t('Device type'), t('Count')],
...stats.devices.map(entry => [entry.key, entry.count])
...stats.devices.map(entry => [deviceTypes[entry.key] || t('Unknown'), entry.count])
]}
options={{
chartArea: {