Opened 12 years ago
Closed 12 years ago
#26651 closed enhancement (fixed)
Outer spaces in wp_sprintf_l() strings are easily lost in translation
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 3.9 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | I18N | Keywords: | |
| Focuses: | Cc: |
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
@
12 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.
Add temporary placeholders to preserve whitespace in translated strings