Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/editor/src/store/test/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down Expand Up @@ -138,7 +139,7 @@ describe( 'Post actions', () => {
expect( notices ).toMatchObject( [
{
status: 'success',
content: 'Draft saved.',
content: 'Draft saved as post type label.',
},
] );
} );
Expand Down
6 changes: 4 additions & 2 deletions packages/editor/src/store/utils/notice-builder.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { __, _x } from '@wordpress/i18n';

/**
* Internal dependencies
Expand Down Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion packages/editor/src/store/utils/test/notice-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand Down
Loading