[wp-trac] [WordPress Trac] #43632: Add a screen reader text for Hello Dolly lyrics

WordPress Trac noreply at wordpress.org
Wed Sep 19 10:46:54 UTC 2018


#43632: Add a screen reader text for Hello Dolly lyrics
---------------------------------------+----------------------------
 Reporter:  SergeyBiryukov             |       Owner:  audrasjb
     Type:  enhancement                |      Status:  assigned
 Priority:  normal                     |   Milestone:  4.9.9
Component:  Plugins                    |     Version:
 Severity:  normal                     |  Resolution:
 Keywords:  has-screenshots has-patch  |     Focuses:  accessibility
---------------------------------------+----------------------------

Comment (by birgire):

 @audrasjb  Thanks for the patch in [attachment:"43632.5.diff"]

 Few suggestions:

 I was wondering if we could move the extra space from the HTML tag, into
 the {{{$lang}}} variable?

 Also if we should use substr instead of strpos, since we are targeting the
 first three (non multibyte) chars?

 Also if we could avoid a very long echo line.

 So instead of:

 {{{
 $lang = "";
 if ( false === strpos( get_user_locale(), 'en_' ) ) {
         $lang = "lang='en'";
 }
 echo "<p id='dolly' $lang><span class='screen-reader-text'>" . __( 'Quote
 from Hello Dolly song:', 'hello-dolly' ) . " </span>$chosen</p>";

 }}}

 we might have:

 {{{
 $lang = '';
 if ( 'en_' === substr( get_user_locale(), 0, 3 ) ) {
         $lang = " lang='en'";
 }

 printf(
         "<p id='dolly'%s><span class='screen-reader-text'>%s
 </span>%s</p>",
         $lang,
         __( 'Quote from Hello Dolly song:', 'hello-dolly' ),
         $chosen
 );

 }}}

 I was also curious what are the available locales that start with
 {{{en_}}}.

 I could find these: {{{en_US, en_AU, en_CA, en_NZ, en_ZA, en_GB}}} on
 https://translate.wordpress.org.

 There seems to be ''English (Pirate)'' available too with
 {{{art_xpirate}}} ?

 See more about it here:

 https://translate.wordpress.org/locale/pirate
 https://make.wordpress.org/polyglots/2017/01/05/hi-4/

 Should it be included here?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43632#comment:31>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list