WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 6 months ago

#35746 closed defect (bug) (fixed)

i18n: Avoid using HTML tags in translation strings (wp-admin/users.php)

Reported by: ramiy Owned by: SergeyBiryukov
Milestone: 5.3 Priority: normal
Severity: normal Version:
Component: Users Keywords: has-patch
Focuses: administration Cc:
PR Number:

Description

See the attached patch.

Attachments (2)

35746.patch (1.0 KB) - added by ramiy 4 years ago.
35705.i18n.diff (1.4 KB) - added by ramiy 4 years ago.

Download all attachments as: .zip

Change History (18)

@ramiy
4 years ago

#1 @ramiy
4 years ago

  • Keywords has-patch added

#2 @ramiy
4 years ago

Old string:

  • New user created. <a href="%s">Edit user</a>

New strings:

  • New user created.
  • Edit user

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


4 years ago

#4 @SergeyBiryukov
4 years ago

I'd suggest leaving this one as is.

In Russian, we translate Edit user in this string differently than a regular Edit User link, to avoid unnecessary repeating user.

#5 @ocean90
4 years ago

@SergeyBiryukov Curious how you handle the strings for post updates, see trunk/src/wp-admin/edit-form-advanced.php?marks=94-162#L92.

#6 @SergeyBiryukov
4 years ago

@ocean90 In a similar way, we omit post and page in "Preview post" and "Preview page" (as those strings are not used elsewhere).

#7 follow-up: @ocean90
4 years ago

Ok, because "Edit User" is only used once for the title of user-edit.php and it has some references in the help tabs.
"Edit user" is only used in this string. So theoretically your still could omit the "user" part here.
But maybe I'm missing something. :-)

#8 in reply to: ↑ 7 ; follow-up: @SergeyBiryukov
4 years ago

Replying to ocean90:

Ok, because "Edit User" is only used once for the title of user-edit.php and it has some references in the help tabs.
"Edit user" is only used in this string. So theoretically your still could omit the "user" part here.

Yep, as long as these strings are not merged in #18218.

"Edit User" is a heading and "Edit user" here is a call to action, so they do need to be translated differently. A separate context would be fine :)

Version 1, edited 4 years ago by SergeyBiryukov (previous) (next) (diff)

#9 in reply to: ↑ 8 @ocean90
4 years ago

Replying to SergeyBiryukov:

Yep, as long as these strings are not merged in a ticket like #18218.

We wouldn't blindly merge those, but yeah, I get your point. Fine with leaving it as is.

@ramiy
4 years ago

#10 @ocean90
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Per comment:4.

#11 @SergeyBiryukov
8 months ago

#46916 was marked as a duplicate.

#12 follow-up: @SergeyBiryukov
8 months ago

  • Milestone set to 5.3
  • Resolution wontfix deleted
  • Status changed from closed to reopened

I guess we could reconsider this and add a context for the Edit user string, message link or something like that.

There are three pairs of these strings:

New user created.
New user created. <a href="%s">Edit user</a>

User has been added to your site.
User has been added to your site. <a href="%s">Edit user</a>

User added.
User added. <a href="%s">Edit user</a>

#13 @SergeyBiryukov
8 months ago

  • Owner set to SergeyBiryukov
  • Status changed from reopened to reviewing

#14 @ramiy
6 months ago

  • Summary changed from Avoid using HTML tags in translation strings (wp-admin/users.php) to i18n: Avoid using HTML tags in translation strings (wp-admin/users.php)

#15 in reply to: ↑ 12 @ramiy
6 months ago

  • Component changed from I18N to Users
  • Focuses administration added

@SergeyBiryukov, we can replace the following 6 translation strings:

New user created.
New user created. <a href="%s">Edit user</a>

User has been added to your site.
User has been added to your site. <a href="%s">Edit user</a>

User added.
User added. <a href="%s">Edit user</a>

with only 4 translation strings:

New user created.

User has been added to your site.

User added.

----

Edit user

#16 @SergeyBiryukov
6 months ago

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

In 45542:

I18N: Merge duplicate strings in notifications displayed when a new user has been created or added to the site.

Props ramiy.
Fixes #35746.

Note: See TracTickets for help on using tickets.