Skip to content

Commit

Permalink
[i18n] Fix some hardcoded translations on Dashboard & Discover (elast…
Browse files Browse the repository at this point in the history
…ic#105555) (elastic#105631)

* [i18n] fix objectType in dashboard/save_search save modal

* [i18n] fix objectType in visualize save modal

* add translations

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
  • Loading branch information
kibanamachine and dmlemeshko authored Jul 14, 2021
1 parent 62a9227 commit da718a3
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import React, { Fragment } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';
import { EuiFormRow, EuiTextArea, EuiSwitch } from '@elastic/eui';

import type { SavedObjectsTaggingApi } from '../../services/saved_objects_tagging_oss';
Expand Down Expand Up @@ -148,7 +149,9 @@ export class DashboardSaveModal extends React.Component<Props, State> {
title={this.props.title}
showCopyOnSave={this.props.showCopyOnSave}
initialCopyOnSave={this.props.showCopyOnSave}
objectType="dashboard"
objectType={i18n.translate('dashboard.topNav.saveModal.objectType', {
defaultMessage: 'dashboard',
})}
options={this.renderDashboardSaveOptions()}
showDescription={false}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ export async function onSaveSearch({
onClose={() => {}}
title={savedSearch.title}
showCopyOnSave={!!savedSearch.id}
objectType="search"
objectType={i18n.translate('discover.localMenu.saveSaveSearchObjectType', {
defaultMessage: 'search',
})}
description={i18n.translate('discover.localMenu.saveSaveSearchDescription', {
defaultMessage:
'Save your Discover search so you can use it in visualizations and dashboards',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,9 @@ export const getTopNavConfig = (
onSave={onSave}
options={tagOptions}
getAppNameFromId={stateTransfer.getAppNameFromId}
objectType={'visualization'}
objectType={i18n.translate('visualize.topNavMenu.saveVisualizationObjectType', {
defaultMessage: 'visualization',
})}
onClose={() => {}}
originatingApp={originatingApp}
returnToOriginSwitchLabel={
Expand All @@ -475,7 +477,9 @@ export const getTopNavConfig = (
canSaveByReference={Boolean(visualizeCapabilities.save)}
onSave={onSave}
tagOptions={tagOptions}
objectType={'visualization'}
objectType={i18n.translate('visualize.topNavMenu.saveVisualizationObjectType', {
defaultMessage: 'visualization',
})}
onClose={() => {}}
/>
);
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,7 @@
"dashboard.topNav.options.syncColorsBetweenPanelsSwitchLabel": "パネル全体でカラーパレットを同期",
"dashboard.topNav.options.useMarginsBetweenPanelsSwitchLabel": "パネルの間に余白を使用",
"dashboard.topNav.saveModal.descriptionFormRowLabel": "説明",
"dashboard.topNav.saveModal.objectType": "dashboard",
"dashboard.topNav.saveModal.storeTimeWithDashboardFormRowHelpText": "有効化すると、ダッシュボードが読み込まれるごとに現在選択された時刻の時間フィルターが変更されます。",
"dashboard.topNav.saveModal.storeTimeWithDashboardFormRowLabel": "ダッシュボードに時刻を保存",
"dashboard.topNav.showCloneModal.dashboardCopyTitle": "{title}のコピー",
Expand Down Expand Up @@ -1705,6 +1706,7 @@
"discover.localMenu.openTitle": "開く",
"discover.localMenu.optionsDescription": "オプション",
"discover.localMenu.saveSaveSearchDescription": "ビジュアライゼーションとダッシュボードで使用できるように Discover の検索を保存します",
"discover.localMenu.saveSaveSearchObjectType": "discover",
"discover.localMenu.saveSearchDescription": "検索を保存します",
"discover.localMenu.saveTitle": "保存",
"discover.localMenu.shareSearchDescription": "検索を共有します",
Expand Down Expand Up @@ -5145,6 +5147,7 @@
"visualize.topNavMenu.saveVisualizationButtonAriaLabel": "ビジュアライゼーションを保存",
"visualize.topNavMenu.saveVisualizationButtonLabel": "保存",
"visualize.topNavMenu.saveVisualizationDisabledButtonTooltip": "保存する前に変更を適用または破棄",
"visualize.topNavMenu.saveVisualizationObjectType": "visualize",
"visualize.topNavMenu.saveVisualizationToLibraryButtonLabel": "ライブラリに保存",
"visualize.topNavMenu.shareVisualizationButtonAriaLabel": "ビジュアライゼーションを共有",
"visualize.topNavMenu.shareVisualizationButtonLabel": "共有",
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@
"dashboard.topNav.options.syncColorsBetweenPanelsSwitchLabel": "在面板之间同步调色板",
"dashboard.topNav.options.useMarginsBetweenPanelsSwitchLabel": "在面板间使用边距",
"dashboard.topNav.saveModal.descriptionFormRowLabel": "描述",
"dashboard.topNav.saveModal.objectType": "dashboard",
"dashboard.topNav.saveModal.storeTimeWithDashboardFormRowHelpText": "每次加载此仪表板时,都会将时间筛选更改为当前选定的时间。",
"dashboard.topNav.saveModal.storeTimeWithDashboardFormRowLabel": "将时间随仪表板保存",
"dashboard.topNav.showCloneModal.dashboardCopyTitle": "{title} 副本",
Expand Down Expand Up @@ -1715,6 +1716,7 @@
"discover.localMenu.openTitle": "打开",
"discover.localMenu.optionsDescription": "选项",
"discover.localMenu.saveSaveSearchDescription": "保存您的 Discover 搜索,以便可以在可视化和仪表板中使用该搜索",
"discover.localMenu.saveSaveSearchObjectType": "discover",
"discover.localMenu.saveSearchDescription": "保存搜索",
"discover.localMenu.saveTitle": "保存",
"discover.localMenu.shareSearchDescription": "共享搜索",
Expand Down Expand Up @@ -5173,6 +5175,7 @@
"visualize.topNavMenu.saveVisualizationButtonAriaLabel": "保存可视化",
"visualize.topNavMenu.saveVisualizationButtonLabel": "保存",
"visualize.topNavMenu.saveVisualizationDisabledButtonTooltip": "保存前应用或放弃所做更改",
"visualize.topNavMenu.saveVisualizationObjectType": "visualize",
"visualize.topNavMenu.saveVisualizationToLibraryButtonLabel": "保存到库",
"visualize.topNavMenu.shareVisualizationButtonAriaLabel": "共享可视化",
"visualize.topNavMenu.shareVisualizationButtonLabel": "共享",
Expand Down

0 comments on commit da718a3

Please sign in to comment.