Remove convertPlural methods already served by CLDR plural system
authorSanthosh Thottingal <santhosh.thottingal@gmail.com>
Thu, 12 Sep 2013 04:39:15 +0000 (21:39 -0700)
committerSanthosh Thottingal <santhosh.thottingal@gmail.com>
Thu, 12 Sep 2013 04:46:34 +0000 (21:46 -0700)
There are some more language classes with convertPlural methods,
but they need some careful removal.

Change-Id: Idbcb397f750fb463608de4396018dadb6fccc9a7

languages/classes/LanguageCu.php
languages/classes/LanguageHi.php [deleted file]
languages/classes/LanguageMg.php [deleted file]
languages/classes/LanguageMt.php [deleted file]
languages/classes/LanguagePl.php
languages/classes/LanguageSh.php [deleted file]
languages/classes/LanguageSk.php [deleted file]
languages/classes/LanguageTi.php [deleted file]
languages/classes/LanguageTl.php [deleted file]
languages/classes/LanguageWa.php

index 454ce34..60cf2b1 100644 (file)
@@ -63,24 +63,4 @@ class LanguageCu extends Language {
                }
                return $word;
        }
-
-       /**
-        * @param $count int
-        * @param $forms array
-        * @return string
-        */
-       function convertPlural( $count, $forms ) {
-               if ( !count( $forms ) ) {
-                       return '';
-               }
-               $forms = $this->preConvertPlural( $forms, 4 );
-
-               switch ( $count % 10 ) {
-                       case 1: return $forms[0];
-                       case 2: return $forms[1];
-                       case 3:
-                       case 4: return $forms[2];
-                       default: return $forms[3];
-               }
-       }
 }
diff --git a/languages/classes/LanguageHi.php b/languages/classes/LanguageHi.php
deleted file mode 100644 (file)
index 6f7edb4..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-/**
- * Hindi (हिन्दी) specific code.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Language
- */
-
-/**
- * Hindi (हिन्दी)
- *
- * @ingroup Language
- */
-class LanguageHi extends Language {
-       /**
-        * Use singular form for zero
-        *
-        * @param $count int
-        * @param $forms array
-        *
-        * @return string
-        */
-       function convertPlural( $count, $forms ) {
-               if ( !count( $forms ) ) {
-                       return '';
-               }
-               $forms = $this->preConvertPlural( $forms, 2 );
-
-               return ( $count <= 1 ) ? $forms[0] : $forms[1];
-       }
-}
diff --git a/languages/classes/LanguageMg.php b/languages/classes/LanguageMg.php
deleted file mode 100644 (file)
index bf6800c..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-/**
- * Malagasy (Malagasy) specific code.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Language
- */
-
-/**
- * Malagasy (Malagasy)
- *
- * @ingroup Language
- */
-class LanguageMg extends Language {
-       /**
-        * Use singular form for zero
-        *
-        * @param $count int
-        * @param $forms array
-        *
-        * @return string
-        */
-       function convertPlural( $count, $forms ) {
-               if ( !count( $forms ) ) {
-                       return '';
-               }
-               $forms = $this->preConvertPlural( $forms, 2 );
-
-               return ( $count <= 1 ) ? $forms[0] : $forms[1];
-       }
-}
diff --git a/languages/classes/LanguageMt.php b/languages/classes/LanguageMt.php
deleted file mode 100644 (file)
index 20213a8..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-/**
- * Maltese (Malti) specific code.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @author Niklas Laxström
- * @ingroup Language
- */
-
-/**
- * Maltese (Malti)
- *
- * @ingroup Language
- */
-class LanguageMt extends Language {
-
-       /**
-        * @param $count int
-        * @param $forms array
-        * @return string
-        */
-       function convertPlural( $count, $forms ) {
-               if ( !count( $forms ) ) {
-                       return '';
-               }
-
-               $forms = $this->preConvertPlural( $forms, 4 );
-
-               if ( $count == 1 ) {
-                       $index = 0;
-               } elseif ( $count == 0 || ( $count % 100 > 1 && $count % 100 < 11 ) ) {
-                       $index = 1;
-               } elseif ( $count % 100 > 10 && $count % 100 < 20 ) {
-                       $index = 2;
-               } else {
-                       $index = 3;
-               }
-               return $forms[$index];
-       }
-}
index e15c9e2..8e286c9 100644 (file)
  * @ingroup Language
  */
 class LanguagePl extends Language {
-
-       /**
-        * @param $count string
-        * @param $forms array
-        * @return string
-        */
-       function convertPlural( $count, $forms ) {
-               if ( !count( $forms ) ) {
-                       return '';
-               }
-               $forms = $this->preConvertPlural( $forms, 3 );
-               $count = abs( $count );
-               if ( $count == 1 ) {
-                       return $forms[0]; // singular
-               }
-               switch ( $count % 10 ) {
-                       case 2:
-                       case 3:
-                       case 4:
-                               if ( $count / 10 % 10 != 1 ) {
-                                       return $forms[1]; // plural
-                               }
-                       default:
-                               return $forms[2];   // plural genitive
-               }
-       }
-
        /**
         * @param $_ string
         * @return string
diff --git a/languages/classes/LanguageSh.php b/languages/classes/LanguageSh.php
deleted file mode 100644 (file)
index 83c42cc..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<?php
-/**
- * Serbo-Croatian (Srpskohrvatski / Српскохрватски) specific code.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Language
- */
-
-/**
- * Serbo-Croatian (Srpskohrvatski / Српскохрватски)
- *
- * @ingroup Language
- */
-class LanguageSh extends Language {
-
-       /**
-        * @param $count string
-        * @param $forms array
-        * @return string
-        */
-       function convertPlural( $count, $forms ) {
-               if ( !count( $forms ) ) {
-                       return '';
-               }
-
-               // if no number with word, then use $form[0] for singular and $form[1] for plural or zero
-               if ( count( $forms ) === 2 ) {
-                       return $count == 1 ? $forms[0] : $forms[1];
-               }
-
-               // @todo FIXME: CLDR defines 4 plural forms. Form with decimals missing.
-               // See http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#sh
-               $forms = $this->preConvertPlural( $forms, 3 );
-
-               if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) {
-                       return $forms[2];
-               } else {
-                       switch ( $count % 10 ) {
-                               case 1: return $forms[0];
-                               case 2:
-                               case 3:
-                               case 4: return $forms[1];
-                               default: return $forms[2];
-                       }
-               }
-       }
-}
diff --git a/languages/classes/LanguageSk.php b/languages/classes/LanguageSk.php
deleted file mode 100644 (file)
index cd15f18..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-/**
- * Slovak (Slovenčina) specific code.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Language
- */
-
-/**
- * Slovak (Slovenčina)
- *
- * @ingroup Language
- */
-class LanguageSk extends Language {
-
-       /**
-        * @param $count int
-        * @param $forms array
-        * @return string
-        */
-       function convertPlural( $count, $forms ) {
-               if ( !count( $forms ) ) {
-                       return '';
-               }
-               $forms = $this->preConvertPlural( $forms, 3 );
-
-               if ( $count == 1 ) {
-                       $index = 0;
-               } elseif ( $count == 2 || $count == 3 || $count == 4 ) {
-                       $index = 1;
-               } else {
-                       $index = 2;
-               }
-               return $forms[$index];
-       }
-}
diff --git a/languages/classes/LanguageTi.php b/languages/classes/LanguageTi.php
deleted file mode 100644 (file)
index f17b4d1..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-/**
- * Tigrinya (ትግርኛ) specific code.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Language
- */
-
-/**
- * Tigrinya (ትግርኛ)
- *
- * @ingroup Language
- */
-class LanguageTi extends Language {
-       /**
-        * Use singular form for zero
-        *
-        * @param $count int
-        * @param $forms array
-        *
-        * @return string
-        */
-       function convertPlural( $count, $forms ) {
-               if ( !count( $forms ) ) {
-                       return '';
-               }
-               $forms = $this->preConvertPlural( $forms, 2 );
-
-               return ( $count <= 1 ) ? $forms[0] : $forms[1];
-       }
-}
diff --git a/languages/classes/LanguageTl.php b/languages/classes/LanguageTl.php
deleted file mode 100644 (file)
index 060d1e2..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-/**
- * Tagalog (Tagalog) specific code.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Language
- */
-
-/**
- * Tagalog (Tagalog)
- *
- * @ingroup Language
- */
-class LanguageTl extends Language {
-       /**
-        * Use singular form for zero
-        *
-        * @param $count int
-        * @param $forms array
-        *
-        * @return string
-        */
-       function convertPlural( $count, $forms ) {
-               if ( !count( $forms ) ) {
-                       return '';
-               }
-               $forms = $this->preConvertPlural( $forms, 2 );
-
-               return ( $count <= 1 ) ? $forms[0] : $forms[1];
-       }
-}
index fde8c53..e5f7438 100644 (file)
  * @ingroup Language
  */
 class LanguageWa extends Language {
-       /**
-        * Use singular form for zero
-        *
-        * @param $count int
-        * @param $forms array
-        *
-        * @return string
-        */
-       function convertPlural( $count, $forms ) {
-               if ( !count( $forms ) ) {
-                       return '';
-               }
-               $forms = $this->preConvertPlural( $forms, 2 );
-
-               return ( $count <= 1 ) ? $forms[0] : $forms[1];
-       }
 
        /**
         * Dates in Walloon are "1î d' <monthname>" for 1st of the month,