diff --git a/src/wp-includes/customize/class-wp-customize-custom-css-setting.php b/src/wp-includes/customize/class-wp-customize-custom-css-setting.php index 3189ae9262..ad0c70caa1 100644 --- a/src/wp-includes/customize/class-wp-customize-custom-css-setting.php +++ b/src/wp-includes/customize/class-wp-customize-custom-css-setting.php @@ -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. if ( ! $this->validate_balanced_characters( '{', '}', $css ) ) { - $validity->add( 'imbalanced_curly_brackets', __( 'Your curly brackets {} are imbalanced. Make sure there is a closing } for every opening {.' ) ); + $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.' ), + '{}', + '}', + '{' + ) ); $imbalanced = true; } // Ensure brackets are balanced. if ( ! $this->validate_balanced_characters( '[', ']', $css ) ) { - $validity->add( 'imbalanced_braces', __( 'Your brackets [] are imbalanced. Make sure there is a closing ] for every opening [.' ) ); + $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.' ), + '[]', + ']', + '[' + ) ); $imbalanced = true; } // Ensure parentheses are balanced. if ( ! $this->validate_balanced_characters( '(', ')', $css ) ) { - $validity->add( 'imbalanced_parentheses', __( 'Your parentheses () are imbalanced. Make sure there is a closing ) for every opening (.' ) ); + $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.' ), + '()', + ')', + '(' + ) ); $imbalanced = true; } // Ensure double quotes are equal. if ( ! $this->validate_equal_characters( '"', $css ) ) { - $validity->add( 'unequal_double_quotes', __( 'Your double quotes " are uneven. Make sure there is a closing " for every opening ".' ) ); + $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.' ), + '"' + ) ); $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 ); if ( 0 < $unclosed_comment_count ) { - $validity->add( 'unclosed_comment', sprintf( _n( 'There is %s unclosed code comment. Close each comment with */.', 'There are %s unclosed code comments. Close each comment with */.', $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, + '*/' + ) ); $imbalanced = true; } elseif ( ! $this->validate_balanced_characters( '/*', '*/', $css ) ) { - $validity->add( 'imbalanced_comments', __( 'There is an extra */, indicating an end to a comment. Be sure that there is an opening /* for every closing */.' ) ); + $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.' ), + '*/', + '/*' + ) ); $imbalanced = true; } if ( $imbalanced && $this->is_possible_content_error( $css ) ) { - $validity->add( 'possible_false_positive', __( 'Imbalanced/unclosed character errors can be caused by content: ""; 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.' ), + 'content: "";' + ) ); } if ( empty( $validity->errors ) ) {