[wp-trac] [WordPress Trac] #44340: Use sprintf() to remove <strong> tags from translating strings (was: Make use of sprintf function while translating strings)

WordPress Trac noreply at wordpress.org
Tue Jun 7 20:48:42 UTC 2022


#44340: Use sprintf() to remove <strong> tags from translating strings
-------------------------+-------------------------------
 Reporter:  saimonh      |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  I18N         |     Version:  4.9.6
 Severity:  normal       |  Resolution:
 Keywords:  close        |     Focuses:  coding-standards
-------------------------+-------------------------------
Changes (by hellofromTonya):

 * keywords:  has-patch close => close
 * type:  defect (bug) => enhancement
 * component:  Users => I18N


Old description:

> This is not a bug rather it's an improvement. In the wp-includes/user.php
> file, there are some <strong> tag has which has been used inside the
> translated __() function.
>
> So it's better to make use of sprintf function here than hard-coding the
> <strong> tag.
>
> Screenshot: https://d.pr/free/i/qbHq2z
>
> Regards

New description:

 In the `wp-includes/user.php` file (and others), there are some `<strong>`
 tag has which has been used inside the translated `__()` function.

 So it's better to make use of sprintf function here than hard-coding the
 `<strong>` tag.

 Screenshot: https://d.pr/free/i/qbHq2z

 Regards

--

Comment:

 Hello @saimonh,

 Welcome and thank you for the ticket and patch!

 I'm popping in to do a little ticket triage to raise visibility.

 First, I updated the ticket to be a more general request across Core.

 Why? The usage of `<strong>Error</strong>` is a common pattern that exists
 not only in the `wp-includes/user.php` file but also in the login,
 comments, options, and more. By making this a general request, it targets
 the I18N component maintainers and contributors for their feedback.

 Second, I removed the `has-patch` keyword.

 Why? Recently this pattern was slightly updated to move the `:` within the
 `strong` tags for better consistency: see #50785 / [53458] and [53476].
 These changes will no longer apply cleanly to the proposed patch.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44340#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list