Merge "The 4th Database::select() parameter is the function name. The ORDER BY should...
[mediawiki.git] / languages / classes / LanguageGa.php
blob43050e16c1c553d2c330d60494616df8749eb98b
1 <?php
3 /** Irish (Gaeilge)
5 * @ingroup Language
6 */
7 class LanguageGa extends Language {
9 /**
10 * Convert day names
11 * Invoked with {{GRAMMAR:transformation|word}}
13 * @param $word string
14 * @param $case string
15 * @return string
17 function convertGrammar( $word, $case ) {
18 global $wgGrammarForms;
19 if ( isset( $wgGrammarForms['ga'][$case][$word] ) ) {
20 return $wgGrammarForms['ga'][$case][$word];
23 switch ( $case ) {
24 case 'ainmlae':
25 switch ( $word ) {
26 case 'an Domhnach':
27 $word = 'Dé Domhnaigh'; break;
28 case 'an Luan':
29 $word = 'Dé Luain'; break;
30 case 'an Mháirt':
31 $word = 'Dé Mháirt'; break;
32 case 'an Chéadaoin':
33 $word = 'Dé Chéadaoin'; break;
34 case 'an Déardaoin':
35 $word = 'Déardaoin'; break;
36 case 'an Aoine':
37 $word = 'Dé hAoine'; break;
38 case 'an Satharn':
39 $word = 'Dé Sathairn'; break;
42 return $word;
45 /**
46 * @param $count int
47 * @param $forms array
48 * @return string
50 function convertPlural( $count, $forms ) {
51 if ( !count( $forms ) ) { return ''; }
53 // plural forms per http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#ga
54 $forms = $this->preConvertPlural( $forms, 3 );
56 if ( $count == 1 ) {
57 $index = 0;
58 } elseif ( $count == 2 ) {
59 $index = 1;
60 } else {
61 $index = 2;
63 return $forms[$index];