WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#35675 closed defect (bug) (fixed)

Avoid using HTML tags in translation strings (wp-admin/custom-header.php)

Reported by: ramiy Owned by: SergeyBiryukov
Milestone: 4.5 Priority: normal
Severity: normal Version:
Component: I18N Keywords: has-patch
Focuses: Cc:

Description

See the attached patch.

  • remove the <strong> tag from the string.
  • add translators comments.
  • split into smaller strings.
  • use %s and %d instead of %1$d.

Generally, this patch creates 3 simpler strings without HTML tags, from 2 strings with HTML tags.

Attachments (2)

35675.patch (1.4 KB) - added by ramiy 5 years ago.
35675.2.patch (2.7 KB) - added by ramiy 5 years ago.

Download all attachments as: .zip

Change History (8)

@ramiy
5 years ago

#1 @ramiy
5 years ago

  • Keywords has-patch added

@ramiy
5 years ago

#2 @ramiy
5 years ago

Found two more strings! See the second patch. Same principle.

#3 @ramiy
5 years ago

Old strings:

  • Images should be at least <strong>%1$d pixels</strong> wide.
  • Images should be at least <strong>%1$d pixels</strong> tall.
  • Suggested width is <strong>%1$d pixels</strong>.
  • Suggested height is <strong>%1$d pixels</strong>.

New strings:

  • Images should be at least %s wide.
  • Images should be at least %s tall.
  • Suggested width is %s.
  • Suggested height is %s.
  • %d pixels

As you can see the new string has no HTML tags, and they are easier to translate.

This ticket was mentioned in Slack in #core-i18n by ramiy. View the logs.


5 years ago

#5 @SergeyBiryukov
5 years ago

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

In 36658:

I18N: Remove <strong> tags from translatable strings in wp-admin/custom-header.php.

Add translator comments.

Props ramiy.
Fixes #35675.

#6 @SergeyBiryukov
5 years ago

  • Milestone changed from Awaiting Review to 4.5
Note: See TracTickets for help on using tickets.