From 332244f7fb51351143090d516e4f90b19ee3c39f Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 17 Feb 2017 02:22:40 +0000 Subject: [PATCH] I18N: Remove `` 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 --- .../class-wp-customize-custom-css-setting.php | 54 ++++++++++++++++--- 1 file changed, 47 insertions(+), 7 deletions(-) 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 ) ) {