Skip to content

Commit 86a3bc9

Browse files
Misc i18n fixes (#66510)
Co-authored-by: swissspidy <[email protected]> Co-authored-by: peterwilsoncc <[email protected]>
1 parent 7751045 commit 86a3bc9

File tree

71 files changed

+193
-165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+193
-165
lines changed

packages/block-directory/src/components/downloadable-block-list-item/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,28 @@ function getDownloadableBlockLabel(
3434
const stars = Math.round( rating / 0.5 ) * 0.5;
3535

3636
if ( ! isInstalled && hasNotice ) {
37-
/* translators: %1$s: block title */
37+
/* translators: %s: block title */
3838
return sprintf( 'Retry installing %s.', decodeEntities( title ) );
3939
}
4040

4141
if ( isInstalled ) {
42-
/* translators: %1$s: block title */
42+
/* translators: %s: block title */
4343
return sprintf( 'Add %s.', decodeEntities( title ) );
4444
}
4545

4646
if ( isInstalling ) {
47-
/* translators: %1$s: block title */
47+
/* translators: %s: block title */
4848
return sprintf( 'Installing %s.', decodeEntities( title ) );
4949
}
5050

5151
// No ratings yet, just use the title.
5252
if ( ratingCount < 1 ) {
53-
/* translators: %1$s: block title */
53+
/* translators: %s: block title */
5454
return sprintf( 'Install %s.', decodeEntities( title ) );
5555
}
5656

5757
return sprintf(
58-
/* translators: %1$s: block title, %2$s: average rating, %3$s: total ratings count. */
58+
/* translators: 1: block title, 2: average rating, 3: total ratings count. */
5959
_n(
6060
'Install %1$s. %2$s stars with %3$s review.',
6161
'Install %1$s. %2$s stars with %3$s reviews.',
@@ -131,7 +131,7 @@ function DownloadableBlockListItem( { item, onClick } ) {
131131
<span className="block-directory-downloadable-block-list-item__title">
132132
{ createInterpolateElement(
133133
sprintf(
134-
/* translators: %1$s: block title, %2$s: author name. */
134+
/* translators: 1: block title. 2: author name. */
135135
__( '%1$s <span>by %2$s</span>' ),
136136
decodeEntities( title ),
137137
author

packages/block-editor/src/components/block-card/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
__experimentalVStack as VStack,
1414
} from '@wordpress/components';
1515
import { chevronLeft, chevronRight } from '@wordpress/icons';
16-
import { __, isRTL, sprintf } from '@wordpress/i18n';
16+
import { __, _x, isRTL, sprintf } from '@wordpress/i18n';
1717
import { useSelect, useDispatch } from '@wordpress/data';
1818

1919
/**
@@ -68,8 +68,8 @@ function BlockCard( { title, icon, description, blockType, className, name } ) {
6868
<h2 className="block-editor-block-card__title">
6969
{ name?.length
7070
? sprintf(
71-
// translators: %1$s: Custom block name. %2$s: Block title.
72-
__( '%1$s (%2$s)' ),
71+
// translators: 1: Custom block name. 2: Block title.
72+
_x( '%1$s (%2$s)', 'block label' ),
7373
name,
7474
title
7575
)

packages/block-editor/src/components/block-patterns-paging/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default function Pagination( {
6262
</HStack>
6363
<Text variant="muted">
6464
{ sprintf(
65-
// translators: %1$s: Current page number, %2$s: Total number of pages.
65+
// translators: 1: Current page number. 2: Total number of pages.
6666
_x( '%1$s of %2$s', 'paging' ),
6767
currentPage,
6868
numPages

packages/block-editor/src/components/block-variation-transforms/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function VariationsButtons( {
4545
selectedValue === variation.name
4646
? variation.title
4747
: sprintf(
48-
/* translators: %s: Name of the block variation */
48+
/* translators: %s: Block or block variation name. */
4949
__( 'Transform to %s' ),
5050
variation.title
5151
)
@@ -127,7 +127,7 @@ function VariationsToggleGroupControl( {
127127
selectedValue === variation.name
128128
? variation.title
129129
: sprintf(
130-
/* translators: %s: Name of the block variation */
130+
/* translators: %s: Block or block variation name. */
131131
__( 'Transform to %s' ),
132132
variation.title
133133
)

packages/block-editor/src/components/inserter-button/index.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class MenuItem extends Component {
5454
const accessibilityLabelFormat = blockIsNew
5555
? // translators: Newly available block name. %s: The localized block name
5656
__( '%s block, newly available' )
57-
: // translators: Block name. %s: The localized block name
57+
: // translators: %s: Block name e.g. "Image block"
5858
__( '%s block' );
5959
const accessibilityLabel = sprintf(
6060
accessibilityLabelFormat,

packages/block-editor/src/components/spacing-sizes-control/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
__experimentalVStack as VStack,
88
} from '@wordpress/components';
99
import { useState } from '@wordpress/element';
10-
import { __, sprintf } from '@wordpress/i18n';
10+
import { _x, sprintf } from '@wordpress/i18n';
1111

1212
/**
1313
* Internal dependencies
@@ -89,8 +89,8 @@ export default function SpacingSizesControl( {
8989
ALL_SIDES.includes( view ) && showSideInLabel ? LABELS[ view ] : '';
9090

9191
const label = sprintf(
92-
// translators: 2. Type of spacing being modified (Padding, margin, etc). 1: The side of the block being modified (top, bottom, left etc.).
93-
__( '%1$s %2$s' ),
92+
// translators: 1: The side of the block being modified (top, bottom, left etc.). 2. Type of spacing being modified (padding, margin, etc).
93+
_x( '%1$s %2$s', 'spacing' ),
9494
labelProp,
9595
sideLabel
9696
).trim();

packages/block-editor/src/components/spacing-sizes-control/input-controls/spacing-input-control.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
import { useSelect } from '@wordpress/data';
1515
import { useState, useMemo } from '@wordpress/element';
1616
import { usePrevious } from '@wordpress/compose';
17-
import { __, sprintf } from '@wordpress/i18n';
17+
import { __, _x, sprintf } from '@wordpress/i18n';
1818
import { settings } from '@wordpress/icons';
1919

2020
/**
@@ -124,7 +124,7 @@ export default function SpacingInputControl( {
124124
...spacingSizes,
125125
{
126126
name: ! isMixed
127-
? // translators: A custom measurement, eg. a number followed by a unit like 12px.
127+
? // translators: %s: A custom measurement, e.g. a number followed by a unit like 12px.
128128
sprintf( __( 'Custom (%s)' ), value )
129129
: __( 'Mixed' ),
130130
slug: 'custom',
@@ -200,8 +200,8 @@ export default function SpacingInputControl( {
200200
const typeLabel = showSideInLabel ? type?.toLowerCase() : type;
201201

202202
const ariaLabel = sprintf(
203-
// translators: 1: The side of the block being modified (top, bottom, left, All sides etc.). 2. Type of spacing being modified (Padding, margin, etc)
204-
__( '%1$s %2$s' ),
203+
// translators: 1: The side of the block being modified (top, bottom, left etc.). 2. Type of spacing being modified (padding, margin, etc).
204+
_x( '%1$s %2$s', 'spacing' ),
205205
sideLabel,
206206
typeLabel
207207
).trim();

packages/block-editor/src/components/url-input/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class URLInput extends Component {
196196
if ( !! suggestions.length ) {
197197
this.props.debouncedSpeak(
198198
sprintf(
199-
/* translators: %s: number of results. */
199+
/* translators: %d: number of results. */
200200
_n(
201201
'%d result found, use up and down arrow keys to navigate.',
202202
'%d results found, use up and down arrow keys to navigate.',

packages/block-editor/src/components/use-block-commands/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export const useTransformCommands = () => {
113113
const { name, title, icon } = transformation;
114114
return {
115115
name: 'core/block-editor/transform-to-' + name.replace( '/', '-' ),
116-
// translators: %s: block title/name.
116+
/* translators: %s: Block or block variation name. */
117117
label: sprintf( __( 'Transform to %s' ), title ),
118118
icon: <BlockIcon icon={ icon } />,
119119
callback: ( { close } ) => {

packages/block-editor/src/utils/get-font-styles-and-weights.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* WordPress dependencies
33
*/
4-
import { _x, __, sprintf } from '@wordpress/i18n';
4+
import { _x, sprintf } from '@wordpress/i18n';
55

66
/**
77
* Internal dependencies
@@ -173,7 +173,7 @@ export function getFontStylesAndWeights( fontFamilyFaces ) {
173173
? weightName
174174
: sprintf(
175175
/* translators: 1: Font weight name. 2: Font style name. */
176-
__( '%1$s %2$s' ),
176+
_x( '%1$s %2$s', 'font' ),
177177
weightName,
178178
styleName
179179
);

0 commit comments

Comments
 (0)