Skip to content

Commit

Permalink
Make command palette string transatables (#59133)
Browse files Browse the repository at this point in the history
* Make command palette string transatables

* Apply suggestions from code review

Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com>

* Fix %1$s in command palette comment translation

* fix lint JS in use-edit-mode-command.js

---------

Co-authored-by: MarieComet <chaton666@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: huzaifaalmesbah <huzaifaalmesbah@git.wordpress.org>
  • Loading branch information
4 people authored Feb 17, 2024
1 parent b4fe3f4 commit 98e6dab
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions packages/edit-site/src/hooks/commands/use-edit-mode-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ function usePageContentFocusCommands() {
if ( currentPostType !== 'wp_template' ) {
commands.push( {
name: 'core/switch-to-template-focus',
/* translators: %1$s: template title */
label: sprintf(
'Edit template: %s',
/* translators: %s: template title */
__( 'Edit template: %s' ),
decodeEntities( template.title )
),
icon: layout,
Expand Down Expand Up @@ -119,14 +119,14 @@ function useManipulateDocumentCommands() {
if ( isTemplateRevertable( template ) && ! isEditingPage ) {
const label =
template.type === TEMPLATE_POST_TYPE
? /* translators: %1$s: template title */
sprintf(
'Reset template: %s',
? sprintf(
/* translators: %s: template title */
__( 'Reset template: %s' ),
decodeEntities( template.title )
)
: /* translators: %1$s: template part title */
sprintf(
'Reset template part: %s',
: sprintf(
/* translators: %s: template part title */
__( 'Reset template part: %s' ),
decodeEntities( template.title )
);
commands.push( {
Expand All @@ -143,14 +143,14 @@ function useManipulateDocumentCommands() {
if ( isTemplateRemovable( template ) && ! isEditingPage ) {
const label =
template.type === TEMPLATE_POST_TYPE
? /* translators: %1$s: template title */
sprintf(
'Delete template: %s',
? sprintf(
/* translators: %s: template title */
__( 'Delete template: %s' ),
decodeEntities( template.title )
)
: /* translators: %1$s: template part title */
sprintf(
'Delete template part: %s',
: sprintf(
/* translators: %s: template part title */
__( 'Delete template part: %s' ),
decodeEntities( template.title )
);
const path =
Expand Down

1 comment on commit 98e6dab

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 98e6dab.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7942377654
📝 Reported issues:

Please sign in to comment.