Accessibility: Improve the suggested image size text in the media views.

Adds `pixels` as unit, avoiding abbreviation for a clearer pronunciation by screen
readers. Also, adds the word `by` instead of the special character `times`.

Props Presskopp, stormrockwell.
Fixes #38932.


git-svn-id: https://develop.svn.wordpress.org/trunk@40573 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrea Fercia 2017-05-05 23:28:41 +00:00
parent 3f6a8f2ca8
commit f0b0147985
4 changed files with 8 additions and 4 deletions

View File

@ -4050,7 +4050,7 @@ AttachmentsBrowser = View.extend({
if ( this.options.suggestedWidth && this.options.suggestedHeight ) { if ( this.options.suggestedWidth && this.options.suggestedHeight ) {
this.toolbar.set( 'suggestedDimensions', new View({ this.toolbar.set( 'suggestedDimensions', new View({
el: $( '<div class="instructions">' + l10n.suggestedDimensions + ' ' + this.options.suggestedWidth + ' &times; ' + this.options.suggestedHeight + '</div>' )[0], el: $( '<div class="instructions">' + l10n.suggestedDimensions.replace( '%1$s', this.options.suggestedWidth ).replace( '%2$s', this.options.suggestedHeight ) + '</div>' )[0],
priority: -40 priority: -40
}) ); }) );
} }

View File

@ -319,7 +319,7 @@ AttachmentsBrowser = View.extend({
if ( this.options.suggestedWidth && this.options.suggestedHeight ) { if ( this.options.suggestedWidth && this.options.suggestedHeight ) {
this.toolbar.set( 'suggestedDimensions', new View({ this.toolbar.set( 'suggestedDimensions', new View({
el: $( '<div class="instructions">' + l10n.suggestedDimensions + ' ' + this.options.suggestedWidth + ' &times; ' + this.options.suggestedHeight + '</div>' )[0], el: $( '<div class="instructions">' + l10n.suggestedDimensions.replace( '%1$s', this.options.suggestedWidth ).replace( '%2$s', this.options.suggestedHeight ) + '</div>' )[0],
priority: -40 priority: -40
}) ); }) );
} }

View File

@ -235,7 +235,10 @@ function wp_print_media_templates() {
<# if ( data.suggestedWidth && data.suggestedHeight ) { #> <# if ( data.suggestedWidth && data.suggestedHeight ) { #>
<p class="suggested-dimensions"> <p class="suggested-dimensions">
<?php _e( 'Suggested image dimensions:' ); ?> {{data.suggestedWidth}} &times; {{data.suggestedHeight}} <?php
/* translators: 1: suggested width number, 2: suggested height number. */
printf( __( 'Suggested image dimensions: %1$s by %2$s pixels.' ), '{{data.suggestedWidth}}', '{{data.suggestedHeight}}' );
?>
</p> </p>
<# } #> <# } #>

View File

@ -3544,7 +3544,8 @@ function wp_enqueue_media( $args = array() ) {
'cropImage' => __( 'Crop Image' ), 'cropImage' => __( 'Crop Image' ),
'cropYourImage' => __( 'Crop your image' ), 'cropYourImage' => __( 'Crop your image' ),
'cropping' => __( 'Cropping&hellip;' ), 'cropping' => __( 'Cropping&hellip;' ),
'suggestedDimensions' => __( 'Suggested image dimensions:' ), /* translators: 1: suggested width number, 2: suggested height number. */
'suggestedDimensions' => __( 'Suggested image dimensions: %1$s by %2$s pixels.' ),
'cropError' => __( 'There has been an error cropping your image.' ), 'cropError' => __( 'There has been an error cropping your image.' ),
// Edit Audio // Edit Audio