I18N: Remove `<code>` tags from translatable strings in `wp-includes/customize/class-wp-customize-custom-css-setting.php`.
Fixes #39898. git-svn-id: https://develop.svn.wordpress.org/trunk@40067 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
900c67ed46
commit
332244f7fb
|
@ -175,25 +175,47 @@ final class WP_Customize_Custom_CSS_Setting extends WP_Customize_Setting {
|
||||||
|
|
||||||
// Make sure that there is a closing brace for each opening brace.
|
// Make sure that there is a closing brace for each opening brace.
|
||||||
if ( ! $this->validate_balanced_characters( '{', '}', $css ) ) {
|
if ( ! $this->validate_balanced_characters( '{', '}', $css ) ) {
|
||||||
$validity->add( 'imbalanced_curly_brackets', __( 'Your curly brackets <code>{}</code> are imbalanced. Make sure there is a closing <code>}</code> for every opening <code>{</code>.' ) );
|
$validity->add( 'imbalanced_curly_brackets', sprintf(
|
||||||
|
/* translators: 1: {}, 2: }, 3: { */
|
||||||
|
__( 'Your curly brackets %1$s are imbalanced. Make sure there is a closing %2$s for every opening %3$s.' ),
|
||||||
|
'<code>{}</code>',
|
||||||
|
'<code>}</code>',
|
||||||
|
'<code>{</code>'
|
||||||
|
) );
|
||||||
$imbalanced = true;
|
$imbalanced = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure brackets are balanced.
|
// Ensure brackets are balanced.
|
||||||
if ( ! $this->validate_balanced_characters( '[', ']', $css ) ) {
|
if ( ! $this->validate_balanced_characters( '[', ']', $css ) ) {
|
||||||
$validity->add( 'imbalanced_braces', __( 'Your brackets <code>[]</code> are imbalanced. Make sure there is a closing <code>]</code> for every opening <code>[</code>.' ) );
|
$validity->add( 'imbalanced_braces', sprintf(
|
||||||
|
/* translators: 1: [], 2: ], 3: [ */
|
||||||
|
__( 'Your brackets %1$s are imbalanced. Make sure there is a closing %2$s for every opening %3$s.' ),
|
||||||
|
'<code>[]</code>',
|
||||||
|
'<code>]</code>',
|
||||||
|
'<code>[</code>'
|
||||||
|
) );
|
||||||
$imbalanced = true;
|
$imbalanced = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure parentheses are balanced.
|
// Ensure parentheses are balanced.
|
||||||
if ( ! $this->validate_balanced_characters( '(', ')', $css ) ) {
|
if ( ! $this->validate_balanced_characters( '(', ')', $css ) ) {
|
||||||
$validity->add( 'imbalanced_parentheses', __( 'Your parentheses <code>()</code> are imbalanced. Make sure there is a closing <code>)</code> for every opening <code>(</code>.' ) );
|
$validity->add( 'imbalanced_parentheses', sprintf(
|
||||||
|
/* translators: 1: (), 2: ), 3: ( */
|
||||||
|
__( 'Your parentheses %1$s are imbalanced. Make sure there is a closing %2$s for every opening %3$s.' ),
|
||||||
|
'<code>()</code>',
|
||||||
|
'<code>)</code>',
|
||||||
|
'<code>(</code>'
|
||||||
|
) );
|
||||||
$imbalanced = true;
|
$imbalanced = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure double quotes are equal.
|
// Ensure double quotes are equal.
|
||||||
if ( ! $this->validate_equal_characters( '"', $css ) ) {
|
if ( ! $this->validate_equal_characters( '"', $css ) ) {
|
||||||
$validity->add( 'unequal_double_quotes', __( 'Your double quotes <code>"</code> are uneven. Make sure there is a closing <code>"</code> for every opening <code>"</code>.' ) );
|
$validity->add( 'unequal_double_quotes', sprintf(
|
||||||
|
/* translators: %s: " */
|
||||||
|
__( 'Your double quotes %s are uneven. Make sure there is a closing %s for every opening %s.' ),
|
||||||
|
'<code>"</code>'
|
||||||
|
) );
|
||||||
$imbalanced = true;
|
$imbalanced = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,14 +231,32 @@ final class WP_Customize_Custom_CSS_Setting extends WP_Customize_Setting {
|
||||||
*/
|
*/
|
||||||
$unclosed_comment_count = $this->validate_count_unclosed_comments( $css );
|
$unclosed_comment_count = $this->validate_count_unclosed_comments( $css );
|
||||||
if ( 0 < $unclosed_comment_count ) {
|
if ( 0 < $unclosed_comment_count ) {
|
||||||
$validity->add( 'unclosed_comment', sprintf( _n( 'There is %s unclosed code comment. Close each comment with <code>*/</code>.', 'There are %s unclosed code comments. Close each comment with <code>*/</code>.', $unclosed_comment_count ), $unclosed_comment_count ) );
|
$validity->add( 'unclosed_comment', sprintf(
|
||||||
|
/* translators: 1: number of unclosed comments, 2: */ */
|
||||||
|
_n(
|
||||||
|
'There is %1$s unclosed code comment. Close each comment with %2$s.',
|
||||||
|
'There are %1$s unclosed code comments. Close each comment with %2$s.',
|
||||||
|
$unclosed_comment_count
|
||||||
|
),
|
||||||
|
$unclosed_comment_count,
|
||||||
|
'<code>*/</code>'
|
||||||
|
) );
|
||||||
$imbalanced = true;
|
$imbalanced = true;
|
||||||
} elseif ( ! $this->validate_balanced_characters( '/*', '*/', $css ) ) {
|
} elseif ( ! $this->validate_balanced_characters( '/*', '*/', $css ) ) {
|
||||||
$validity->add( 'imbalanced_comments', __( 'There is an extra <code>*/</code>, indicating an end to a comment. Be sure that there is an opening <code>/*</code> for every closing <code>*/</code>.' ) );
|
$validity->add( 'imbalanced_comments', sprintf(
|
||||||
|
/* translators: 1: */, 2: /* */
|
||||||
|
__( 'There is an extra %1$s, indicating an end to a comment. Be sure that there is an opening %2$s for every closing %1$s.' ),
|
||||||
|
'<code>*/</code>',
|
||||||
|
'<code>/*</code>'
|
||||||
|
) );
|
||||||
$imbalanced = true;
|
$imbalanced = true;
|
||||||
}
|
}
|
||||||
if ( $imbalanced && $this->is_possible_content_error( $css ) ) {
|
if ( $imbalanced && $this->is_possible_content_error( $css ) ) {
|
||||||
$validity->add( 'possible_false_positive', __( 'Imbalanced/unclosed character errors can be caused by <code>content: "";</code> declarations. You may need to remove this or add it to a custom CSS file.' ) );
|
$validity->add( 'possible_false_positive', sprintf(
|
||||||
|
/* translators: %s: content: ""; */
|
||||||
|
__( 'Imbalanced/unclosed character errors can be caused by %s declarations. You may need to remove this or add it to a custom CSS file.' ),
|
||||||
|
'<code>content: "";</code>'
|
||||||
|
) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( empty( $validity->errors ) ) {
|
if ( empty( $validity->errors ) ) {
|
||||||
|
|
Loading…
Reference in New Issue