Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#42142 closed defect (bug) (fixed)

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

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

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 9 years ago.
42142.2.diff​ (601 bytes ) - added by felipeelia 9 years ago.

Download all attachments as: .zip

Change History (10)

#1 in reply to: ↑ description @tobifjellner
9 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
9 years ago

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

#3 @swissspidy
9 years ago

  • Keywords has-patch added
  • Milestone Awaiting Review → 4.9

#4 @swissspidy
9 years ago

  • Owner set to swissspidy
  • Resolution → fixed
  • Status new → closed

In 41789:

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

Props tobifjellner.
Fixes #42142.

#5 @ocean90
9 years ago

  • Keywords needs-patch added; has-patch removed
  • Resolution fixed
  • Status closed → reopened

Let's also add the missing translators comment.

#6 @birgire
9 years ago

Related #42149

#7 @felipeelia
9 years ago

  • Keywords has-patch added; needs-patch removed

#8 @swissspidy
9 years ago

  • Resolution → fixed
  • Status reopened → 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.