It broke things
[lhc/web/wiklou.git] / languages / LanguageHe.php
1 <?php
2 /**
3 * Hebrew (עברית)
4 *
5 * @package MediaWiki
6 * @subpackage Language
7 *
8 * @author Rotem Dan (July 2003)
9 * @author Rotem Liss (March 2006 on)
10 */
11
12 class LanguageHe extends Language {
13 /**
14 * Convert grammar forms of words.
15 *
16 * Available cases:
17 * "prefixed" (or "תחילית") - when the word has a prefix
18 *
19 * @param string the word to convert
20 * @param string the case
21 */
22 public function convertGrammar( $word, $case ) {
23 global $wgGrammarForms;
24 if ( isset($wgGrammarForms['he'][$case][$word]) ) {
25 return $wgGrammarForms['he'][$case][$word];
26 }
27
28 switch ( $case ) {
29 case 'prefixed':
30 case 'תחילית':
31 # Duplicate the "Waw" if prefixed
32 if ( substr( $word, 0, 2 ) == "ו" && substr( $word, 0, 4 ) != "וו" ) {
33 $word = "ו".$word;
34 }
35
36 # Remove the "He" if prefixed
37 if ( substr( $word, 0, 2 ) == "ה" ) {
38 $word = substr( $word, 2 );
39 }
40
41 # Add a hyphen if non-Hebrew letters
42 if ( substr( $word, 0, 2 ) < "א" || substr( $word, 0, 2 ) > "ת" ) {
43 $word = "־".$word;
44 }
45 }
46
47 return $word;
48 }
49
50 /**
51 * Gets a number and uses the suited form of the word.
52 *
53 * @param integer the number of items
54 * @param string the first form (singular)
55 * @param string the second form (plural)
56 * @param string the third form (2 items, plural is used if not applicable and not specified)
57 *
58 * @return string of the suited form of word
59 */
60 public function convertPlural( $count, $w1, $w2, $w3) {
61 if ( $count == '1' ) {
62 return $w1;
63 } elseif ( $count == '2' && $w3 ) {
64 return $w3;
65 } else {
66 return $w2;
67 }
68 }
69 }
70
71 ?>