Skip to content

Commit

Permalink
update i18n for general search filter and runInfo facets search (#2557
Browse files Browse the repository at this point in the history
)

* update i18n for search filter headings

Signed-off-by: Michael Robinson <merobi@gmail.com>

* update i18n for runinfo search

Signed-off-by: Michael Robinson <merobi@gmail.com>

---------

Signed-off-by: Michael Robinson <merobi@gmail.com>
  • Loading branch information
merobi-hub authored Aug 4, 2023
1 parent 82d7279 commit 59f4552
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 7 deletions.
2 changes: 1 addition & 1 deletion web/src/components/jobs/RunInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const RunInfo: FunctionComponent<RunInfoProps> = props => {
<Box mb={1}>
<MqText subheading>{i18next.t('jobs.runinfo_subhead')}</MqText>
</Box>
<MqJsonView data={run.facets} searchable={true} placeholder='Search' />
<MqJsonView data={run.facets} searchable={true} placeholder={i18next.t('jobs.search')} />
</Box>
)}
</Box>
Expand Down
15 changes: 9 additions & 6 deletions web/src/components/search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,25 @@ import SearchPlaceholder from './SearchPlaceholder'
import debounce from '@material-ui/core/utils/debounce'
import withStyles, { WithStyles } from '@material-ui/core/styles/withStyles'

const i18next = require('i18next')

const INITIAL_SEARCH_FILTER = [
{
text: 'All',
text: i18next.t('search.filter.all'),
value: 'All'
},
{
icon: faCog,
foregroundColor: theme.palette.common.white,
backgroundColor: theme.palette.primary.main,
text: 'Jobs',
text: i18next.t('search.filter.jobs'),
value: 'JOB'
},
{
icon: faDatabase,
foregroundColor: theme.palette.common.white,
backgroundColor: theme.palette.primary.main,
text: 'Datasets',
text: i18next.t('search.filter.datasets'),
value: 'DATASET'
}
]
Expand All @@ -53,11 +55,11 @@ const INITIAL_SEARCH_SORT_FILTER = [
selectable: false
},
{
text: 'Updated',
text: i18next.t('search.filter.updated'),
value: 'UPDATE_AT'
},
{
text: 'Name',
text: i18next.t('search.filter.name'),
value: 'NAME'
}
]
Expand Down Expand Up @@ -222,6 +224,7 @@ class Search extends React.Component<SearchProps, SearchState> {

render() {
const { classes, isSearching, isSearchingInit } = this.props
const i18next = require('i18next')
return (
<Box width={538} position={'relative'} px={10} mr={-8} id={'searchContainer'}>
<Box className={classes.searchIcon}>
Expand Down Expand Up @@ -275,7 +278,7 @@ class Search extends React.Component<SearchProps, SearchState> {
{this.props.searchResults.size === 0 && (
<Box m={2} display={'flex'} alignItems={'center'} justifyContent={'center'}>
<MqText>
{isSearching || !isSearchingInit ? 'Searching...' : 'No Results'}
{isSearching || !isSearchingInit ? i18next.t('search.status') : i18next.t('search.none')}
</MqText>
</Box>
)}
Expand Down
40 changes: 40 additions & 0 deletions web/src/i18n/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ i18next
docs_link: 'API Docs'
},
jobs: {
search: 'Search',
latest_tab: 'LATEST RUN',
history_tab: 'RUN HISTORY',
location: 'LOCATION',
Expand All @@ -37,6 +38,15 @@ i18next
dialog_confirmation_title: 'Are you sure?'
},
search: {
filter: {
all: 'All',
jobs: 'Jobs',
datasets: 'Datasets',
updated: 'Updated',
name: 'Name'
},
status: 'Searching...',
none: 'No Results',
search: 'Search',
jobs: 'Jobs',
and: 'and',
Expand Down Expand Up @@ -137,6 +147,7 @@ i18next
docs_link: 'Documents API'
},
jobs: {
search: 'Recherche',
latest_tab: 'DERNIÈRE COURSE',
history_tab: "HISTORIQUE D'EXECUTION",
location: 'EMPLACEMENT',
Expand All @@ -148,6 +159,15 @@ i18next
dialog_confirmation_title: 'Êtes-vous sûr?'
},
search: {
filter: {
all: 'Tout',
jobs: "d'Emplois",
datasets: 'Jeux de Données',
updated: 'Mis à jour',
name: 'Nom'
},
status: 'Recherche...',
none: 'Aucun Résultat',
search: 'Recherche',
jobs: "d'Emplois",
and: 'et',
Expand Down Expand Up @@ -251,6 +271,7 @@ i18next
docs_link: 'Documentos API'
},
jobs: {
search: 'Buscar',
latest_tab: 'ÚLTIMA EJECUCIÓN',
history_tab: 'HISTORIAL DE EJECUCIONES',
location: 'UBICACIÓN',
Expand All @@ -262,6 +283,15 @@ i18next
dialog_confirmation_title: 'Estás seguro?'
},
search: {
filter: {
all: 'Todo',
jobs: 'Trabajos',
datasets: 'Conjuntos de Datos',
updated: 'Actualizado',
name: 'Nombre'
},
status: 'Buscando...',
none: 'No Hay Resultados',
search: 'Buscar',
jobs: 'Trabajos',
and: 'y',
Expand Down Expand Up @@ -365,6 +395,7 @@ i18next
docs_link: 'Dokumentacja API'
},
jobs: {
search: 'Wyszukiwanie',
latest_tab: 'OSTATNI WYKONANIE',
history_tab: 'HISTORIA WYKONAŃ',
location: 'LOKALIZACJA',
Expand All @@ -376,6 +407,15 @@ i18next
dialog_confirmation_title: 'Jesteś pewny?'
},
search: {
filter: {
all: 'Wszystko',
jobs: 'Zadania',
datasets: 'Zbiory Danych',
updated: 'Zaktualizowano',
name: 'Nazwa'
},
status: 'Badawczy...',
none: 'Brak Wyników',
search: 'Wyszukiwanie',
jobs: 'Zadania',
and: 'i',
Expand Down

0 comments on commit 59f4552

Please sign in to comment.