diff --git a/assets/js/gutenberg-plugin.js b/assets/js/gutenberg-plugin.js index 9d4849479..dd5255f29 100644 --- a/assets/js/gutenberg-plugin.js +++ b/assets/js/gutenberg-plugin.js @@ -64,7 +64,7 @@ const RenderShowAdminBar = () => { { sprintf( /* translators: 1: Post type or generic term content. */ __( 'Distribute %1$s', 'distributor' ), - dtGutenberg.postTypeSingular || + dtGutenberg.postTypeSingular.toLowerCase() || _x( 'content', 'generic term for post content', diff --git a/assets/js/gutenberg-syndicated-post.js b/assets/js/gutenberg-syndicated-post.js index aa7fb20b6..e87f974a0 100644 --- a/assets/js/gutenberg-syndicated-post.js +++ b/assets/js/gutenberg-syndicated-post.js @@ -14,49 +14,65 @@ if ( message = sprintf( /* translators: 1) Distributor post type singular name, 2) Source of content. */ __( - 'This %1$s was distributed from %2$s. However, the original has been deleted.' + 'This %1$s was distributed from %2$s. However, the origin %1$s has been deleted.' ), - dtGutenberg.postTypeSingular, + dtGutenberg.postTypeSingular.toLowerCase(), dtGutenberg.originalLocationName ); } else if ( ! parseInt( dtGutenberg.unlinked ) ) { message = sprintf( /* translators: 1) Source of content, 2) Distributor post type singular name. */ __( - 'Distributed from %1$s. This %2$s is linked to the original. Edits to the original will update this version.', + 'Distributed from %1$s. This %2$s is linked to the origin %2$s. Edits to the origin %2$s will update this remote version.', 'distributor' ), dtGutenberg.originalLocationName, - dtGutenberg.postTypeSingular + dtGutenberg.postTypeSingular.toLowerCase() ); actions.push( { - label: __( 'Unlink from original.', 'distributor' ), + label: sprintf( + /* translators: 1) Distributor post type singular name. */ + __( 'Unlink from the origin %1$s.', 'distributor' ), + dtGutenberg.postTypeSingular.toLowerCase() + ), url: dtGutenberg.unlinkNonceUrl, } ); actions.push( { - label: __( 'View Original', 'distributor' ), + label: sprintf( + /* translators: 1) Distributor post type singular name. */ + __( 'View the origin %1$s.', 'distributor' ), + dtGutenberg.postTypeSingular.toLowerCase() + ), url: dtGutenberg.postUrl, } ); } else { message = sprintf( /* translators: 1) Source of content, 2) Distributor post type singular name. */ __( - 'Originally distributed from %1$s. This %2$s has been unlinked from the original. Edits to the original will not update this version.', + 'Originally distributed from %1$s. This %2$s has been unlinked from the origin %2$s. Edits to the origin %2$s will not update this remote version.', 'distributor' ), dtGutenberg.originalLocationName, - dtGutenberg.postTypeSingular + dtGutenberg.postTypeSingular.toLowerCase() ); actions.push( { - label: __( 'Relink to original.', 'distributor' ), + label: sprintf( + /* translators: 1) Distributor post type singular name. */ + __( 'Relink to the origin %1$s.', 'distributor' ), + dtGutenberg.postTypeSingular.toLowerCase() + ), url: dtGutenberg.linkNonceUrl, } ); actions.push( { - label: __( 'View Original', 'distributor' ), + label: sprintf( + /* translators: 1) Distributor post type singular name. */ + __( 'View the origin %1$s.', 'distributor' ), + dtGutenberg.postTypeSingular.toLowerCase() + ), url: dtGutenberg.postUrl, } ); } diff --git a/includes/push-ui.php b/includes/push-ui.php index f9a04f653..5ce75b240 100644 --- a/includes/push-ui.php +++ b/includes/push-ui.php @@ -586,19 +586,25 @@ function menu_content() { labels->singular_name ) ), - '' . esc_html( $blog_name ) . '' - ) + printf( + /* translators: 1) Distributor post type singular name, 2) Source of content. */ + esc_html__( 'This %1$s was distributed from %2$s.', 'distributor' ), + esc_html( strtolower( $post_type_object->labels->singular_name ) ), + '' . esc_html( $blog_name ) . '' ); if ( ! empty( $post_url ) ) { ?> - + labels->singular_name ) ), + ) + ); + ?>
@@ -488,7 +504,7 @@ function syndicated_message( $post ) { printf( /* translators: 1) Source of content, 2) Distributor post type singular name. */ esc_html__( - 'Originally distributed from %1$s. This %2$s has been unlinked from the original. Edits to the original will not update this version.', + 'Originally distributed from %1$s. This %2$s has been unlinked from the origin %2$s. Edits to the origin %2$s will not update this remote version.', 'distributor' ), esc_html( $original_location_name ), @@ -498,8 +514,24 @@ function syndicated_message( $post ) { ?> diff --git a/tests/wpacceptance/DistributedPostTest.php b/tests/wpacceptance/DistributedPostTest.php index f93d26879..63c9896b3 100644 --- a/tests/wpacceptance/DistributedPostTest.php +++ b/tests/wpacceptance/DistributedPostTest.php @@ -75,12 +75,12 @@ public function testDistributedFrom() { // Make sure we see distributed status admin notice and that it shows as linked if ( $editor_has_blocks ) { - $I->seeText( 'Distributed from Site One. The original will update this version unless you unlink from original.View Original', '.components-notice__content' ); + $I->seeText( 'Distributed from Site One. The origin post will update this version unless you unlink from the origin post. View the origin post', '.components-notice__content' ); $element = $I->getElement( '.components-notice__action' ); - $I->seeText( 'unlink from original.', '.components-notice__action' ); + $I->seeText( 'unlink from the origin post.', '.components-notice__action' ); } else { $I->seeText( 'Distributed from', '.syndicate-status'); - $I->seeText( 'unlink from the original', '.syndicate-status' ); + $I->seeText( 'unlink from the origin post', '.syndicate-status' ); } // Now let's check in the front end diff --git a/tests/wpacceptance/LinkUnlinkTest.php b/tests/wpacceptance/LinkUnlinkTest.php index 654f59d0c..642b6b942 100644 --- a/tests/wpacceptance/LinkUnlinkTest.php +++ b/tests/wpacceptance/LinkUnlinkTest.php @@ -30,7 +30,7 @@ public function testUnlinkPublishPost() { // I see linked link if ( $editor_has_blocks ) { - $I->seeLink( 'View Original' ); + $I->seeLink( 'View the origin post' ); // Unlink post $I->click( '.components-notice__action' ); @@ -39,13 +39,13 @@ public function testUnlinkPublishPost() { sleep( 1 ); // I see unlinked text - $I->seeText( 'Originally distributed from Site One. This Post has been unlinked from the original. However, you can alwaysrestore it.View Original', '.components-notice__content' ); + $I->seeText( 'Originally distributed from Site One. This Post has been unlinked from the origin post. However, you can always restore it. View the origin post', '.components-notice__content' ); // I can interact with title field $I->canInteractWithField( '#post-title-0' ); } else { - $I->seeLink( 'unlink from the original' ); + $I->seeLink( 'unlink from the origin post' ); // I cant interact with title field $I->cannotInteractWithField( '#title' ); // Unlink post @@ -54,7 +54,7 @@ public function testUnlinkPublishPost() { $I->waitUntilElementVisible( 'body.post-php' );; // I see unlinked text - $I->seeText( 'This post has been unlinked from the original', '.syndicate-status' ); + $I->seeText( 'This post has been unlinked from the origin post', '.syndicate-status' ); // I can interact with title field $I->canInteractWithField( '#title' );