Skip to content

Commit 854d863

Browse files
committed
add translations for DatasetInfo.tsx and DatasetVersions.tsx
Signed-off-by: Michael Robinson <merobi@gmail.com>
1 parent ebd2795 commit 854d863

3 files changed

Lines changed: 89 additions & 20 deletions

File tree

web/src/components/datasets/DatasetInfo.tsx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import MqText from '../core/text/MqText'
1010
import React, { FunctionComponent } from 'react'
1111
import RunStatus from '../jobs/RunStatus'
1212

13-
const DATASET_COLUMNS = ['NAME', 'TYPE', 'DESCRIPTION']
14-
1513
interface DatasetInfoProps {
1614
datasetFields: Field[]
1715
facets?: object
@@ -34,15 +32,21 @@ const DatasetInfo: FunctionComponent<DatasetInfoProps> = props => {
3432
<Table size='small'>
3533
<TableHead>
3634
<TableRow>
37-
{DATASET_COLUMNS.map(column => {
38-
return (
39-
<TableCell key={column} align='left'>
40-
<MqText subheading inline>
41-
{column}
42-
</MqText>
43-
</TableCell>
44-
)
45-
})}
35+
<TableCell align='left'>
36+
<MqText subheading inline>
37+
{i18next.t('dataset_info_columns.name')}
38+
</MqText>
39+
</TableCell>
40+
<TableCell align='left'>
41+
<MqText subheading inline>
42+
{i18next.t('dataset_info_columns.type')}
43+
</MqText>
44+
</TableCell>
45+
<TableCell align='left'>
46+
<MqText subheading inline>
47+
{i18next.t('dataset_info_columns.description')}
48+
</MqText>
49+
</TableCell>
4650
</TableRow>
4751
</TableHead>
4852
<TableBody>

web/src/components/datasets/DatasetVersions.tsx

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const DatasetVersions: FunctionComponent<
4747
const handleClick = (newValue: SetStateAction<DatasetVersion | null>) => {
4848
setInfoView(newValue)
4949
}
50+
const i18next = require('i18next')
5051

5152
if (versions.length === 0) {
5253
return null
@@ -72,15 +73,31 @@ const DatasetVersions: FunctionComponent<
7273
<Table size='small'>
7374
<TableHead>
7475
<TableRow>
75-
{DATASET_VERSIONS_COLUMNS.map(column => {
76-
return (
77-
<TableCell key={column} align='left'>
78-
<MqText subheading inline>
79-
{column}
80-
</MqText>
81-
</TableCell>
82-
)
83-
})}
76+
<TableCell align='left'>
77+
<MqText subheading inline>
78+
{i18next.t('dataset_versions_columns.version')}
79+
</MqText>
80+
</TableCell>
81+
<TableCell align='left'>
82+
<MqText subheading inline>
83+
{i18next.t('dataset_versions_columns.created_at')}
84+
</MqText>
85+
</TableCell>
86+
<TableCell align='left'>
87+
<MqText subheading inline>
88+
{i18next.t('dataset_versions_columns.fields')}
89+
</MqText>
90+
</TableCell>
91+
<TableCell align='left'>
92+
<MqText subheading inline>
93+
{i18next.t('dataset_versions_columns.created_by_run')}
94+
</MqText>
95+
</TableCell>
96+
<TableCell align='left'>
97+
<MqText subheading inline>
98+
{i18next.t('dataset_versions_columns.lifecycle_state')}
99+
</MqText>
100+
</TableCell>
84101
</TableRow>
85102
</TableHead>
86103
<TableBody>

web/src/i18n/config.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,18 @@ i18next
8787
started_at: 'STARTED AT',
8888
ended_at: 'ENDED AT',
8989
duration: 'DURATION'
90+
},
91+
dataset_info_columns: {
92+
name: 'NAME',
93+
type: 'TYPE',
94+
description: 'DESCRIPTION'
95+
},
96+
dataset_versions_columns: {
97+
version: 'VERSION',
98+
created_at: 'CREATED AT',
99+
fields: 'FIELDS',
100+
created_by_run: 'CREATED BY RUN',
101+
lifecycle_state: 'LIFECYCLE STATE'
90102
}
91103
}
92104
},
@@ -161,6 +173,18 @@ i18next
161173
started_at: 'COMMENCÉ À',
162174
ended_at: 'TERMINÉ À',
163175
duration: 'DURÉE'
176+
},
177+
dataset_info_columns: {
178+
name: 'NOM',
179+
type: 'TAPER',
180+
description: 'DESCRIPTION'
181+
},
182+
dataset_versions_columns: {
183+
version: 'VERSION',
184+
created_at: 'CRÉÉ À',
185+
fields: 'DOMAINES',
186+
created_by_run: 'CRÉÉ PAR RUN',
187+
lifecycle_state: 'ÉTAT DU CYCLE DE VIE'
164188
}
165189
}
166190
},
@@ -235,6 +259,18 @@ i18next
235259
started_at: 'EMPEZÓ A LAS',
236260
ended_at: 'TERMINÓ EN',
237261
duration: 'DURACIÓN'
262+
},
263+
dataset_info_columns: {
264+
name: 'NOMBRE',
265+
type: 'ESCRIBE',
266+
description: 'DESCRIPCIÓN'
267+
},
268+
dataset_versions_columns: {
269+
version: 'VERSIÓN',
270+
created_at: 'CREADO EN',
271+
fields: 'CAMPOS',
272+
created_by_run: 'CREADO POR EJECUTAR',
273+
lifecycle_state: 'ESTADO DEL CICLO DE VIDA'
238274
}
239275
}
240276
},
@@ -309,6 +345,18 @@ i18next
309345
started_at: 'ROZPOCZĘŁO SIĘ O GODZ',
310346
ended_at: 'ZAKOŃCZONE O GODZ',
311347
duration: 'TRWANIE'
348+
},
349+
dataset_info_columns: {
350+
name: 'NAZWA',
351+
type: 'RODZAJ',
352+
description: 'OPIS'
353+
},
354+
dataset_versions_columns: {
355+
version: 'WERSJA',
356+
created_at: 'UTWORZONY W',
357+
fields: 'KIERUNKI',
358+
created_by_run: 'STWORZONY PRZEZ URUCHOM',
359+
lifecycle_state: 'STAN CYKLU ŻYCIA'
312360
}
313361
}
314362
}

0 commit comments

Comments
 (0)