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 <[email protected]>

* Fix %1$s in command palette comment translation

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

---------

Co-authored-by: MarieComet <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: huzaifaalmesbah <[email protected]>
  • Loading branch information
4 people authored and youknowriad committed Feb 20, 2024
1 parent dd97739 commit b2c5f41
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 @@ -77,9 +77,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 @@ -154,14 +154,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 @@ -178,14 +178,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

0 comments on commit b2c5f41

Please sign in to comment.