diff --git a/packages/editor/src/store/test/actions.js b/packages/editor/src/store/test/actions.js index 206c60a159d04f..1de48094ca8952 100644 --- a/packages/editor/src/store/test/actions.js +++ b/packages/editor/src/store/test/actions.js @@ -30,6 +30,7 @@ const postTypeEntity = { slug: 'post', rest_base: 'posts', labels: { + item_drafted: 'Draft saved as post type label.', item_updated: 'Updated Post', item_published: 'Post published', item_reverted_to_draft: 'Post reverted to draft.', @@ -138,7 +139,7 @@ describe( 'Post actions', () => { expect( notices ).toMatchObject( [ { status: 'success', - content: 'Draft saved.', + content: 'Draft saved as post type label.', }, ] ); } ); diff --git a/packages/editor/src/store/utils/notice-builder.js b/packages/editor/src/store/utils/notice-builder.js index 92e68f4f8bdb3d..5d3658c6ff8a6b 100644 --- a/packages/editor/src/store/utils/notice-builder.js +++ b/packages/editor/src/store/utils/notice-builder.js @@ -1,7 +1,7 @@ /** * WordPress dependencies */ -import { __ } from '@wordpress/i18n'; +import { __, _x } from '@wordpress/i18n'; /** * Internal dependencies @@ -43,7 +43,9 @@ export function getNotificationArgumentsForSaveSuccess( data ) { shouldShowLink = false; } else if ( ! isPublished && ! willPublish ) { // If saving a non-published post, don't show notice. - noticeMessage = __( 'Draft saved.' ); + noticeMessage = + postType.labels.item_drafted || + _x( 'Draft saved.', 'post saved in draft status' ); isDraft = true; } else if ( isPublished && ! willPublish ) { // If undoing publish status, show specific notice. diff --git a/packages/editor/src/store/utils/test/notice-builder.js b/packages/editor/src/store/utils/test/notice-builder.js index dddbd0c18222e5..4ac09c91bd581f 100644 --- a/packages/editor/src/store/utils/test/notice-builder.js +++ b/packages/editor/src/store/utils/test/notice-builder.js @@ -10,6 +10,7 @@ import { describe( 'getNotificationArgumentsForSaveSuccess()', () => { const postType = { labels: { + item_drafted: 'drafted', item_reverted_to_draft: 'draft', item_published: 'publish', item_published_privately: 'private', @@ -34,7 +35,7 @@ describe( 'getNotificationArgumentsForSaveSuccess()', () => { [ 'when previous post is not published and post will not be published', [ 'draft', 'draft', false ], - [ 'Draft saved.', defaultExpectedAction ], + [ 'drafted', defaultExpectedAction ], ], [ 'when previous post is published and post will be unpublished',