Source
File: wp-includes/formatting.php
function wp_sprintf_l( $pattern, $args ) {
if ( '%l' !== substr( $pattern, 0, 2 ) ) {
return $pattern;
}
if ( empty( $args ) ) {
return '';
}
$l = apply_filters(
'wp_sprintf_l',
array(
'between' => sprintf( __( '%1$s, %2$s' ), '', '' ),
'between_last_two' => sprintf( __( '%1$s, and %2$s' ), '', '' ),
'between_only_two' => sprintf( __( '%1$s and %2$s' ), '', '' ),
)
);
$args = (array) $args;
$result = array_shift( $args );
if ( count( $args ) == 1 ) {
$result .= $l['between_only_two'] . array_shift( $args );
}
$i = count( $args );
while ( $i ) {
$arg = array_shift( $args );
$i--;
if ( 0 == $i ) {
$result .= $l['between_last_two'] . $arg;
} else {
$result .= $l['between'] . $arg;
}
}
return $result . substr( $pattern, 2 );
}