Makes convertPlural compatible (strict standards)
This commit is contained in:
parent
3fc205e18f
commit
b5a5e77543
17 changed files with 24 additions and 20 deletions
|
|
@ -1277,9 +1277,11 @@ class Language {
|
|||
* @param string $wordform1
|
||||
* @param string $wordform2
|
||||
* @param string $wordform3 (optional)
|
||||
* @param string $wordform4 (optional)
|
||||
* @param string $wordform5 (optional)
|
||||
* @return string
|
||||
*/
|
||||
function convertPlural( $count, $w1, $w2, $w3) {
|
||||
function convertPlural( $count, $w1, $w2, $w3, $w4, $w5) {
|
||||
return $count == '1' ? $w1 : $w2;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
*/
|
||||
|
||||
class LanguageBe extends Language {
|
||||
function convertPlural( $count, $wordform1, $wordform2, $wordform3) {
|
||||
function convertPlural( $count, $wordform1, $wordform2, $wordform3, $w4, $w5) {
|
||||
$count = str_replace ('.', '', $count);
|
||||
if ($count > 10 && floor(($count % 100) / 10) == 1) {
|
||||
return $wordform3;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
class LanguageBs extends Language {
|
||||
|
||||
function convertPlural( $count, $wordform1, $wordform2, $wordform3) {
|
||||
function convertPlural( $count, $wordform1, $wordform2, $wordform3, $w4, $w5) {
|
||||
$count = str_replace ('.', '', $count);
|
||||
if ($count > 10 && floor(($count % 100) / 10) == 1) {
|
||||
return $wordform3;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class LanguageCs extends Language {
|
|||
|
||||
# Plural form transformations, needed for some languages.
|
||||
# Invoked by {{plural:count|wordform1|wordform2|wordform3}}
|
||||
function convertPlural( $count, $wordform1, $wordform2, $wordform3) {
|
||||
function convertPlural( $count, $wordform1, $wordform2, $wordform3, $w4, $w5) {
|
||||
$count = str_replace( '\xc2\xa0', '', $count );
|
||||
switch ( $count ) {
|
||||
case 1:
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class LanguageCu extends Language {
|
|||
return $word;
|
||||
}
|
||||
|
||||
function convertPlural( $count, $wordform1, $wordform2, $wordform3, $wordform4) {
|
||||
function convertPlural( $count, $wordform1, $wordform2, $wordform3, $wordform4, $w5) {
|
||||
switch ($count % 10) {
|
||||
case 1: return $wordform1;
|
||||
case 2: return $wordform2;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class LanguageFr extends Language {
|
|||
/**
|
||||
* Use singular form for zero (see bug 7309)
|
||||
*/
|
||||
function convertPlural( $count, $w1, $w2, $w3) {
|
||||
function convertPlural( $count, $w1, $w2, $w3, $w4, $w5) {
|
||||
return $count <= '1' ? $w1 : $w2;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,11 +52,13 @@ class LanguageHe extends Language {
|
|||
* @param integer the number of items
|
||||
* @param string the first form (singular)
|
||||
* @param string the second form (plural)
|
||||
* @param string the third form (2 items, plural is used if not applicable and not specified)
|
||||
* @param string the third form (2 items, plural is used if not applicable and not specified
|
||||
* @param not used (for compatibility with ancestor)
|
||||
* @param not used (for compatibility with ancestor)
|
||||
*
|
||||
* @return string of the suited form of word
|
||||
*/
|
||||
public function convertPlural( $count, $w1, $w2, $w3) {
|
||||
public function convertPlural( $count, $w1, $w2, $w3, $w4, $w5) {
|
||||
if ( $count == '1' ) {
|
||||
return $w1;
|
||||
} elseif ( $count == '2' && $w3 ) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
class LanguageHr extends Language {
|
||||
function convertPlural( $count, $wordform1, $wordform2, $wordform3) {
|
||||
function convertPlural( $count, $wordform1, $wordform2, $wordform3, $w4, $w5) {
|
||||
$count = str_replace ('.', '', $count);
|
||||
if ($count > 10 && floor(($count % 100) / 10) == 1) {
|
||||
return $wordform3;
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class LanguageHsb extends Language {
|
|||
return $word; # this will return the original value for 'nominatiw' (nominativ) and all undefined case values
|
||||
}
|
||||
|
||||
function convertPlural( $count, $singular, $dual, $plural, $pluralgen ) {
|
||||
function convertPlural( $count, $singular, $dual, $plural, $pluralgen, $w5 ) {
|
||||
switch ( abs( $count ) % 100 ) {
|
||||
case 1:
|
||||
return $singular;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class LanguageKsh extends Language {
|
|||
/**
|
||||
* Handle cases of (1, other, 0) or (1, other)
|
||||
*/
|
||||
public function convertPlural( $count, $w1, $w2, $w3 ) {
|
||||
public function convertPlural( $count, $w1, $w2, $w3, $w4, $w5 ) {
|
||||
$count = str_replace (' ', '', $count);
|
||||
if ( $count == '1' ) {
|
||||
return $w1;
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ class LanguageLt extends Language {
|
|||
1 - vienas (1) lapas, dvidešimt vienas (21) lapas
|
||||
2 - trys (3) lapai
|
||||
3 - penkiolika (15) lapų
|
||||
*/
|
||||
function convertPlural( $count, $wordform1, $wordform2, $wordform3) {
|
||||
*/
|
||||
function convertPlural( $count, $wordform1, $wordform2, $wordform3, $w4, $w5) {
|
||||
if ($count%10==1 && $count%100!=11) return $wordform1;
|
||||
if ($count%10>=2 && ($count%100<10 || $count%100>=20)) return $wordform2;
|
||||
//if third form not specified, then use second form
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class LanguageLv extends Language {
|
|||
* @param string $wordform3 (not used)
|
||||
* @return string
|
||||
*/
|
||||
function convertPlural( $count, $wordform1, $wordform2, $wordform3 ) {
|
||||
function convertPlural( $count, $wordform1, $wordform2, $wordform3, $w4, $w5 ) {
|
||||
return ( ( $count % 10 == 1 ) && ( $count % 100 != 11 ) ) ? $wordform1 : $wordform2;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class LanguagePt_br extends Language {
|
|||
/**
|
||||
* Use singular form for zero (see bug 7309)
|
||||
*/
|
||||
function convertPlural( $count, $w1, $w2, $w3) {
|
||||
function convertPlural( $count, $w1, $w2, $w3, $w4, $w5) {
|
||||
return $count <= '1' ? $w1 : $w2;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class LanguageRu extends Language {
|
|||
return $word;
|
||||
}
|
||||
|
||||
function convertPlural( $count, $wordform1, $wordform2, $wordform3) {
|
||||
function convertPlural( $count, $wordform1, $wordform2, $wordform3, $w4, $w5) {
|
||||
$count = str_replace (' ', '', $count);
|
||||
if ($count > 10 && floor(($count % 100) / 10) == 1) {
|
||||
return $wordform3;
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ class LanguageSk extends Language {
|
|||
}
|
||||
return $word;
|
||||
}
|
||||
|
||||
function convertPlural( $count, $w1, $w2, $w3) {
|
||||
|
||||
function convertPlural( $count, $w1, $w2, $w3, $w4, $w5) {
|
||||
$count = str_replace ('.', '', $count);
|
||||
$forms = array( $w1, $w2, $w3);
|
||||
if ( $count == 1 ) {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#--------------------------------------------------------------------------
|
||||
|
||||
class LanguageSr_ec extends Language {
|
||||
function convertPlural( $count, $wordform1, $wordform2, $wordform3) {
|
||||
function convertPlural( $count, $wordform1, $wordform2, $wordform3, $w4, $w5) {
|
||||
$count = str_replace ('.', '', $count);
|
||||
if ($count > 10 && floor(($count % 100) / 10) == 1) {
|
||||
return $wordform3;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#--------------------------------------------------------------------------
|
||||
|
||||
class LanguageSr_el extends Language {
|
||||
function convertPlural( $count, $wordform1, $wordform2, $wordform3) {
|
||||
function convertPlural( $count, $wordform1, $wordform2, $wordform3, $w4, $w5) {
|
||||
$count = str_replace ('.', '', $count);
|
||||
if ($count > 10 && floor(($count % 100) / 10) == 1) {
|
||||
return $wordform3;
|
||||
|
|
|
|||
Loading…
Reference in a new issue