Now should set the parser functions as magic words via the appropriate hooks (MagicWo...
[lhc/web/wiklou.git] / languages / LanguageYi.php
1 <?php
2 /** Yiddish (ייִדיש)
3 *
4 * @bug 3810
5 *
6 * @package MediaWiki
7 * @subpackage Language
8 */
9
10 require_once 'LanguageUtf8.php';
11
12 if (!$wgCachedMessageArrays) {
13 require_once('MessagesYi.php');
14 }
15
16 class LanguageYi extends LanguageUtf8 {
17 private $mMessagesYi, $mNamespaceNamesYi = null;
18
19 function LanguageYi() {
20 LanguageUtf8::LanguageUtf8();
21
22 global $wgAllMessagesYi;
23 $this->mMessagesYi =& $wgAllMessagesYi;
24
25 global $wgMetaNamespace;
26 $this->mNamespaceNamesYi = array(
27 NS_MEDIA => 'מעדיע',
28 NS_SPECIAL => 'באַזונדער',
29 NS_MAIN => '',
30 NS_TALK => 'רעדן',
31 NS_USER => 'באַניצער',
32 NS_USER_TALK => 'באַניצער_רעדן',
33 NS_PROJECT => $wgMetaNamespace,
34 NS_PROJECT_TALK => $wgMetaNamespace . '_רעדן',
35 NS_IMAGE => 'בילד',
36 NS_IMAGE_TALK => 'בילד_רעדן',
37 NS_MEDIAWIKI => 'מעדיעװיקי',
38 NS_MEDIAWIKI_TALK => 'מעדיעװיקי_רעדן',
39 NS_TEMPLATE => 'מוסטער',
40 NS_TEMPLATE_TALK => 'מוסטער_רעדן',
41 NS_HELP => 'הילף',
42 NS_HELP_TALK => 'הילף_רעדן',
43 NS_CATEGORY => 'קאַטעגאָריע',
44 NS_CATEGORY_TALK => 'קאַטעגאָריע_רעדן'
45 );
46 }
47
48 function getNamespaces() {
49 return $this->mNamespaceNamesYi + parent::getNamespaces();
50 }
51
52 function getMessage( $key ) {
53 if( isset( $this->mMessagesYi[$key] ) ) {
54 return $this->mMessagesYi[$key];
55 } else {
56 return parent::getMessage( $key );
57 }
58 }
59
60 function getAllMessages() {
61 return $this->mMessagesYi;
62 }
63
64 function getDefaultUserOptions() {
65 $opt = parent::getDefaultUserOptions();
66 $opt['quickbar'] = 2; # Right-to-left
67 return $opt;
68 }
69
70 # For right-to-left language support
71 function isRTL() {
72 return true;
73 }
74
75 function getNsIndex( $text ) {
76 global $wgSitename;
77
78 foreach ( $this->mNamespaceNamesYi as $i => $n ) {
79 if ( 0 == strcasecmp( $n, $text ) ) { return $i; }
80 }
81 if( $wgSitename == 'װיקיפּעדיע' ) {
82 if( 0 == strcasecmp( 'וויקיפעדיע', $text ) ) return NS_PROJECT;
83 if( 0 == strcasecmp( 'וויקיפעדיע_רעדן', $text ) ) return NS_PROJECT_TALK;
84 }
85 if( $wgSitename == 'װיקיביבליאָטעק' ) {
86 if( 0 == strcasecmp( 'וויקיביבליאטעק', $text ) ) return NS_PROJECT;
87 if( 0 == strcasecmp( 'וויקיביבליאטעק_רעדן', $text ) ) return NS_PROJECT_TALK;
88 }
89 if( $wgSitename == 'װיקיװערטערבוך' ) {
90 if( 0 == strcasecmp( 'וויקיווערטערבוך', $text ) ) return NS_PROJECT;
91 if( 0 == strcasecmp( 'וויקיווערטערבוך_רעדן', $text ) ) return NS_PROJECT_TALK;
92 }
93 if( $wgSitename == 'װיקינײַעס' ) {
94 if( 0 == strcasecmp( 'וויקינייעס', $text ) ) return NS_PROJECT;
95 if( 0 == strcasecmp( 'וויקינייעס_רעדן', $text ) ) return NS_PROJECT_TALK;
96 }
97 if( 0 == strcasecmp( 'באזונדער', $text ) ) return NS_SPECIAL;
98 if( 0 == strcasecmp( 'באנוצער', $text ) ) return NS_USER;
99 if( 0 == strcasecmp( 'באנוצער_רעדן', $text ) ) return NS_USER_TALK;
100 if( 0 == strcasecmp( 'מעדיעוויקי', $text ) ) return NS_MEDIAWIKI;
101 if( 0 == strcasecmp( 'מעדיעוויקי_רעדן', $text ) ) return NS_MEDIAWIKI_TALK;
102 if( 0 == strcasecmp( 'קאטעגאריע', $text ) ) return NS_CATEGORY;
103 if( 0 == strcasecmp( 'קאטעגאריע_רעדן', $text ) ) return NS_CATEGORY_TALK;
104 return false;
105 }
106 }
107
108 ?>