Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#47158 closed defect (bug) (fixed)

Merge similar strings introduced in WP 5.2

Reported by: dimadin's profile dimadin Owned by: desrosj's profile desrosj
Milestone: 5.2.2 Priority: normal
Severity: normal Version: 5.2
Component: I18N Keywords: has-patch fixed-major
Focuses: Cc:

Description

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 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 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.


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

and

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
/* 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
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.


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

and

'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.

Attachments (1)

47158.diff (3.1 KB) - added by dimadin 5 years ago.

Download all attachments as: .zip

Change History (13)

@dimadin
5 years ago

#1 @desrosj
5 years ago

  • Milestone changed from Awaiting Review to 5.2.1

#2 @ramiy
5 years ago

@desrosj We usually don't change translation strings in minor versions. You should change the Milestone to 5.3.0

#3 @dimadin
5 years ago

@ramiy Like I said in a ticket description, this will not introduce any new string.

#4 @desrosj
5 years ago

  • Keywords commit added

Thanks @dimadin. I reviewed and can confirm no new strings are introduced, only consolidation.

#5 @desrosj
5 years ago

  • Owner set to desrosj
  • Resolution set to fixed
  • Status changed from new to closed

In 45298:

I18N: Combine similar strings with minor differences.

Props dimadin.
Fixes #47158.

#6 follow-up: @desrosj
5 years ago

  • Keywords fixed-major added; commit removed

Reopening for backport consideration.

#7 @ramiy
5 years ago

Related: #47040

#8 @SergeyBiryukov
5 years ago

#47040 was marked as a duplicate.

#9 in reply to: ↑ 6 @SergeyBiryukov
5 years ago

  • Milestone changed from 5.2.1 to 5.2.2
  • Resolution fixed deleted
  • Status changed from closed to reopened

Replying to desrosj:

Reopening for backport consideration.

Looks like this wasn't actually reopened, moving for 5.2.2 consideration.

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


5 years ago

#11 @audrasjb
5 years ago

Hi @desrosj @SergeyBiryukov do you think we can have a backport for this ticket today so we can ship that on 5.2.2 RC1?
Thank you! The RC processing is going to start at 19:00 UTC.

#12 @desrosj
5 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 45510:

I18N: Combine similar strings with minor differences.

Merges [45298] to the 5.2 branch.

Props dimadin.
Fixes #47158.

Note: See TracTickets for help on using tickets.