I18N: Move code out of translatable strings in a few error messages.

Follow-up to [54272], [56101].

Props rabmalin, Presskopp.
Fixes #59563.
Built from https://develop.svn.wordpress.org/trunk@57135


git-svn-id: http://core.svn.wordpress.org/trunk@56646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2023-11-25 21:19:30 +00:00
parent 55d1a62ed1
commit 25a147845b
3 changed files with 19 additions and 8 deletions

View File

@ -673,9 +673,11 @@ class WP_Duotone {
if ( null === $color ) { if ( null === $color ) {
$error_message = sprintf( $error_message = sprintf(
/* translators: %s: duotone colors */ /* translators: 1: Duotone colors, 2: theme.json, 3: settings.color.duotone */
__( '"%s" in theme.json settings.color.duotone is not a hex or rgb string.' ), __( '"%1$s" in %2$s %3$s is not a hex or rgb string.' ),
$color_str $color_str,
'theme.json',
'settings.color.duotone'
); );
_doing_it_wrong( __METHOD__, $error_message, '6.3.0' ); _doing_it_wrong( __METHOD__, $error_message, '6.3.0' );
} else { } else {
@ -900,9 +902,10 @@ class WP_Duotone {
$global_styles_presets = self::get_all_global_styles_presets(); $global_styles_presets = self::get_all_global_styles_presets();
if ( ! array_key_exists( $filter_id, $global_styles_presets ) ) { if ( ! array_key_exists( $filter_id, $global_styles_presets ) ) {
$error_message = sprintf( $error_message = sprintf(
/* translators: %s: duotone filter ID */ /* translators: 1: Duotone filter ID, 2: theme.json */
__( 'The duotone id "%s" is not registered in theme.json settings' ), __( 'The duotone id "%1$s" is not registered in %2$s settings' ),
$filter_id $filter_id,
'theme.json'
); );
_doing_it_wrong( __METHOD__, $error_message, '6.3.0' ); _doing_it_wrong( __METHOD__, $error_message, '6.3.0' );
return; return;

View File

@ -3390,7 +3390,15 @@ class WP_Theme_JSON {
|| ! is_numeric( $spacing_scale['mediumStep'] ) || ! is_numeric( $spacing_scale['mediumStep'] )
|| ( '+' !== $spacing_scale['operator'] && '*' !== $spacing_scale['operator'] ) ) { || ( '+' !== $spacing_scale['operator'] && '*' !== $spacing_scale['operator'] ) ) {
if ( ! empty( $spacing_scale ) ) { if ( ! empty( $spacing_scale ) ) {
trigger_error( __( 'Some of the theme.json settings.spacing.spacingScale values are invalid' ), E_USER_NOTICE ); trigger_error(
sprintf(
/* translators: 1: theme.json, 2: settings.spacing.spacingScale */
__( 'Some of the %1$s %2$s values are invalid' ),
'theme.json',
'settings.spacing.spacingScale'
),
E_USER_NOTICE
);
} }
return null; return null;
} }

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.5-alpha-57134'; $wp_version = '6.5-alpha-57135';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.