From 391e2ac950456d91e3ab2b1d3205929e530f0d7d Mon Sep 17 00:00:00 2001 From: Miki Date: Wed, 2 Oct 2024 10:54:30 -0700 Subject: [PATCH] Fix dynamic uses of i18n and correct duplicate i18n identifiers in console plugin (#8393) * Fix dynamic uses of i18n and correct duplicate i18n identifiers in console plugin Signed-off-by: Miki * Changeset file for PR #8393 created/updated --------- Signed-off-by: Miki Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> --- changelogs/fragments/8393.yml | 2 ++ .../application/components/import_flyout.tsx | 2 +- .../editor/legacy/console_editor/editor.tsx | 24 +++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 changelogs/fragments/8393.yml diff --git a/changelogs/fragments/8393.yml b/changelogs/fragments/8393.yml new file mode 100644 index 000000000000..e1b1031516af --- /dev/null +++ b/changelogs/fragments/8393.yml @@ -0,0 +1,2 @@ +fix: +- Fix dynamic uses of i18n and correct duplicate i18n identifiers in console plugin ([#8393](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8393)) \ No newline at end of file diff --git a/src/plugins/console/public/application/components/import_flyout.tsx b/src/plugins/console/public/application/components/import_flyout.tsx index 0dd0112048e1..ef16dbefd6ef 100644 --- a/src/plugins/console/public/application/components/import_flyout.tsx +++ b/src/plugins/console/public/application/components/import_flyout.tsx @@ -215,7 +215,7 @@ export const ImportFlyout = ({ close, refresh }: ImportFlyoutProps) => { } else { setStatus('error'); setError( - i18n.translate('console.ImportFlyout.importFileErrorMessage', { + i18n.translate('console.ImportFlyout.importFileErrorMessage.notJSON', { defaultMessage: 'The selected file is not valid. Please select a valid JSON file.', }) ); diff --git a/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.tsx b/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.tsx index 4422cbc4743f..e45cf876d1e4 100644 --- a/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.tsx +++ b/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.tsx @@ -228,10 +228,14 @@ function EditorUI({ initialTextValue, dataSourceId }: EditorProps) { }); }, [sendCurrentRequestToOpenSearch, openDocumentation]); - const tooltipDefaultMessage = - dataSourceId === undefined ? `Select a data source` : `Click to send request`; - - const toolTipButtonDiasbled = dataSourceId === undefined; + const toolTipButtonDisabled = dataSourceId === undefined; + const sendLabel = toolTipButtonDisabled + ? i18n.translate('console.sendRequestButtonTooltip.withoutDataSourceId', { + defaultMessage: 'Select a data source', + }) + : i18n.translate('console.sendRequestButtonTooltip', { + defaultMessage: 'Send request', + }); return (
@@ -243,19 +247,13 @@ function EditorUI({ initialTextValue, dataSourceId }: EditorProps) { responsive={false} > - +