mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 15:08:10 +01:00
Use placeholders in strings in wp_sprintf_l() to ensure spaces are not lost in translation.
props andy. fixes #26651. Built from https://develop.svn.wordpress.org/trunk@27284 git-svn-id: http://core.svn.wordpress.org/trunk@27140 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1699153d26
commit
ad8c3f0f02
@ -3431,6 +3431,8 @@ function wp_sprintf_l($pattern, $args) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the translated delimiters used by wp_sprintf_l().
|
* 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.
|
* 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.
|
* @param array $delimiters An array of translated delimiters.
|
||||||
*/
|
*/
|
||||||
$l = apply_filters( 'wp_sprintf_l', array(
|
$l = apply_filters( 'wp_sprintf_l', array(
|
||||||
/* translators: used between list items, there is a space after the comma */
|
/* translators: used to join items in a list with more than 2 items */
|
||||||
'between' => __(', '),
|
'between' => sprintf( __('%s, %s'), '', '' ),
|
||||||
/* translators: used between list items, there is a space after the and */
|
/* translators: used to join last two items in a list with more than 2 times */
|
||||||
'between_last_two' => __(', and '),
|
'between_last_two' => sprintf( __('%s, and %s'), '', '' ),
|
||||||
/* translators: used between only two list items, there is a space after the and */
|
/* translators: used to join items in a list with only 2 items */
|
||||||
'between_only_two' => __(' and '),
|
'between_only_two' => sprintf( __('%s and %s'), '', '' ),
|
||||||
) );
|
) );
|
||||||
|
|
||||||
$args = (array) $args;
|
$args = (array) $args;
|
||||||
|
Loading…
Reference in New Issue
Block a user