No need of $wgDBmwschema after r108060
[lhc/web/wiklou.git] / languages / classes / LanguageGa.php
index 0ac7a40..43050e1 100644 (file)
@@ -5,17 +5,24 @@
  * @ingroup Language
  */
 class LanguageGa extends Language {
-       # Convert day names
-       # Invoked with {{GRAMMAR:transformation|word}}
+
+       /**
+        * Convert day names
+        * Invoked with {{GRAMMAR:transformation|word}}
+        *
+        * @param $word string
+        * @param $case string
+        * @return string
+        */
        function convertGrammar( $word, $case ) {
                global $wgGrammarForms;
-               if ( isset($wgGrammarForms['ga'][$case][$word]) ) {
+               if ( isset( $wgGrammarForms['ga'][$case][$word] ) ) {
                        return $wgGrammarForms['ga'][$case][$word];
                }
 
                switch ( $case ) {
                case 'ainmlae':
-                       switch ($word) {
+                       switch ( $word ) {
                        case 'an Domhnach':
                                $word = 'Dé Domhnaigh'; break;
                        case 'an Luan':
@@ -35,18 +42,23 @@ class LanguageGa extends Language {
                return $word;
        }
 
+       /**
+        * @param $count int
+        * @param $forms array
+        * @return string
+        */
        function convertPlural( $count, $forms ) {
-               if ( !count($forms) ) { return ''; }
+               if ( !count( $forms ) ) { return ''; }
 
                // plural forms per http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#ga
                $forms = $this->preConvertPlural( $forms, 3 );
 
                if ( $count == 1 ) {
+                       $index = 0;
+               } elseif ( $count == 2 ) {
                        $index = 1;
-               } elseif( $count == 2 ) {
-                       $index = 2;
                } else {
-                       $index = 3;
+                       $index = 2;
                }
                return $forms[$index];
        }