Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#42142 closed defect (bug) (fixed)

Translatable strings in wp-db.php should use numbered arguments

Reported by: tobifjellner's profile tobifjellner Owned by: swissspidy's profile swissspidy
Milestone: 4.9 Priority: normal
Severity: normal Version: 4.9
Component: Database Keywords: has-patch
Focuses: Cc:

Description

/wp-includes/wp-db.php :1294

sprintf( __( 'The query does not contain the correct number of placeholders (%d) for the number of arguments passed (%d).' ),

In order to allow translators to make the best possible translation, numbered placeholders should be used:
sprintf( __( 'The query does not contain the correct number of placeholders (%1$d) for the number of arguments passed (%2%d).' ),

Attachments (2)

42142.diff (636 bytes) - added by swissspidy 7 years ago.
42142.2.diff (601 bytes) - added by felipeelia 7 years ago.

Download all attachments as: .zip

Change History (10)

#1 in reply to: ↑ description @tobifjellner
7 years ago

Ouch. %1$d and %2$d is probably better. :)

Replying to tobifjellner:

sprintf( __( 'The query does not contain the correct number of placeholders (%1$d) for the number of arguments passed (%2%d).' ),

#2 @Clorith
7 years ago

  • Summary changed from Use of numbered arguments needed in wp-db.php to Translatable strings in wp-db.php should use numbered arguments

@swissspidy
7 years ago

#3 @swissspidy
7 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 4.9

#4 @swissspidy
7 years ago

  • Owner set to swissspidy
  • Resolution set to fixed
  • Status changed from new to closed

In 41789:

Database: Use numbered placeholders in error message in wpdb::prepare().

Props tobifjellner.
Fixes #42142.

#5 @ocean90
7 years ago

  • Keywords needs-patch added; has-patch removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

Let's also add the missing translators comment.

#6 @birgire
7 years ago

Related #42149

@felipeelia
7 years ago

#7 @felipeelia
7 years ago

  • Keywords has-patch added; needs-patch removed

#8 @swissspidy
7 years ago

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

In 41828:

Database: Add translators comment for error message in wpdb::prepare().

Props felipeelia.
Fixes #42142.

Note: See TracTickets for help on using tickets.