Displaying all the groups with the permission, not only the first defined one, in...
[mediawiki.git] / languages / LanguageHe.php
blob105596dca8ebf65e258afb44b920d7b1cb4116dd
1 <?php
2 /**
3 * Hebrew (עברית)
5 * @package MediaWiki
6 * @subpackage Language
8 * @author Rotem Dan (July 2003)
9 * @author Rotem Liss (March 2006 on)
12 class LanguageHe extends Language {
13 /**
14 * Convert grammar forms of words.
16 * Available cases:
17 * "prefixed" (or "תחילית") - when the word has a prefix
19 * @param string the word to convert
20 * @param string the case
22 public function convertGrammar( $word, $case ) {
23 global $wgGrammarForms;
24 if ( isset($wgGrammarForms['he'][$case][$word]) ) {
25 return $wgGrammarForms['he'][$case][$word];
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;
36 # Remove the "He" if prefixed
37 if ( substr( $word, 0, 2 ) == "ה" ) {
38 $word = substr( $word, 2 );
41 # Add a hyphen if non-Hebrew letters
42 if ( substr( $word, 0, 2 ) < "א" || substr( $word, 0, 2 ) > "ת" ) {
43 $word = "־".$word;
47 return $word;
50 /**
51 * Gets a number and uses the suited form of the word.
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)
58 * @return string of the suited form of word
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;