fix(core-components): Add i18n support for LogViewer search control
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/core-components': patch
|
||||
---
|
||||
|
||||
Add i18n support for LogViewer search control
|
||||
@@ -63,6 +63,7 @@ export const coreComponentsTranslationRef: TranslationRef<
|
||||
readonly 'autoLogout.stillTherePrompt.buttonText': "Yes! Don't log me out";
|
||||
readonly 'dependencyGraph.fullscreenTooltip': 'Toggle fullscreen';
|
||||
readonly 'proxiedSignInPage.title': 'You do not appear to be signed in. Please try reloading the browser page.';
|
||||
readonly 'logViewer.searchField.placeholder': 'Search';
|
||||
}
|
||||
>;
|
||||
|
||||
|
||||
@@ -15,17 +15,20 @@
|
||||
*/
|
||||
|
||||
import { KeyboardEvent } from 'react';
|
||||
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
||||
import IconButton from '@material-ui/core/IconButton';
|
||||
import TextField from '@material-ui/core/TextField';
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
import ChevronLeftIcon from '@material-ui/icons/ChevronLeft';
|
||||
import ChevronRightIcon from '@material-ui/icons/ChevronRight';
|
||||
import FilterListIcon from '@material-ui/icons/FilterList';
|
||||
import { coreComponentsTranslationRef } from '../../translation';
|
||||
import { LogViewerSearch } from './useLogViewerSearch';
|
||||
|
||||
export interface LogViewerControlsProps extends LogViewerSearch {}
|
||||
|
||||
export function LogViewerControls(props: LogViewerControlsProps) {
|
||||
const { t } = useTranslationRef(coreComponentsTranslationRef);
|
||||
const { resultCount, resultIndexStep, toggleShouldFilter } = props;
|
||||
const resultIndex = props.resultIndex ?? 0;
|
||||
|
||||
@@ -57,7 +60,7 @@ export function LogViewerControls(props: LogViewerControlsProps) {
|
||||
<TextField
|
||||
size="small"
|
||||
variant="standard"
|
||||
placeholder="Search"
|
||||
placeholder={t('logViewer.searchField.placeholder')}
|
||||
value={props.searchInput}
|
||||
onKeyPress={handleKeyPress}
|
||||
onChange={e => props.setSearchInput(e.target.value)}
|
||||
|
||||
@@ -127,5 +127,10 @@ export const coreComponentsTranslationRef = createTranslationRef({
|
||||
title:
|
||||
'You do not appear to be signed in. Please try reloading the browser page.',
|
||||
},
|
||||
logViewer: {
|
||||
searchField: {
|
||||
placeholder: 'Search',
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user