#25568 closed defect (bug) (invalid)
Sprintf replacement specifiers for strings are used instead of integers
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.6 |
Component: | I18N | Keywords: | has-patch |
Focuses: | Cc: |
Description
In wp-admin/edit.php, many of the messages for bulk edit include %s as replacement specifiers for decimal strings instead of %d (ref: http://php.net/sprintf)
While this does not affect the displayed message in English, replacing them with correct replacement specifiers will help translators understand the context.
Attachments (1)
Change History (5)
#1
follow-up:
↓ 2
@
12 years ago
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
#2
in reply to:
↑ 1
@
12 years ago
Replying to johnbillion:
As an example (albeit an unlikely one), you could delete 1,000 pages and the number would show up as
1000
with your patch rather than1,000
.
printf( '%d', '1,000' )
actually truncates to 1
, even worse.
Note: See
TracTickets for help on using
tickets.
The %s replacement specifier is used for number formatting purposes. The value passed in is not necessarily an integer. This is especially important with localisation, where the translation could be a word, a number with formatting, or a non-Latin numeral.
As an example (albeit an unlikely one), you could delete 1,000 pages and the number would show up as
1000
with your patch rather than1,000
.