Skip to content

Commit

Permalink
improve wording of save modal and listing page
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 committed Oct 7, 2019
1 parent 0c001e4 commit 7a1f18d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export const SavedQueryManagementComponent: FunctionComponent<Props> = ({
aria-label={i18n.translate(
'data.search.searchBar.savedQueryPopoverSaveAsNewButtonAriaLabel',
{
defaultMessage: 'Save as a new saved query',
defaultMessage: 'Save as new saved query',
}
)}
data-test-subj="saved-query-management-save-as-new-button"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class TableListViewUi extends React.Component {
title={
<FormattedMessage
id="kbn.table_list_view.listing.deleteSelectedConfirmModal.title"
defaultMessage="Delete {itemCount} selected {entityName}?"
defaultMessage="Delete {itemCount} {entityName}?"
values={{
itemCount: this.state.selectedIds.length,
entityName: (this.state.selectedIds.length === 1) ? this.props.entityName : this.props.entityNamePlural
Expand Down Expand Up @@ -398,7 +398,7 @@ class TableListViewUi extends React.Component {
>
<FormattedMessage
id="kbn.table_list_view.listing.createNewItemButtonLabel"
defaultMessage="Create new {entityName}"
defaultMessage="Create {entityName}"
values={{ entityName: this.props.entityName }}
/>
</EuiButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,14 @@ export class SavedObjectSaveModal extends React.Component<Props, State> {
};

private renderConfirmButton = () => {
const { isLoading, title, hasTitleDuplicate } = this.state;
const { isLoading, title } = this.state;

let confirmLabel: string | React.ReactNode = hasTitleDuplicate
? i18n.translate('kibana-react.savedObjects.saveModal.confirmSaveButtonLabel', {
defaultMessage: 'Confirm save',
})
: i18n.translate('kibana-react.savedObjects.saveModal.saveButtonLabel', {
defaultMessage: 'Save',
});
let confirmLabel: string | React.ReactNode = i18n.translate(
'kibana-react.savedObjects.saveModal.saveButtonLabel',
{
defaultMessage: 'Save',
}
);

if (this.props.confirmButtonLabel) {
confirmLabel = this.props.confirmButtonLabel;
Expand Down Expand Up @@ -267,7 +266,7 @@ export class SavedObjectSaveModal extends React.Component<Props, State> {
title={
<FormattedMessage
id="kibana-react.savedObjects.saveModal.duplicateTitleLabel"
defaultMessage="A {objectType} with the title '{title}' already exists."
defaultMessage="A {objectType} with the title '{title}' already exists"
values={{ objectType: this.props.objectType, title: this.state.title }}
/>
}
Expand All @@ -277,19 +276,16 @@ export class SavedObjectSaveModal extends React.Component<Props, State> {
<p>
<FormattedMessage
id="kibana-react.savedObjects.saveModal.duplicateTitleDescription"
defaultMessage="Click {confirmSaveLabel} to save the {objectType} with the duplicate title."
defaultMessage="Clicking {confirmSaveLabel} overwrites the existing {objectType}."
values={{
objectType: this.props.objectType,
confirmSaveLabel: (
<strong>
{this.props.confirmButtonLabel
? this.props.confirmButtonLabel
: i18n.translate(
'kibana-react.savedObjects.saveModal.duplicateTitleDescription.confirmSaveText',
{
defaultMessage: 'Confirm save',
}
)}
: i18n.translate('kibana-react.savedObjects.saveModal.saveButtonLabel', {
defaultMessage: 'Save',
})}
</strong>
),
}}
Expand All @@ -315,7 +311,7 @@ export class SavedObjectSaveModal extends React.Component<Props, State> {
label={
<FormattedMessage
id="kibana-react.savedObjects.saveModal.saveAsNewLabel"
defaultMessage="Save as a new {objectType}"
defaultMessage="Save as new {objectType}"
values={{ objectType: this.props.objectType }}
/>
}
Expand Down
3 changes: 0 additions & 3 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,6 @@
"data.search.searchBar.savedQueryPopoverConfirmDeletionConfirmButtonText": "削除",
"data.search.searchBar.savedQueryPopoverConfirmDeletionTitle": "「{savedQueryName}」を削除しますか?",
"data.search.searchBar.savedQueryPopoverDeleteButtonAriaLabel": "保存されたクエリ {savedQueryName} を削除",
"data.search.searchBar.savedQueryPopoverSaveAsNewButtonAriaLabel": "新規保存クエリとして保存",
"data.search.searchBar.savedQueryPopoverSaveAsNewButtonText": "新規保存",
"data.search.searchBar.savedQueryPopoverSaveButtonAriaLabel": "新規保存クエリを保存",
"data.search.searchBar.savedQueryPopoverSaveButtonText": "現在のクエリを保存",
Expand Down Expand Up @@ -2399,10 +2398,8 @@
"kbn.server.tutorials.zookeeperMetrics.nameTitle": "Zookeeper メトリック",
"kbn.server.tutorials.zookeeperMetrics.shortDescription": "Zookeeper サーバーから内部メトリックを取得します。",
"kbn.settings.advancedSettings.voiceAnnouncement.searchResultScreenReaderMessage": "{query} を検索しました。{sectionLenght, plural, one {# セクション} other {# セクション}}に{optionLenght, plural, one {# オプション} other { # オプション}}があります。",
"kbn.table_list_view.listing.createNewItemButtonLabel": "新規 {entityName} を作成",
"kbn.table_list_view.listing.deleteButtonMessage": "{itemCount} 件の {entityName} を削除",
"kbn.table_list_view.listing.deleteConfirmModalDescription": "削除された {entityNamePlural} は復元できません。",
"kbn.table_list_view.listing.deleteSelectedConfirmModal.title": "選択された {itemCount} 件の {entityName} を削除しますか?",
"kbn.table_list_view.listing.deleteSelectedItemsConfirmModal.cancelButtonLabel": "キャンセル",
"kbn.table_list_view.listing.deleteSelectedItemsConfirmModal.confirmButtonLabel": "削除",
"kbn.table_list_view.listing.deleteSelectedItemsConfirmModal.confirmButtonLabelDeleting": "削除中",
Expand Down
3 changes: 0 additions & 3 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,6 @@
"data.search.searchBar.savedQueryPopoverConfirmDeletionConfirmButtonText": "删除",
"data.search.searchBar.savedQueryPopoverConfirmDeletionTitle": "删除“{savedQueryName}”?",
"data.search.searchBar.savedQueryPopoverDeleteButtonAriaLabel": "删除已保存查询 {savedQueryName}",
"data.search.searchBar.savedQueryPopoverSaveAsNewButtonAriaLabel": "另存为新的已保存查询",
"data.search.searchBar.savedQueryPopoverSaveAsNewButtonText": "另存为新的",
"data.search.searchBar.savedQueryPopoverSaveButtonAriaLabel": "保存新的已保存查询",
"data.search.searchBar.savedQueryPopoverSaveButtonText": "保存当前查询",
Expand Down Expand Up @@ -2400,10 +2399,8 @@
"kbn.server.tutorials.zookeeperMetrics.nameTitle": "Zookeeper 指标",
"kbn.server.tutorials.zookeeperMetrics.shortDescription": "从 Zookeeper 服务器提取内部指标。",
"kbn.settings.advancedSettings.voiceAnnouncement.searchResultScreenReaderMessage": "您已搜索 {query}。{sectionLenght, plural, one {# 个部分} other {# 个部分}}中有 {optionLenght, plural, one {# 个选项} other {# 个选项}}",
"kbn.table_list_view.listing.createNewItemButtonLabel": "创建新的{entityName}",
"kbn.table_list_view.listing.deleteButtonMessage": "删除 {itemCount} 个{entityName}",
"kbn.table_list_view.listing.deleteConfirmModalDescription": "您无法恢复删除的{entityNamePlural}。",
"kbn.table_list_view.listing.deleteSelectedConfirmModal.title": "删除 {itemCount} 个选定{entityName}?",
"kbn.table_list_view.listing.deleteSelectedItemsConfirmModal.cancelButtonLabel": "取消",
"kbn.table_list_view.listing.deleteSelectedItemsConfirmModal.confirmButtonLabel": "删除",
"kbn.table_list_view.listing.deleteSelectedItemsConfirmModal.confirmButtonLabelDeleting": "正在删除",
Expand Down

0 comments on commit 7a1f18d

Please sign in to comment.