From 2652ddf3d557b207b19ec8fe5c837a31e2960762 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 26 Feb 2014 16:49:24 +0000 Subject: [PATCH] Use placeholders in strings in wp_sprintf_l() to ensure spaces are not lost in translation. props andy. fixes #26651. git-svn-id: https://develop.svn.wordpress.org/trunk@27284 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/formatting.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 8b5f3f84e6..1e8c59835d 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -3431,6 +3431,8 @@ function wp_sprintf_l($pattern, $args) { /** * Filter the translated delimiters used by wp_sprintf_l(). + * Placeholders (%s) are included to assist translators and then + * removed before the array of strings reaches the filter. * * Please note: Ampersands and entities should be avoided here. * @@ -3439,12 +3441,12 @@ function wp_sprintf_l($pattern, $args) { * @param array $delimiters An array of translated delimiters. */ $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 '), + /* translators: used to join items in a list with more than 2 items */ + 'between' => sprintf( __('%s, %s'), '', '' ), + /* translators: used to join last two items in a list with more than 2 times */ + 'between_last_two' => sprintf( __('%s, and %s'), '', '' ), + /* translators: used to join items in a list with only 2 items */ + 'between_only_two' => sprintf( __('%s and %s'), '', '' ), ) ); $args = (array) $args;