Opened 13 years ago
Closed 13 years ago
#26651 closed enhancement (fixed)
Outer spaces in wp_sprintf_l() strings are easily lost in translation
| Reported by: | andy | Owned by: | nacin |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.9 |
| Component: | I18N | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
wp_sprintf_l() uses the following strings:
$l = apply_filters( 'wp_sprintf_l', array(
/* translators: used between list items, there is a space after the comma */
'between' => __(', '),
/* translators: used between list items, there is a space after the and */
'between_last_two' => __(', and '),
/* translators: used between only two list items, there is a space after the and */
'between_only_two' => __(' and '),
) );
The leading and trailing spaces are frequently omitted by translators despite the translator comments.
Elsewhere, nbachiyski suggests using placeholders (%s) to assist translators.
The attached patch does just that, and then strips the placeholders before passing the array of strings through the filter.
Attachments (2)
Change History (7)
#2
follow-up:
↓ 3
@
13 years ago
Should we also perhaps consider using the _x() function rather than __() so the 'context' information is passed into the POT file?
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Add temporary placeholders to preserve whitespace in translated strings