From e6e52d74f87885e246bde54d313ca9798d9821b1 Mon Sep 17 00:00:00 2001 From: AbhishekReddy1127 Date: Fri, 11 Nov 2022 23:14:42 +0000 Subject: [PATCH] [Vis Builder] Removed Hard Coded Strings and Used i18n to transalte Signed-off-by: AbhishekReddy1127 --- CHANGELOG.md | 1 + .../application/components/data_tab/dropbox.tsx | 7 ++++++- .../public/application/components/workspace.tsx | 16 ++++++++++++++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2a7f536871..e0691372f42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,6 +86,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [MD] Refactor data source error handling ([#2661](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2661)) - Refactor and improve Discover field summaries ([#2391](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2391)) +- [Vis Builder] Removed Hard Coded Strings and Used i18n to transalte([#2867](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2867)) ### 🔩 Tests diff --git a/src/plugins/vis_builder/public/application/components/data_tab/dropbox.tsx b/src/plugins/vis_builder/public/application/components/data_tab/dropbox.tsx index f6b7a6ca221..70b43a2c601 100644 --- a/src/plugins/vis_builder/public/application/components/data_tab/dropbox.tsx +++ b/src/plugins/vis_builder/public/application/components/data_tab/dropbox.tsx @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +import { i18n } from '@osd/i18n'; import { EuiButtonIcon, EuiDragDropContext, @@ -127,7 +128,11 @@ const DropboxComponent = ({ } ${canDrop ? 'canDrop' : ''}`} {...(isValidDropTarget && dropProps)} > - Click or drop to add + + {i18n.translate('visBuilder.dropbox.addField.title', { + defaultMessage: 'Click or drop to add', + })} + { ) : ( Add a field to start} + title={ +

+ {i18n.translate('visBuilder.workSpace.empty.title', { + defaultMessage: 'Add a field to start', + })} +

+ } body={ <> -

Drag a field to the configuration panel to generate a visualization.

+

+ {i18n.translate('visBuilder.workSpace.empty.description', { + defaultMessage: + 'Drag a field to the configuration panel to generate a visualization.', + })} +