10ee560b47e5d81f011e0c0f85dd8c04bd825341
3 require_once( "LanguageUtf8.php" );
5 # The names of the namespaces can be set here, but the numbers
6 # are magical, so don't change or move them! The Namespace class
7 # encapsulates some of the magic-ness.
10 if($wgMetaNamespace === FALSE)
11 $wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
13 /* private */ $wgNamespaceNamesnv = array(
15 NS_SPECIAL
=> 'Special',
17 NS_TALK
=> 'Naaltsoos_baa_yinísht\'į́',
18 NS_USER
=> 'Choinish\'įįhí',
19 NS_USER_TALK
=> 'Choinish\'įįhí_baa_yinísht\'į́',
20 NS_WIKIPEDIA
=> 'Wikiibíídiiya',
21 NS_WIKIPEDIA_TALK
=> 'Wikiibíídiiya_baa_yinísht\'į́',
22 NS_IMAGE
=> 'E\'elyaaígíí',
23 NS_IMAGE_TALK
=> 'E\'elyaaígíí_baa_yinísht\'į́',
24 NS_MEDIAWIKI
=> 'MediaWiki',
25 NS_MEDIAWIKI_TALK
=> 'MediaWiki_baa_yinísht\'į́',
26 NS_TEMPLATE
=> 'Template',
27 NS_TEMPLATE_TALK
=> 'Template_talk',
28 NS_HELP
=> 'Aná\'álwo\'',
29 NS_HELP_TALK
=> 'Aná\'álwo\'_baa_yinísht\'į́',
30 NS_CATEGORY
=> 'T\'ááłáhági_át\'éego',
31 NS_CATEGORY_TALK
=> 'T\'ááłáhági_át\'éego_baa_yinísht\'į́'
34 /* private */ $wgDefaultUserOptionsnv = array(
35 'quickbar' => 1, 'underline' => 1, 'hover' => 1,
36 'cols' => 80, 'rows' => 25, 'searchlimit' => 20,
37 'contextlines' => 5, 'contextchars' => 50,
38 'skin' => $wgDefaultSkin, 'math' => 1, 'rcdays' => 7, 'rclimit' => 50,
39 'highlightbroken' => 1, 'stubthreshold' => 0,
40 'previewontop' => 1, 'editsection'=>1,'editsectiononrightclick'=>0, 'showtoc'=>1,
45 /* private */ $wgQuickbarSettingsnv = array(
46 'None', 'Fixed left', 'Fixed right', 'Floating left'
49 /* private */ $wgSkinNamesnv = array(
50 'standard' => 'Standard',
51 'nostalgia' => 'Nostalgia',
52 'cologneblue' => 'Cologne Blue',
53 'davinci' => 'DaVinci',
54 'mono' => 'Łáa\'ígíí',
55 'monobook' => 'NaaltsoosŁáa\'ígíí',
59 define( "MW_MATH_PNG", 0 );
60 define( "MW_MATH_SIMPLE", 1 );
61 define( "MW_MATH_HTML", 2 );
62 define( "MW_MATH_SOURCE", 3 );
63 define( "MW_MATH_MODERN", 4 );
64 define( "MW_MATH_MATHML", 5 );
66 /* private */ $wgMathNamesnv = array(
67 MW_MATH_PNG
=> 'Always render PNG',
68 MW_MATH_SIMPLE
=> 'HTML if very simple or else PNG',
69 MW_MATH_HTML
=> 'HTML if possible or else PNG',
70 MW_MATH_SOURCE
=> 'Leave it as TeX (for text browsers)',
71 MW_MATH_MODERN
=> 'Recommended for modern browsers',
72 MW_MATH_MATHML
=> 'MathML if possible (experimental)',
75 /* private */ $wgDateFormatsnv = array(
77 'Yas Niłt\'ees 15, 2001',
78 '15 Yas Niłt\'ees 2001',
79 '2001 Yas Niłt\'ees 15',
83 /* private */ $wgUserTogglesnv = array(
84 'hover' => 'Show hoverbox over wiki links',
85 'underline' => 'Biyaadi iissoh',
86 'highlightbroken' => 'Format broken links <a href="" class="new">like
87 this</a> (alternative: like this<a href="" class="internal">?</a>).',
88 'justify' => 'Justify paragraphs',
89 'hideminor' => 'Hide minor edits in recent changes',
90 'usenewrc' => 'Enhanced recent changes (not for all browsers)',
91 'numberheadings' => 'Auto-number headings',
92 'showtoolbar'=>'Show edit toolbar',
93 'editondblclick' => 'Edit pages on double click (JavaScript)',
94 'editsection'=>'Enable section editing via [edit] links',
95 'editsectiononrightclick'=>'Enable section editing by right clicking<br /> on section titles (JavaScript)',
96 'showtoc'=>'Hián-sī bo̍k-lo̍k<br />(3 ê piau-tê í-siōng ê ia̍h)',
97 'rememberpassword' => 'Kì tiâu góa ê bi̍t-bé (across sessions)',
98 'editwidth' => 'Pian-chi̍p keh-á thián hō· khui',
99 'watchdefault' => 'Kā lí pian-chi̍p ê ia̍h ka-ji̍p kàm-sī-toaⁿ',
100 'minordefault' => 'Siat-sú só·-ū ê pian-chi̍p lóng sió siu-kái',
101 'previewontop' => 'Show preview before edit box and not after it',
102 'nocache' => 'Naaltsoos doo nooh yishchí da'
105 /* private */ $wgBookstoreListnv = array(
106 "AddALL" => "http://www.addall.com/New/Partner.cgi?query=$1&type=ISBN",
107 "PriceSCAN" => "http://www.pricescan.com/books/bookDetail.asp?isbn=$1",
108 "Barnes & Noble" => "http://shop.barnesandnoble.com/bookSearch/isbnInquiry.asp?isbn=$1",
109 "Amazon.com" => "http://www.amazon.com/exec/obidos/ISBN=$1",
113 # Read language names
114 global $wgLanguageNames;
115 require_once( "Names.php" );
117 $wgLanguageNamesnv =& $wgLanguageNames;
120 /* private */ $wgWeekdayNamesnv = array(
121 'Damóogo', 'Damóo biiskání', 'Damóodóó naakiską́o', 'Damóodóó tágí jį́', 'Damóodóó dį́į́\' yiską́o',
122 'Nda\'iiníísh', 'Yiską́ damóo'
125 /* private */ $wgWeekdayAbbreviationsJa = array(
126 "Dam", "Dm1", "Dm2", "Dm3", "Dm4", "Nda", "Ysk"
129 /* private */ $wgMonthNamesnv = array(
130 'Yas Niłt\'ees', 'Atsá Biyáázh', 'Wóózhch\'į́į́d', 'T\'ą́ą́chil', 'T\'ą́ą́tsoh', 'Ya\'iishjááshchilí',
131 'Ya\'iishjáástsoh', 'Bini\'ant\'ą́ą́ts\'ózí', 'Bini\'ant\'ą́ą́tsoh', 'Ghąąjį', 'Níłch\'its\'ósí',
135 /* private */ $wgMonthAbbreviationsnv = array(
136 'Ynts', 'Atsb', 'Wozh', 'Tchi', 'Ttso', 'Yjsh', 'Yjts', 'Btsz',
137 'Btsx', 'Ghąj', 'Ntss', 'Ntsx'
140 # Note to translators:
141 # Please include the English words as synonyms. This allows people
142 # from other wikis to contribute more easily.
144 /* private */ $wgMagicWordsnv = array(
146 MAG_REDIRECT
=> array( 0, '#redirect' ),
147 MAG_NOTOC
=> array( 0, '__NOTOC__' ),
148 MAG_FORCETOC
=> array( 0, '__FORCETOC__' ),
149 MAG_NOEDITSECTION
=> array( 0, '__NOEDITSECTION__' ),
150 MAG_START
=> array( 0, '__START__' ),
151 MAG_CURRENTMONTH
=> array( 1, 'CURRENTMONTH' ),
152 MAG_CURRENTMONTHNAME
=> array( 1, 'CURRENTMONTHNAME' ),
153 MAG_CURRENTDAY
=> array( 1, 'CURRENTDAY' ),
154 MAG_CURRENTDAYNAME
=> array( 1, 'CURRENTDAYNAME' ),
155 MAG_CURRENTYEAR
=> array( 1, 'CURRENTYEAR' ),
156 MAG_CURRENTTIME
=> array( 1, 'CURRENTTIME' ),
157 MAG_NUMBEROFARTICLES
=> array( 1, 'NUMBEROFARTICLES' ),
158 MAG_CURRENTMONTHNAMEGEN
=> array( 1, 'CURRENTMONTHNAMEGEN' ),
159 MAG_PAGENAME
=> array( 1, 'PAGENAME' ),
160 MAG_NAMESPACE
=> array( 1, 'NAMESPACE' ),
161 MAG_MSG
=> array( 0, 'MSG:' ),
162 MAG_SUBST
=> array( 0, 'SUBST:' ),
163 MAG_MSGNW
=> array( 0, 'MSGNW:' ),
164 MAG_END
=> array( 0, '__END__' ),
165 MAG_IMG_THUMBNAIL
=> array( 1, 'thumbnail', 'thumb' ),
166 MAG_IMG_RIGHT
=> array( 1, 'right' ),
167 MAG_IMG_LEFT
=> array( 1, 'left' ),
168 MAG_IMG_NONE
=> array( 1, 'none' ),
169 MAG_IMG_WIDTH
=> array( 1, '$1px' ),
170 MAG_IMG_CENTER
=> array( 1, 'center', 'centre' ),
171 MAG_IMG_FRAMED
=> array( 1, 'framed', 'enframed', 'frame' ),
172 MAG_INT
=> array( 0, 'INT:' ),
173 MAG_SITENAME
=> array( 1, 'SITENAME' ),
174 MAG_NS
=> array( 0, 'NS:' ),
175 MAG_LOCALURL
=> array( 0, 'LOCALURL:' ),
176 MAG_LOCALURLE
=> array( 0, 'LOCALURLE:' ),
177 MAG_SERVER
=> array( 0, 'SERVER' )
180 #-------------------------------------------------------------------
182 #-------------------------------------------------------------------
183 # Allowed characters in keys are: A-Z, a-z, 0-9, underscore (_) and
184 # hyphen (-). If you need more characters, you may be able to change
185 # the regex in MagicWord::initRegex
187 # NOTE: To turn off "Current Events" in the sidebar,
188 # set "currentevents" => ""
190 # NOTE: To turn off "Disclaimers" in the title links,
191 # set "disclaimers" => ""
193 # NOTE: To turn off "Community portal" in the title links,
196 #--------------------------------------------------------------------------
197 # Internationalisation code
198 #--------------------------------------------------------------------------
202 # Copies any missing values in the specified arrays from En to the current language
203 $fillin = array( 'wgSysopSpecialPages', 'wgValidSpecialPages', 'wgDeveloperSpecialPages' );
204 $name = get_class( $this );
205 if( strpos( $name, 'language' ) == 0){
206 $lang = ucfirst( substr( $name, 8 ) );
207 foreach( $fillin as $arrname ){
208 $langver = "{$arrname}{$lang}";
209 $enver = "{$arrname}En";
210 if( ! isset( $GLOBALS[$langver] ) ||
! isset( $GLOBALS[$enver] ))
212 foreach($GLOBALS[$enver] as $spage => $text){
213 if( ! isset( $GLOBALS[$langver][$spage] ) )
214 $GLOBALS[$langver][$spage] = $text;
220 function getDefaultUserOptions () {
221 global $wgDefaultUserOptionsnv ;
222 return $wgDefaultUserOptionsnv ;
225 function getBookstoreList () {
226 global $wgBookstoreListnv ;
227 return $wgBookstoreListnv ;
230 function getNamespaces() {
231 global $wgNamespaceNamesnv;
232 return $wgNamespaceNamesnv;
235 function getNsText( $index ) {
236 global $wgNamespaceNamesnv;
237 return $wgNamespaceNamesnv[$index];
240 function getNsIndex( $text ) {
241 global $wgNamespaceNamesnv;
243 foreach ( $wgNamespaceNamesnv as $i => $n ) {
244 if ( 0 == strcasecmp( $n, $text ) ) { return $i; }
249 function specialPage( $name ) {
250 return $this->getNsText( Namespace::getSpecial() ) . ':' . $name;
253 function getQuickbarSettings() {
254 global $wgQuickbarSettingsnv;
255 return $wgQuickbarSettingsnv;
258 function getSkinNames() {
259 global $wgSkinNamesnv;
260 return $wgSkinNamesnv;
263 function getMathNames() {
264 global $wgMathNamesnv;
265 return $wgMathNamesnv;
268 function getDateFormats() {
269 global $wgDateFormatsnv;
270 return $wgDateFormatsnv;
273 function getUserToggles() {
274 global $wgUserTogglesnv;
275 return $wgUserTogglesnv;
278 function getUserToggle( $tog ) {
279 $togs =& $this->getUserToggles();
283 function getLanguageNames() {
284 global $wgLanguageNamesnv;
285 return $wgLanguageNamesnv;
288 function getLanguageName( $code ) {
289 global $wgLanguageNamesnv;
290 if ( ! array_key_exists( $code, $wgLanguageNamesnv ) ) {
293 return $wgLanguageNamesnv[$code];
296 function getMonthName( $key )
298 global $wgMonthNamesnv;
299 return $wgMonthNamesnv[$key-1];
302 /* by default we just return base form */
303 function getMonthNameGen( $key )
305 return $this->getMonthName( $key );
308 function getMonthAbbreviation( $key )
310 global $wgMonthAbbreviationsnv;
311 return @$wgMonthAbbreviationsnv[$key-1];
314 function getWeekdayName( $key )
316 global $wgWeekdayNamesnv;
317 return $wgWeekdayNamesnv[$key-1];
320 function userAdjust( $ts )
322 global $wgUser, $wgLocalTZoffset;
324 $tz = $wgUser->getOption( 'timecorrection' );
326 $hrDiff = isset( $wgLocalTZoffset ) ?
$wgLocalTZoffset : 0;
328 } elseif ( strpos( $tz, ":" ) !== false ) {
329 $tzArray = explode( ":", $tz );
330 $hrDiff = intval($tzArray[0]);
331 $minDiff = intval($hrDiff < 0 ?
-$tzArray[1] : $tzArray[1]);
333 $hrDiff = intval( $tz );
335 if ( 0 == $hrDiff && 0 == $minDiff ) { return $ts; }
338 (int)substr( $ts, 8, 2) ) +
$hrDiff, # Hours
339 (int)substr( $ts, 10, 2 ) +
$minDiff, # Minutes
340 (int)substr( $ts, 12, 2 ), # Seconds
341 (int)substr( $ts, 4, 2 ), # Month
342 (int)substr( $ts, 6, 2 ), # Day
343 (int)substr( $ts, 0, 4 ) ); #Year
344 return date( 'YmdHis', $t );
347 function date( $ts, $adj = false )
349 global $wgAmericanDates, $wgUser, $wgUseDynamicDates;
351 if ( $adj ) { $ts = $this->userAdjust( $ts ); }
353 if ( $wgUseDynamicDates ) {
354 $datePreference = $wgUser->getOption( 'date' );
355 if ( $datePreference == 0 ) {
356 $datePreference = $wgAmericanDates ?
1 : 2;
359 $datePreference = $wgAmericanDates ?
1 : 2;
362 $month = $this->getMonthAbbreviation( substr( $ts, 4, 2 ) );
363 $day = $this->formatNum( 0 +
substr( $ts, 6, 2 ) );
364 $year = $this->formatNum( substr( $ts, 0, 4 ) );
366 switch( $datePreference ) {
367 case 1: return "$month $day, $year";
368 case 2: return "$day $month $year";
369 default: return "$year $month $day";
373 function time( $ts, $adj = false, $seconds = false )
375 if ( $adj ) { $ts = $this->userAdjust( $ts ); }
377 $t = substr( $ts, 8, 2 ) . ':' . substr( $ts, 10, 2 );
379 $t .= ':' . substr( $ts, 12, 2 );
381 return $this->formatNum( $t );
384 function timeanddate( $ts, $adj = false )
386 return $this->time( $ts, $adj ) . ', ' . $this->date( $ts, $adj );
389 function rfc1123( $ts )
391 return date( 'D, d M Y H:i:s T', $ts );
394 function getValidSpecialPages()
396 global $wgValidSpecialPagesnv;
397 return $wgValidSpecialPagesnv;
400 function getSysopSpecialPages()
402 global $wgSysopSpecialPagesnv;
403 return $wgSysopSpecialPagesnv;
406 function getDeveloperSpecialPages()
408 global $wgDeveloperSpecialPagesnv;
409 return $wgDeveloperSpecialPagesnv;
412 function getMessage( $key )
414 global $wgAllMessagesnv;
415 return @$wgAllMessagesnv[$key];
418 function getAllMessages()
420 global $wgAllMessagesnv;
421 return $wgAllMessagesnv;
424 function iconv( $in, $out, $string ) {
425 # For most languages, this is a wrapper for iconv
426 return iconv( $in, $out, $string );
429 function ucfirst( $string ) {
430 # For most languages, this is a wrapper for ucfirst()
431 return ucfirst( $string );
434 function lcfirst( $s ) {
435 return strtolower( $s{0} ). substr( $s, 1 );
438 function checkTitleEncoding( $s ) {
439 global $wgInputEncoding;
441 # Check for UTF-8 URLs; Internet Explorer produces these if you
442 # type non-ASCII chars in the URL bar or follow unescaped links.
443 $ishigh = preg_match( '/[\x80-\xff]/', $s);
444 $isutf = ($ishigh ?
preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
445 '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s ) : true );
447 if( ($wgInputEncoding != 'utf-8') and $ishigh and $isutf )
448 return @iconv
( 'UTF-8', $wgInputEncoding, $s );
450 if( ($wgInputEncoding == 'utf-8') and $ishigh and !$isutf )
451 return utf8_encode( $s );
453 # Other languages can safely leave this function, or replace
454 # it with one to detect and convert another legacy encoding.
458 function stripForSearch( $in ) {
459 # Some languages have special punctuation to strip out
460 # or characters which need to be converted for MySQL's
461 # indexing to grok it correctly. Make such changes here.
465 function firstChar( $s ) {
466 # Get the first character of a string. In ASCII, return
467 # first byte of the string. UTF8 and others have to
472 function setAltEncoding() {
473 # Some languages may have an alternate char encoding option
474 # (Esperanto X-coding, Japanese furigana conversion, etc)
475 # If 'altencoding' is checked in user prefs, this gives a
476 # chance to swap out the default encoding settings.
477 #global $wgInputEncoding, $wgOutputEncoding, $wgEditEncoding;
480 function recodeForEdit( $s ) {
481 # For some languages we'll want to explicitly specify
482 # which characters make it into the edit box raw
483 # or are converted in some way or another.
484 # Note that if wgOutputEncoding is different from
485 # wgInputEncoding, this text will be further converted
486 # to wgOutputEncoding.
487 global $wgInputEncoding, $wgEditEncoding;
488 if( $wgEditEncoding == '' or
489 $wgEditEncoding == $wgInputEncoding ) {
492 return $this->iconv( $wgInputEncoding, $wgEditEncoding, $s );
496 function recodeInput( $s ) {
497 # Take the previous into account.
498 global $wgInputEncoding, $wgOutputEncoding, $wgEditEncoding;
499 if($wgEditEncoding != "") {
500 $enc = $wgEditEncoding;
502 $enc = $wgOutputEncoding;
504 if( $enc == $wgInputEncoding ) {
507 return $this->iconv( $enc, $wgInputEncoding, $s );
511 # For right-to-left language support
512 function isRTL() { return false; }
514 # To allow "foo[[bar]]" to extend the link over the whole word "foobar"
515 function linkPrefixExtension() { return false; }
518 function &getMagicWords()
520 global $wgMagicWordsnv;
521 return $wgMagicWordsnv;
524 # Fill a MagicWord object with data from here
525 function getMagic( &$mw )
527 $raw =& $this->getMagicWords();
528 if( !isset( $raw[$mw->mId
] ) ) {
529 # Fall back to English if local list is incomplete
530 $raw =& Language
::getMagicWords();
532 $rawEntry = $raw[$mw->mId
];
533 $mw->mCaseSensitive
= $rawEntry[0];
534 $mw->mSynonyms
= array_slice( $rawEntry, 1 );
537 # Italic is unsuitable for some languages
538 function emphasize( $text )
540 return '<em>'.$text.'</em>';
544 # Normally we use the plain ASCII digits. Some languages such as Arabic will
545 # want to output numbers using script-appropriate characters: override this
546 # function with a translator. See LanguageAr.php for an example.
547 function formatNum( $number ) {
551 function listToText( $l ) {
554 for ($i = $m; $i >= 0; $i--) {
557 } else if ($i == $m - 1) {
558 $s = $l[$i] . ' ' . $this->getMessage('and') . ' ' . $s;
560 $s = $l[$i] . ', ' . $s;
567 # This should fail gracefully if there's not a localization available
568 @include_once
( 'Language' . ucfirst( $wgLanguageCode ) . '.php' );