From 37f0e1e168ebe5599ae45dff327befe578a7e2af Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 14 Jul 2021 17:28:34 -0400 Subject: [PATCH] [i18n] Fix some hardcoded translations on Dashboard & Discover (#105555) (#105632) * [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 --- .../dashboard/public/application/top_nav/save_modal.tsx | 5 ++++- .../apps/main/components/top_nav/on_save_search.tsx | 4 +++- .../public/application/utils/get_top_nav_config.tsx | 8 ++++++-- x-pack/plugins/translations/translations/ja-JP.json | 3 +++ x-pack/plugins/translations/translations/zh-CN.json | 3 +++ 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/plugins/dashboard/public/application/top_nav/save_modal.tsx b/src/plugins/dashboard/public/application/top_nav/save_modal.tsx index 79ac3917fb968..b0ed1ad0de9b6 100644 --- a/src/plugins/dashboard/public/application/top_nav/save_modal.tsx +++ b/src/plugins/dashboard/public/application/top_nav/save_modal.tsx @@ -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'; @@ -148,7 +149,9 @@ export class DashboardSaveModal extends React.Component { 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} /> diff --git a/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx index f4b969e977254..c3d1df096c32f 100644 --- a/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx @@ -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', diff --git a/src/plugins/visualize/public/application/utils/get_top_nav_config.tsx b/src/plugins/visualize/public/application/utils/get_top_nav_config.tsx index da01f9d44879b..82757e9a8e357 100644 --- a/src/plugins/visualize/public/application/utils/get_top_nav_config.tsx +++ b/src/plugins/visualize/public/application/utils/get_top_nav_config.tsx @@ -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={ @@ -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={() => {}} /> ); diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index ef13183083def..a6e643c03276a 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -674,6 +674,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}のコピー", @@ -1704,6 +1705,7 @@ "discover.localMenu.openTitle": "開く", "discover.localMenu.optionsDescription": "オプション", "discover.localMenu.saveSaveSearchDescription": "ビジュアライゼーションとダッシュボードで使用できるように Discover の検索を保存します", + "discover.localMenu.saveSaveSearchObjectType": "discover", "discover.localMenu.saveSearchDescription": "検索を保存します", "discover.localMenu.saveTitle": "保存", "discover.localMenu.shareSearchDescription": "検索を共有します", @@ -5144,6 +5146,7 @@ "visualize.topNavMenu.saveVisualizationButtonAriaLabel": "ビジュアライゼーションを保存", "visualize.topNavMenu.saveVisualizationButtonLabel": "保存", "visualize.topNavMenu.saveVisualizationDisabledButtonTooltip": "保存する前に変更を適用または破棄", + "visualize.topNavMenu.saveVisualizationObjectType": "visualize", "visualize.topNavMenu.saveVisualizationToLibraryButtonLabel": "ライブラリに保存", "visualize.topNavMenu.shareVisualizationButtonAriaLabel": "ビジュアライゼーションを共有", "visualize.topNavMenu.shareVisualizationButtonLabel": "共有", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index e00d9fa7be9d7..bd8ca2f1b6055 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -677,6 +677,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} 副本", @@ -1714,6 +1715,7 @@ "discover.localMenu.openTitle": "打开", "discover.localMenu.optionsDescription": "选项", "discover.localMenu.saveSaveSearchDescription": "保存您的 Discover 搜索,以便可以在可视化和仪表板中使用该搜索", + "discover.localMenu.saveSaveSearchObjectType": "discover", "discover.localMenu.saveSearchDescription": "保存搜索", "discover.localMenu.saveTitle": "保存", "discover.localMenu.shareSearchDescription": "共享搜索", @@ -5172,6 +5174,7 @@ "visualize.topNavMenu.saveVisualizationButtonAriaLabel": "保存可视化", "visualize.topNavMenu.saveVisualizationButtonLabel": "保存", "visualize.topNavMenu.saveVisualizationDisabledButtonTooltip": "保存前应用或放弃所做更改", + "visualize.topNavMenu.saveVisualizationObjectType": "visualize", "visualize.topNavMenu.saveVisualizationToLibraryButtonLabel": "保存到库", "visualize.topNavMenu.shareVisualizationButtonAriaLabel": "共享可视化", "visualize.topNavMenu.shareVisualizationButtonLabel": "共享",