Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#36410 closed defect (bug) (fixed)

Misleading translators comment and bad string

Reported by: dimadin Owned by: ocean90
Priority: low Milestone: 4.5
Component: I18N Version: 4.6
Severity: normal Keywords: has-patch commit
Cc: Focuses: accessibility

Description

There is a string "View %1$s version %2$s details" that is used multiple times for aria-label attribute and where first placeholder is plugin/theme name and second is its version. This is fine.

There is also a string "View %1$s version %2$s details." (note dot at the end) that is used on Updates screen in table for plugins updates and visible to all users (easily reproducible by decreasing version of any plugin).

While this string has same translator comment as previous ("1: Plugin name 2: Plugin version"), it is not the same nor this comment is true. First placeholder is actually a tag for screen readers and is not visible, so HTML it produces is

View <span class="screen-reader-text">Akismet</span> version 3.1.10 details.

while user sees

View version 3.1.10 details.

Problem with this is that translator doesn't know that this is screen reader tag, and even if it does know, it can be hard to translate when you have limited option (tag is in placeholder, not in string). I and at least French translator had wrong assumption what is output.

I added three patches with different methods of how could this be solved (I would personally go with third; I don't see need for plugin name here), but if any output should look like this, second option with tag in a string is better, which is a point of whole ticket.

Introduced in [35866].

Attachments (5)

36410.1.patch (961 bytes ) - added by dimadin 10 years ago.
36410.2.patch (1.1 KB ) - added by dimadin 10 years ago.
36410.3.patch (1020 bytes ) - added by dimadin 10 years ago.
36410.4.patch (1.4 KB ) - added by ocean90 10 years ago.
36410.png (288.5 KB ) - added by ocean90 10 years ago.

Download all attachments as: .zip

Change History (13)

@dimadin
10 years ago

@dimadin
10 years ago

@dimadin
10 years ago

#1 @dimadin
10 years ago

Now that I've looked again, esc_attr() is not actually needed here.

#2 @kirasong
10 years ago

@ocean90 @petya Do you think this is something that should be changed, and if so, should it happen during RC?

@ocean90
10 years ago

#3 @ocean90
10 years ago

  • Keywords has-patch added
  • Milestone Awaiting Review4.5
  • Owner set to afercia
  • Priority normallow
  • Status newreviewing

36410.4.patch uses an existing aria label View %1$s version %2$s details and removes the screen reader text to restore View version %s details.. It was previously View version %1$s details. but GlotPress will match it a fuzzy.

@afercia Can you please verify 36410.4.patch?

@ocean90
10 years ago

#4 @afercia
10 years ago

  • Keywords commit added

@ocean90 looks good to me. An aria-label is even better in this case.

#5 @ocean90
10 years ago

  • Owner changed from afercia to ocean90
  • Status reviewingaccepted

Thanks @afercia!

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


10 years ago

#7 @pento
10 years ago

+1 to commit.

#8 @ocean90
10 years ago

  • Resolutionfixed
  • Status acceptedclosed

In 37162:

I18N: On the Updates screen simplify plugin's version details link.

Replace the use of a .screen-reader-text element with an aria-label attribute to make the text easier to translate.

Props dimadin, ocean90.
See #35001.
Fixes #36410.

Note: See TracTickets for help on using tickets.