[wp-trac] [WordPress Trac] #47158: Merge similar strings introduced in WP 5.2

WordPress Trac noreply at wordpress.org
Mon May 6 21:30:15 UTC 2019


#47158: Merge similar strings introduced in WP 5.2
--------------------------+-----------------------------
 Reporter:  dimadin       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  I18N          |    Version:  trunk
 Severity:  normal        |   Keywords:  has-patch
  Focuses:                |
--------------------------+-----------------------------
 There are strings introduced in WordPress 5.2 that can be modified to
 reuse existing strings. No new strings are introduced with attached patch.

 ----

 {{{#!php
 PHP is the programming language we use to build and maintain WordPress.
 Newer versions of PHP are both faster and more secure, so updating will
 have a positive effect on your site’s performance.
 }}}

 and

 {{{#!php
 PHP is the programming language we use to build and maintain WordPress.
 Newer versions of PHP are both faster and more secure, so updating will
 have a positive effect on your site’s performance.
 }}}

 This is the only example where `’` is used in strings in PHP files, so I
 propose using string with HTML entity instead.

 ----

 {{{#!php
 The authenticity of %1$s could not be verified as signature verification
 is unavailable on this system.
 }}}

 and

 {{{#!php
 The authenticity of %s could not be verified as signature verification is
 unavailable on this system.
 }}}

 While in [45167] numbered placeholder was removed for second string,
 [45262] introduced first string, probably because patch was made before
 [45167] was committed.

 ----

 {{{#!php
 <?php
 /* translators: %s: number of ratings */
 echo sprintf( __( '(%s ratings) <span class="screen-reader-text">link to
 view ratings opens in a new tab</span>' ), '{{ data.num_ratings }}' );
 }}}

 and

 {{{#!php
 <?php
 printf(
         '%1$s<span class="screen-reader-text"> %2$s</span>',
         /* translators: %s: number of ratings */
         sprintf( __( '(%s ratings)' ), '{{ data.num_ratings }}' ),
         /* translators: accessibility text */
         __( '(opens in a new tab)' )
 );
 }}}

 The first string was unnecessary introduced in [44975]. There were already
 solutions for both main and accessibility texts.

 ----

 {{{#!php
 'The email could not be sent.' ) . "<br />\n" . __( 'Possible reason: your
 host may have disabled the mail() function.'
 }}}

 and

 {{{#!php
 'The email could not be sent. Possible reason: your host may have disabled
 the mail() function.'
 }}}

 In the error in the past, this message was split in two strings merged
 with `<br>` tag. [44973] introduced this message as one string. I don't
 think there is need for old case and instead I propose to always use
 message in one string.

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


More information about the wp-trac mailing list