Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dynamic uses of i18n in indexPatternManagement plugin #8398

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/8398.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Fix dynamic uses of i18n in indexPatternManagement plugin ([#8398](/~https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8398))
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ import { IndexPattern } from '../../../data/public';
export function getListBreadcrumbs(currentWorkspaceName?: string) {
return [
{
text: i18n.translate('indexPatternManagement.indexPatterns.listBreadcrumb', {
defaultMessage: currentWorkspaceName ? 'Workspace index patterns' : 'Index patterns',
}),
text: currentWorkspaceName
? i18n.translate('indexPatternManagement.inWorkspace.indexPatterns.listBreadcrumb', {
defaultMessage: 'Workspace index patterns',
})
: i18n.translate('indexPatternManagement.indexPatterns.listBreadcrumb', {
defaultMessage: 'Index patterns',
}),
href: `/`,
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,21 +245,21 @@ export const IndexPatternTable = ({ canSave, history }: Props) => {
);
})();

const description = i18n.translate(
'indexPatternManagement.indexPatternTable.indexPatternExplanation',
currentWorkspace
? {
const description = currentWorkspace
? i18n.translate(
'indexPatternManagement.indexPatternTable.indexPatternExplanationWithWorkspace',
{
defaultMessage:
'Create and manage the index patterns that help you retrieve your data from OpenSearch for {name} workspace.',
values: {
name: currentWorkspace.name,
},
}
: {
defaultMessage:
'Create and manage the index patterns that help you retrieve your data from OpenSearch.',
}
);
)
: i18n.translate('indexPatternManagement.indexPatternTable.indexPatternExplanation', {
defaultMessage:
'Create and manage the index patterns that help you retrieve your data from OpenSearch.',
});
const pageTitleAndDescription = useUpdatedUX ? (
<HeaderControl
controls={[{ description }]}
Expand Down
Loading