Skip to content

Commit

Permalink
Fix dynamic uses of i18n in discover plugin (#8396) (#8473)
Browse files Browse the repository at this point in the history
* Fix dynamic uses of i18n in discover plugin



* Changeset file for PR #8396 created/updated

---------



(cherry picked from commit bd8d4d8)

Signed-off-by: Miki <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 3, 2024
1 parent 8c61f6d commit 1368356
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/8396.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Fix dynamic uses of i18n in discover plugin ([#8396](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8396))
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const DiscoverChart = ({
</div>
);

const toggleLabel = i18n.translate('histogram.collapse', {
const toggleLabel = i18n.translate('discover.histogram.collapse', {
defaultMessage: 'Toggle histogram',
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const TableCellUI = ({
size="xs"
onClick={() => onFilter?.(columnId, fieldMapping, '+')}
iconType="plusInCircle"
aria-label={i18n.translate('discover.filterForValueLabel', {
aria-label={i18n.translate('discover.filterForValue', {
defaultMessage: 'Filter for value',
})}
data-test-subj="filterForValue"
Expand All @@ -65,7 +65,7 @@ const TableCellUI = ({
size="xs"
onClick={() => onFilter?.(columnId, fieldMapping, '-')}
iconType="minusInCircle"
aria-label={i18n.translate('discover.filterOutValueLabel', {
aria-label={i18n.translate('discover.filterOutValue', {
defaultMessage: 'Filter out value',
})}
data-test-subj="filterOutValue"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ export function TableHeaderColumn({
className="docTableHeaderField"
role="columnheader"
aria-label={i18n.translate('discover.defaultTable.docTableHeaderLabel', {
defaultMessage: `Discover table column: ${name}`,
defaultMessage: 'Discover table column: {name}',
values: { name },
})}
>
<span data-test-subj={`docTableHeader-${name}`}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,7 @@ const FieldList = ({
onClick={() => setExpanded(!expanded)}
size="xs"
className="dscSideBar_fieldGroup"
aria-label={i18n.translate('discover.fieldChooser.fieldGroupLabel', {
defaultMessage: title,
})}
aria-label={title}
>
{title}
</EuiButtonEmpty>
Expand Down

0 comments on commit 1368356

Please sign in to comment.