Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#35675 closed defect (bug) (fixed)

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

Reported by: ramiy's profile ramiy Owned by: sergeybiryukov's profile 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 9 years ago.
35675.2.patch (2.7 KB) - added by ramiy 9 years ago.

Download all attachments as: .zip

Change History (8)

@ramiy
9 years ago

#1 @ramiy
9 years ago

  • Keywords has-patch added

@ramiy
9 years ago

#2 @ramiy
9 years ago

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

#3 @ramiy
9 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.


9 years ago

#5 @SergeyBiryukov
9 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
9 years ago

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