Ticket #2035: meta-2035.patch
File meta-2035.patch, 6.6 KB (added by , 8 years ago) |
---|
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-ratings-compat.php
139 139 foreach ( array( 5, 4, 3, 2, 1 ) as $rating ) { 140 140 $ratings_count = isset( $this->ratings_counts[ $rating ] ) ? $this->ratings_counts[ $rating ] : 0; 141 141 $ratings_count_total = isset( $this->ratings_counts ) ? array_sum( $this->ratings_counts) : 0; 142 $stars_title = sprintf( _n( 'Click to see reviews that provided a rating of %d star', 'Click to see reviews that provided a rating of %d stars', $rating, 'wporg-forums' ), $rating ); 143 $stars_text = sprintf( __( '%d stars', 'wporg-forums' ), $rating ); 142 $stars_title = sprintf( 143 /* translators: %s: number of stars */ 144 _n( 'Click to see reviews that provided a rating of %d star', 145 'Click to see reviews that provided a rating of %d stars', 146 $rating, 147 'wporg-forums' ), 148 $rating 149 ); 150 $stars_text = sprintf( 151 /* translators: %s: number of stars */ 152 _n( '%d star', '%d stars', $rating, 'wporg-forums' ), 153 $rating 154 ); 144 155 $width = 0; 145 156 if ( $ratings_count && $ratings_count_total ) { 146 157 $width = 92 * ( $ratings_count / $ratings_count_total ); … … 162 173 </div> 163 174 <div class="col-5"> 164 175 <div style="font-weight:bold;"><?php _e( 'Average Rating', 'wporg-forums' ); ?></div> 165 <?php echo \WPORG_Ratings::get_dashicons_stars( $this->avg_rating ); ?><?php echo sprintf( __( '%s out of <span itemprop="bestRating">5</span> stars', 'wporg-forums' ), round( isset( $this->avg_rating ) ? $this->avg_rating : 0, 1 ) ); ?> 176 <?php 177 echo \WPORG_Ratings::get_dashicons_stars( $this->avg_rating ); 178 /* translators: %s: number of stars */ 179 printf( __( '%s out of <span itemprop="bestRating">5</span> stars', 'wporg-forums' ), 180 round( isset( $this->avg_rating ) ? $this->avg_rating : 0, 1 ) 181 ); 182 ?> 166 183 <div class="reviews-submit-link"> 167 184 <?php 168 185 if ( is_user_logged_in() ) { … … 172 189 } else { 173 190 echo '<span class="reviews-need-login">'; 174 191 printf( 175 /* translators: %s: translation of verb string "log in or register"*/176 __( 'You must %sto submit a review.', 'wporg-forums' ),177 sprintf(178 ' <a href="https://login.wordpress.org/?redirect_to=%s">%s</a>',192 /* translators: %s: login URL */ 193 __( 'You must <a href="%s">log in or register</a> to submit a review.', 'wporg-forums' ), 194 add_query_arg( 195 'redirect_to', 179 196 urlencode( esc_url_raw( sprintf( 'https://wordpress.org/support/%s/%s/reviews/', $this->compat, $this->slug ) ) ), 180 esc_html_x( 'log in or register', 'verb: You must log in or register to submit a review.', 'wporg-forums' )197 'https://login.wordpress.org/' 181 198 ) 182 199 ); 183 200 echo '</span>'; … … 192 209 if ( $filter > 0 && $filter < 6 ) { 193 210 echo '<div class="col-9 reviews-filtered-msg" style="font-style:italic;margin-top:24px;">'; 194 211 printf( 195 _n( 'You are currently viewing the reviews that provided a rating of <strong>%d star</strong>. <a href="%s">Click here</a> to see all reviews.', 196 'You are currently viewing the reviews that provided a rating of <strong>%d stars</strong>. <a href="%s">Click here</a> to see all reviews.', 197 'wporg-forums' ), $filter, esc_url ( sprintf( '//wordpress.org/support/%s/%s/reviews/', $this->compat, $this->slug ) ) ); 212 /* translators: %d: number of stars */ 213 _n( 'You are currently viewing the reviews that provided a rating of <strong>%d star</strong>.', 214 'You are currently viewing the reviews that provided a rating of <strong>%d stars</strong>.', 215 $filter 216 'wporg-forums' ), 217 $filter 218 ); 219 printf( 220 /* translators: %s: plugin/theme reviews URL */ 221 __( '<a href="%s">Click here</a> to see all reviews.', 'wporg-forums' ), 222 esc_url( sprintf( '//wordpress.org/support/%s/%s/reviews/', $this->compat, $this->slug ) ) 223 ); 198 224 echo "</div>\n"; 199 225 } 200 226 ?> … … 228 254 if ( ! is_user_logged_in() ) { 229 255 echo '<p>'; 230 256 printf( 231 /* translators: %s: translation of verb string "log in or register"*/232 __( 'You must %sto submit a review.', 'wporg-forums' ),233 sprintf(234 ' <a href="https://login.wordpress.org/?redirect_to=%s">%s</a>',257 /* translators: %s: login URL */ 258 __( 'You must <a href="%s">log in or register</a> to submit a review.', 'wporg-forums' ), 259 add_query_arg( 260 'redirect_to', 235 261 urlencode( esc_url_raw( sprintf( 'https://wordpress.org/support/%s/%s/reviews/', $this->compat, $this->slug ) ) ), 236 esc_html_x( 'log in or register', 'verb: You must log in or register to submit a review.', 'wporg-forums' )262 'https://login.wordpress.org/' 237 263 ) 238 264 ); 239 265 echo '</p>'; … … 267 293 $report = $rate = ''; 268 294 switch( $this->compat ) { 269 295 case 'plugin' : 270 $report = __( 'If you are reporting an issue with this plugin, please post %s instead.', 'wporg-forums' ); 296 /* translators: %s: plugin support forum URL */ 297 $report = __( 'If you are reporting an issue with this plugin, please post <a href="%s">here</a> instead.', 'wporg-forums' ); 271 298 $rate = __( 'In order to rate a plugin, you must also submit a review.', 'wporg-forums' ); 272 299 break; 273 300 case 'theme' : 274 $report = __( 'If you are reporting an issue with this theme, please post %s instead.', 'wporg-forums' ); 301 /* translators: %s: theme support forum URL */ 302 $report = __( 'If you are reporting an issue with this theme, please post <a href="%s">here</a> instead.', 'wporg-forums' ); 275 303 $rate = __( 'In order to rate a theme, you must also submit a review.', 'wporg-forums' ); 276 304 break; 277 305 } … … 278 306 ?> 279 307 <p><?php _e( 'When posting a review, follow these guidelines:', 'wporg-forums' ); ?></p> 280 308 <ul> 281 <li><?php printf( esc_html( $report ), sprintf( '<a href="%s">%s</a>', 282 esc_url( sprintf( 'https://wordpress.org/support/%s/%s/', $this->compat, $this->slug ) ), 283 _x( 'here', 'please post here instead', 'wporg-forums' ) 284 ) ); ?></li> 309 <li><?php printf( esc_html( $report ), esc_url( sprintf( 'https://wordpress.org/support/%s/%s/', $this->compat, $this->slug ) ) ); ?></li> 285 310 <li><?php echo esc_html( $rate ); ?></li> 286 311 <li><?php esc_html_e( 'Please provide as much detail as you can to justify your rating and to help others.', 'wporg-forums' ); ?></li> 287 312 </ul>