Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update i18n for general search filter and runInfo facets search #2557

Merged
merged 5 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading