diff --git a/.changeset/slick-onions-wash.md b/.changeset/slick-onions-wash.md new file mode 100644 index 0000000000..4627d02e81 --- /dev/null +++ b/.changeset/slick-onions-wash.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-components': patch +--- + +Add i18n support for LogViewer search control diff --git a/packages/core-components/report-alpha.api.md b/packages/core-components/report-alpha.api.md index 96ddebcd3a..7608699487 100644 --- a/packages/core-components/report-alpha.api.md +++ b/packages/core-components/report-alpha.api.md @@ -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'; } >; diff --git a/packages/core-components/src/components/LogViewer/LogViewerControls.tsx b/packages/core-components/src/components/LogViewer/LogViewerControls.tsx index e920d623e8..461e058d2d 100644 --- a/packages/core-components/src/components/LogViewer/LogViewerControls.tsx +++ b/packages/core-components/src/components/LogViewer/LogViewerControls.tsx @@ -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) { props.setSearchInput(e.target.value)} diff --git a/packages/core-components/src/translation.ts b/packages/core-components/src/translation.ts index aa644fa909..3d0e62747e 100644 --- a/packages/core-components/src/translation.ts +++ b/packages/core-components/src/translation.ts @@ -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', + }, + }, }, });