diff --git a/projects/packages/blaze/changelog/fix-blaze-this-translations b/projects/packages/blaze/changelog/fix-blaze-this-translations new file mode 100644 index 0000000000000..469e5e6c2d474 --- /dev/null +++ b/projects/packages/blaze/changelog/fix-blaze-this-translations @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Blaze: Fix translations of "Blaze this %s" labels diff --git a/projects/packages/blaze/package.json b/projects/packages/blaze/package.json index 0976f95f23cb5..3813d744b783e 100644 --- a/projects/packages/blaze/package.json +++ b/projects/packages/blaze/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-blaze", - "version": "0.21.1", + "version": "0.21.2-alpha", "description": "Attract high-quality traffic to your site using Blaze. Using this service, you can advertise a post or page on some of the millions of pages across WordPress.com and Tumblr from just $5 per day.", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/blaze/#readme", "bugs": { diff --git a/projects/packages/blaze/src/class-dashboard.php b/projects/packages/blaze/src/class-dashboard.php index 1bd815708e1ad..2673adddfb3af 100644 --- a/projects/packages/blaze/src/class-dashboard.php +++ b/projects/packages/blaze/src/class-dashboard.php @@ -21,7 +21,7 @@ class Dashboard { * * @var string */ - const PACKAGE_VERSION = '0.21.1'; + const PACKAGE_VERSION = '0.21.2-alpha'; /** * List of dependencies needed to render the dashboard in wp-admin. diff --git a/projects/packages/blaze/src/js/editor.js b/projects/packages/blaze/src/js/editor.js index ba9bb3328305d..902ee32a803e1 100644 --- a/projects/packages/blaze/src/js/editor.js +++ b/projects/packages/blaze/src/js/editor.js @@ -5,7 +5,7 @@ import { useSelect } from '@wordpress/data'; import { PluginPostPublishPanel } from '@wordpress/edit-post'; import { store as editorStore } from '@wordpress/editor'; import { useCallback, useEffect } from '@wordpress/element'; -import { __, _x, sprintf } from '@wordpress/i18n'; +import { __ } from '@wordpress/i18n'; import { external, Icon } from '@wordpress/icons'; import { getPlugin, registerPlugin } from '@wordpress/plugins'; import './editor.scss'; @@ -21,17 +21,15 @@ const BlazePostPublishPanel = () => { [ tracks ] ); - const { isPostPublished, isPublishingPost, postId, postType, postTypeLabel, postVisibility } = - useSelect( selector => ( { + const { isPostPublished, isPublishingPost, postId, postType, postVisibility } = useSelect( + selector => ( { isPostPublished: selector( editorStore ).isCurrentPostPublished(), isPublishingPost: selector( editorStore ).isPublishingPost(), postId: selector( editorStore ).getCurrentPostId(), postType: selector( editorStore ).getCurrentPostType(), - postTypeLabel: - // Translators: default post type label. - selector( editorStore ).getPostTypeLabel() || _x( 'Post', 'noun', 'jetpack-blaze' ), postVisibility: selector( editorStore ).getEditedPostVisibility(), - } ) ); + } ) + ); const wasPublishing = usePrevious( isPublishingPost ); const panelBodyProps = { @@ -80,6 +78,13 @@ const BlazePostPublishPanel = () => { return null; } + const blazeThisLabel = + { + page: __( 'Blaze this page', 'jetpack-blaze' ), + post: __( 'Blaze this post', 'jetpack-blaze' ), + product: __( 'Blaze this product', 'jetpack-blaze' ), + }[ postType ] ?? __( 'Blaze this post', 'jetpack-blaze' ); + return ( @@ -98,11 +103,7 @@ const BlazePostPublishPanel = () => { onKeyDown={ trackClick } >