Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#36013 closed defect (bug) (fixed)

Avoid using HTML tags in translation strings (wp-admin/includes/dashboard.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 commit
Focuses: administration Cc:

Description

Old string:

  • <span>%1$s, %2$s</span> <a href="%3$s" aria-label="%5$s">%4$s</a>

New string:

  • <span>%1$s, %2$s</span> %3$s

I replaced <a href="%3$s" aria-label="%5$s">%4$s</a> with %3$s, moving the HTML out from the translation string.

(See the attached patch)

Attachments (5)

36013.patch (1.3 KB) - added by ramiy 9 years ago.
36013.2.patch (1.2 KB) - added by SergeyBiryukov 9 years ago.
36013.png (69.5 KB) - added by ramiy 9 years ago.
36013rtl.png (54.8 KB) - added by ramiy 9 years ago.
36013.3.patch (1.3 KB) - added by ramiy 9 years ago.

Download all attachments as: .zip

Change History (12)

@ramiy
9 years ago

#1 @ramiy
9 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
9 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 4.5

@ramiy I think we can move <span> tags out of the string too, see 36013.2.patch.

#3 follow-up: @ramiy
9 years ago

Nice, but this way the translator can't present the post title before the date&time.

@ramiy
9 years ago

#4 in reply to: ↑ 3 @SergeyBiryukov
9 years ago

Replying to ramiy:

Nice, but this way the translator can't present the post title before the date&time.

@ocean90, could you take a look if any locales currently do that? It's separated visually, so I don't think there are any (checked he_IL too to make sure it's not an RTL issue).

#5 @ramiy
9 years ago

@SergeyBiryukov,

You can commit your patch,

The span added display: inline-block; and min-width: 150px;.

The date is always before the post title.

@ramiy
9 years ago

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


9 years ago

@ramiy
9 years ago

#7 @SergeyBiryukov
9 years ago

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

In 36793:

I18N: Remove HTML tags from translatable string in wp-admin/includes/dashboard.php.

Props ramiy, SergeyBiryukov.
Fixes #36013.

Note: See TracTickets for help on using tickets.