[wp-trac] [WordPress Trac] #55840: Internationalization support for sizes added by 'edit_custom_thumbnail_sizes' filter

WordPress Trac noreply at wordpress.org
Thu May 26 08:33:48 UTC 2022


#55840: Internationalization support for sizes added by
'edit_custom_thumbnail_sizes' filter
-----------------------------+-----------------------------
 Reporter:  tmatsuur         |      Owner:  (none)
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Media            |    Version:  6.0
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 The image size labels added by the edit_custom_thumbnail_sizes filter are
 not internationalized.

 {{{
 <label for="imgedit-target-custom<?php echo esc_attr( $key ); ?>"><?php
 echo esc_html( $size ); ?></label>
 }}}

 In a Japanese environment, there will be a mixture of translated and
 untranslated text.

 To solve this problem, the following size of translated text is prepared
 before the loop process.

 {{{
 $size_names = array(
         'thumbnail'    => __( 'Thumbnail' ),
         'medium'       => __( 'Medium' ),
         'medium_large' => __( 'Medium Large' ),
         'large'        => __( 'Large' ),
         'full'         => __( 'Full Size' ),
 );
 }}}

 Change the following where labels are output.

 {{{
 <label for="imgedit-target-custom<?php echo esc_attr( $key ); ?>"><?php
 echo esc_html( isset( $size_names[$size] )? $size_names[$size] : $size );
 ?></label>
 }}}

 Since image size labels are also used in the "image_size_input_fields"
 function, etc., it may be better to make them a function rather than an
 array.

 In addition, the translated text for "Medium-Large size image height" and
 "Medium-Large size image width" exists, but the translated text for
 "Medium Large (or Medium-Large)" does not.

 If you are conscious of word commonality, "Medium-Large" may be better
 than "Medium Large".

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55840>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list