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

[Vis Builder] Removed Hard Coded Strings and Used i18n to translate #2867

Merged
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
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