return '';
}
- // Handle explicit 0= and 1= forms
+ // Handle explicit n=pluralform cases
foreach ( $forms as $index => $form ) {
- if ( isset( $form[1] ) && $form[1] === '=' ) {
- if ( $form[0] === (string) $count ) {
- return substr( $form, 2 );
+ if ( preg_match( '/\d+=/i', $form ) ) {
+ $pos = strpos( $form, '=' );
+ if ( substr( $form, 0, $pos ) === (string) $count ) {
+ return substr( $form, $pos + 1 );
}
unset( $forms[$index] );
}
function providePluralData() {
return array(
+ array( 'plural', 0, array(
+ 'singular', 'plural'
+ ) ),
array( 'explicit zero', 0, array(
'0=explicit zero', 'singular', 'plural'
) ),
array( 'plural', 3, array(
'0=explicit zero', '1=explicit one', 'singular', 'plural'
) ),
+ array( 'explicit elevan', 11, array(
+ 'singular', 'plural', '11=explicit elevan',
+ ) ),
+ array( 'plural', 12, array(
+ 'singular', 'plural', '11=explicit twelve',
+ ) ),
+ array( 'plural', 12, array(
+ 'singular', 'plural', '=explicit form',
+ ) ),
);
}