feat: SearchBar clear button support i18n

Signed-off-by: mario ma <mario.ma.node@gmail.com>
This commit is contained in:
mario ma
2025-06-04 16:09:44 +08:00
parent c0123c0433
commit 869fa46bd2
4 changed files with 9 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-search-react': patch
---
SearchBar clear button support i18n
+1
View File
@@ -101,6 +101,7 @@ export const searchReactTranslationRef: TranslationRef<
{
readonly 'searchBar.title': 'Search';
readonly 'searchBar.placeholder': 'Search in {{org}}';
readonly 'searchBar.clearButtonTitle': 'Clear';
readonly 'searchFilter.allOptionTitle': 'All';
readonly 'searchPagination.limitLabel': 'Results per page:';
readonly 'searchPagination.limitText': 'of {{num}}';
@@ -154,7 +154,7 @@ export const SearchBarBase = forwardRef((props: SearchBarBaseProps, ref) => {
const clearButtonEndAdornment = (
<InputAdornment position="end">
<Button
aria-label="Clear"
aria-label={t('searchBar.clearButtonTitle')}
size="small"
onClick={handleClear}
onKeyDown={event => {
@@ -164,7 +164,7 @@ export const SearchBarBase = forwardRef((props: SearchBarBaseProps, ref) => {
}
}}
>
Clear
{t('searchBar.clearButtonTitle')}
</Button>
</InputAdornment>
);
+1
View File
@@ -25,6 +25,7 @@ export const searchReactTranslationRef = createTranslationRef({
searchBar: {
title: 'Search',
placeholder: 'Search in {{org}}',
clearButtonTitle: 'Clear',
},
searchFilter: {
allOptionTitle: 'All',