Skip to content

Commit

Permalink
[Vis Builder] Removed Hard Coded Strings and Used i18n to transalte (#…
Browse files Browse the repository at this point in the history
…2867)

Signed-off-by: AbhishekReddy1127 <[email protected]>

Signed-off-by: AbhishekReddy1127 <[email protected]>
  • Loading branch information
AbhishekReddy1127 authored Nov 14, 2022
1 parent 28c3df3 commit b19c171
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { i18n } from '@osd/i18n';
import {
EuiButtonIcon,
EuiDragDropContext,
Expand Down Expand Up @@ -127,7 +128,11 @@ const DropboxComponent = ({
} ${canDrop ? 'canDrop' : ''}`}
{...(isValidDropTarget && dropProps)}
>
<EuiText size="s">Click or drop to add</EuiText>
<EuiText size="s">
{i18n.translate('visBuilder.dropbox.addField.title', {
defaultMessage: 'Click or drop to add',
})}
</EuiText>
<EuiButtonIcon
iconType="plusInCircle"
aria-label="clear-field"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { i18n } from '@osd/i18n';
import { EuiEmptyPrompt, EuiFlexGroup, EuiFlexItem, EuiIcon, EuiPanel } from '@elastic/eui';
import React, { FC, useState, useMemo, useEffect, useLayoutEffect } from 'react';
import { useOpenSearchDashboards } from '../../../../opensearch_dashboards_react/public';
Expand Down Expand Up @@ -89,10 +90,21 @@ export const Workspace: FC = ({ children }) => {
) : (
<EuiFlexItem className="vbWorkspace__empty" data-test-subj="emptyWorkspace">
<EuiEmptyPrompt
title={<h2>Add a field to start</h2>}
title={
<h2>
{i18n.translate('visBuilder.workSpace.empty.title', {
defaultMessage: 'Add a field to start',
})}
</h2>
}
body={
<>
<p>Drag a field to the configuration panel to generate a visualization.</p>
<p>
{i18n.translate('visBuilder.workSpace.empty.description', {
defaultMessage:
'Drag a field to the configuration panel to generate a visualization.',
})}
</p>
<div className="vbWorkspace__container">
<EuiIcon className="vbWorkspace__fieldSvg" type={fields_bg} size="original" />
<EuiIcon
Expand Down

0 comments on commit b19c171

Please sign in to comment.