Skip to content

Commit

Permalink
add translations for DatasetInfo.tsx and DatasetVersions.tsx
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Robinson <[email protected]>
  • Loading branch information
merobi-hub committed Dec 6, 2022
1 parent ebd2795 commit b5ea8ea
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 16 deletions.
30 changes: 20 additions & 10 deletions web/src/components/datasets/DatasetInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import MqText from '../core/text/MqText'
import React, { FunctionComponent } from 'react'
import RunStatus from '../jobs/RunStatus'

const DATASET_COLUMNS = ['NAME', 'TYPE', 'DESCRIPTION']
// const DATASET_COLUMNS = ['NAME', 'TYPE', 'DESCRIPTION']

interface DatasetInfoProps {
datasetFields: Field[]
Expand All @@ -34,15 +34,25 @@ const DatasetInfo: FunctionComponent<DatasetInfoProps> = props => {
<Table size='small'>
<TableHead>
<TableRow>
{DATASET_COLUMNS.map(column => {
return (
<TableCell key={column} align='left'>
<MqText subheading inline>
{column}
</MqText>
</TableCell>
)
})}
{/* {DATASET_COLUMNS.map(column => {
return ( */}
<TableCell align='left'>
<MqText subheading inline>
{i18next.t('dataset_info_columns.name')}
</MqText>
</TableCell>
<TableCell align='left'>
<MqText subheading inline>
{i18next.t('dataset_info_columns.type')}
</MqText>
</TableCell>
<TableCell align='left'>
<MqText subheading inline>
{i18next.t('dataset_info_columns.description')}
</MqText>
</TableCell>
{/* )
})} */}
</TableRow>
</TableHead>
<TableBody>
Expand Down
33 changes: 27 additions & 6 deletions web/src/components/datasets/DatasetVersions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const DatasetVersions: FunctionComponent<
const handleClick = (newValue: SetStateAction<DatasetVersion | null>) => {
setInfoView(newValue)
}
const i18next = require('i18next')

if (versions.length === 0) {
return null
Expand All @@ -72,15 +73,35 @@ const DatasetVersions: FunctionComponent<
<Table size='small'>
<TableHead>
<TableRow>
{DATASET_VERSIONS_COLUMNS.map(column => {
return (
<TableCell key={column} align='left'>
{/* {DATASET_VERSIONS_COLUMNS.map(column => {
return ( */}
<TableCell align='left'>
<MqText subheading inline>
{i18next.t('dataset_versions_columns.version')}
</MqText>
</TableCell>
<TableCell align='left'>
<MqText subheading inline>
{i18next.t('dataset_versions_columns.created_at')}
</MqText>
</TableCell>
<TableCell align='left'>
<MqText subheading inline>
{i18next.t('dataset_versions_columns.fields')}
</MqText>
</TableCell>
<TableCell align='left'>
<MqText subheading inline>
{i18next.t('dataset_versions_columns.created_by_run')}
</MqText>
</TableCell>
<TableCell align='left'>
<MqText subheading inline>
{column}
{i18next.t('dataset_versions_columns.lifecycle_state')}
</MqText>
</TableCell>
)
})}
{/* )
})} */}
</TableRow>
</TableHead>
<TableBody>
Expand Down
48 changes: 48 additions & 0 deletions web/src/i18n/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ i18next
started_at: 'STARTED AT',
ended_at: 'ENDED AT',
duration: 'DURATION'
},
dataset_info_columns: {
name: 'NAME',
type: 'TYPE',
description: 'DESCRIPTION'
},
dataset_versions_columns: {
version: 'VERSION',
created_at: 'CREATED AT',
fields: 'FIELDS',
created_by_run: 'CREATED BY RUN',
lifecycle_state: 'LIFECYCLE STATE'
}
}
},
Expand Down Expand Up @@ -161,6 +173,18 @@ i18next
started_at: 'COMMENCÉ À',
ended_at: 'TERMINÉ À',
duration: 'DURÉE'
},
dataset_info_columns: {
name: 'NOM',
type: 'TAPER',
description: 'DESCRIPTION'
},
dataset_versions_columns: {
version: 'VERSION',
created_at: 'CRÉÉ À',
fields: 'DOMAINES',
created_by_run: 'CRÉÉ PAR RUN',
lifecycle_state: 'ÉTAT DU CYCLE DE VIE'
}
}
},
Expand Down Expand Up @@ -235,6 +259,18 @@ i18next
started_at: 'EMPEZÓ A LAS',
ended_at: 'TERMINÓ EN',
duration: 'DURACIÓN'
},
dataset_info_columns: {
name: 'NOMBRE',
type: 'ESCRIBE',
description: 'DESCRIPCIÓN'
},
dataset_versions_columns: {
version: 'VERSIÓN',
created_at: 'CREADO EN',
fields: 'CAMPOS',
created_by_run: 'CREADO POR EJECUTAR',
lifecycle_state: 'ESTADO DEL CICLO DE VIDA'
}
}
},
Expand Down Expand Up @@ -309,6 +345,18 @@ i18next
started_at: 'ROZPOCZĘŁO SIĘ O GODZ',
ended_at: 'ZAKOŃCZONE O GODZ',
duration: 'TRWANIE'
},
dataset_info_columns: {
name: 'NAZWA',
type: 'RODZAJ',
description: 'OPIS'
},
dataset_versions_columns: {
version: 'WERSJA',
created_at: 'UTWORZONY W',
fields: 'KIERUNKI',
created_by_run: 'STWORZONY PRZEZ URUCHOM',
lifecycle_state: 'STAN CYKLU ŻYCIA'
}
}
}
Expand Down

0 comments on commit b5ea8ea

Please sign in to comment.