Skip to content

Commit

Permalink
fix: add translation for search disabled
Browse files Browse the repository at this point in the history
Signed-off-by: Joris Mancini <[email protected]>
  • Loading branch information
TheMaskedTurtle committed Jun 3, 2024
1 parent 1b0d542 commit ef23da5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/ElementSearchDialog/element-search-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@ const ElementSearchDialog = (props: ElementSearchDialogProps) => {

const displayedValue = useMemo(() => {
return searchTermDisabled || searchTermDisableReason
? searchTermDisableReason ?? 'search disabled'
? searchTermDisableReason ??
intl.formatMessage({
id: 'element_search/searchDisabled',
})
: searchTerm ?? '';
}, [searchTerm, searchTermDisabled, searchTermDisableReason]);
}, [searchTermDisabled, searchTermDisableReason, intl, searchTerm]);

const handleClose = useCallback(() => {
onSearchTermChange('');
Expand Down
1 change: 1 addition & 0 deletions src/components/translations/element-search-en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
const element_search_en = {
'element_search/label': 'Search for an element',
'element_search/noResult': 'No result',
'element_search/searchDisabled': 'Search disabled',
};

export default element_search_en;
1 change: 1 addition & 0 deletions src/components/translations/element-search-fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
const element_search_fr = {
'element_search/label': 'Rechercher un élément',
'element_search/noResult': 'Aucun résultat',
'element_search/searchDisabled': 'Recherche suspendue',
};

export default element_search_fr;

0 comments on commit ef23da5

Please sign in to comment.