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) (#3189)

Signed-off-by: AbhishekReddy1127 <nallamsa@amazon.com>

Signed-off-by: AbhishekReddy1127 <nallamsa@amazon.com>
(cherry picked from commit b19c171)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

Signed-off-by: AbhishekReddy1127 <nallamsa@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 7c0489e commit ba932e0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
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 ba932e0

Please sign in to comment.