Index: trunk/phase3/languages/Language.php |
— | — | @@ -116,7 +116,7 @@ |
117 | 117 | 'hebrew-calendar-m10-gen', 'hebrew-calendar-m11-gen', 'hebrew-calendar-m12-gen', |
118 | 118 | 'hebrew-calendar-m6a-gen', 'hebrew-calendar-m6b-gen' |
119 | 119 | ); |
120 | | - |
| 120 | + |
121 | 121 | static public $mHijriCalendarMonthMsgs = array( |
122 | 122 | 'hijri-calendar-m1', 'hijri-calendar-m2', 'hijri-calendar-m3', |
123 | 123 | 'hijri-calendar-m4', 'hijri-calendar-m5', 'hijri-calendar-m6', |
— | — | @@ -159,7 +159,7 @@ |
160 | 160 | |
161 | 161 | if ( $recursionLevel > 5 ) { |
162 | 162 | throw new MWException( "Language fallback loop detected when creating class $class\n" ); |
163 | | - } |
| 163 | + } |
164 | 164 | |
165 | 165 | if( ! class_exists( $class ) ) { |
166 | 166 | $fallback = Language::getFallbackFor( $code ); |
— | — | @@ -242,7 +242,7 @@ |
243 | 243 | function getNamespaces() { |
244 | 244 | if ( is_null( $this->namespaceNames ) ) { |
245 | 245 | global $wgExtraNamespaces, $wgMetaNamespace, $wgMetaNamespaceTalk; |
246 | | - |
| 246 | + |
247 | 247 | $this->namespaceNames = self::$dataCache->getItem( $this->mCode, 'namespaceNames' ); |
248 | 248 | if ( $wgExtraNamespaces ) { |
249 | 249 | $this->namespaceNames = $wgExtraNamespaces + $this->namespaceNames; |
— | — | @@ -256,7 +256,7 @@ |
257 | 257 | $this->namespaceNames[NS_PROJECT_TALK] = |
258 | 258 | $this->fixVariableInNamespace( $talk ); |
259 | 259 | } |
260 | | - |
| 260 | + |
261 | 261 | # The above mixing may leave namespaces out of canonical order. |
262 | 262 | # Re-order by namespace ID number... |
263 | 263 | ksort( $this->namespaceNames ); |
— | — | @@ -344,7 +344,7 @@ |
345 | 345 | if ( is_null( $this->mNamespaceIds ) ) { |
346 | 346 | global $wgNamespaceAliases; |
347 | 347 | # Put namespace names and aliases into a hashtable. |
348 | | - # If this is too slow, then we should arrange it so that it is done |
| 348 | + # If this is too slow, then we should arrange it so that it is done |
349 | 349 | # before caching. The catch is that at pre-cache time, the above |
350 | 350 | # class-specific fixup hasn't been done. |
351 | 351 | $this->mNamespaceIds = array(); |
— | — | @@ -415,7 +415,7 @@ |
416 | 416 | function getDatePreferences() { |
417 | 417 | return self::$dataCache->getItem( $this->mCode, 'datePreferences' ); |
418 | 418 | } |
419 | | - |
| 419 | + |
420 | 420 | function getDateFormats() { |
421 | 421 | return self::$dataCache->getItem( $this->mCode, 'dateFormats' ); |
422 | 422 | } |
— | — | @@ -460,7 +460,7 @@ |
461 | 461 | if ( !$customisedOnly ) { |
462 | 462 | return $allNames; |
463 | 463 | } |
464 | | - |
| 464 | + |
465 | 465 | global $IP; |
466 | 466 | $names = array(); |
467 | 467 | $dir = opendir( "$IP/languages/messages" ); |
— | — | @@ -523,11 +523,11 @@ |
524 | 524 | function getHebrewCalendarMonthNameGen( $key ) { |
525 | 525 | return $this->getMessageFromDB( self::$mHebrewCalendarMonthGenMsgs[$key-1] ); |
526 | 526 | } |
527 | | - |
| 527 | + |
528 | 528 | function getHijriCalendarMonthName( $key ) { |
529 | 529 | return $this->getMessageFromDB( self::$mHijriCalendarMonthMsgs[$key-1] ); |
530 | 530 | } |
531 | | - |
| 531 | + |
532 | 532 | /** |
533 | 533 | * Used by date() and time() to adjust the time output. |
534 | 534 | * |
— | — | @@ -579,7 +579,7 @@ |
580 | 580 | |
581 | 581 | wfSuppressWarnings(); // E_STRICT system time bitching |
582 | 582 | # Generate an adjusted date; take advantage of the fact that mktime |
583 | | - # will normalize out-of-range values so we don't have to split $minDiff |
| 583 | + # will normalize out-of-range values so we don't have to split $minDiff |
584 | 584 | # into hours and minutes. |
585 | 585 | $t = mktime( ( |
586 | 586 | (int)substr( $ts, 8, 2) ), # Hours |
— | — | @@ -588,19 +588,19 @@ |
589 | 589 | (int)substr( $ts, 4, 2 ), # Month |
590 | 590 | (int)substr( $ts, 6, 2 ), # Day |
591 | 591 | (int)substr( $ts, 0, 4 ) ); #Year |
592 | | - |
| 592 | + |
593 | 593 | $date = date( 'YmdHis', $t ); |
594 | 594 | wfRestoreWarnings(); |
595 | | - |
| 595 | + |
596 | 596 | return $date; |
597 | 597 | } |
598 | 598 | |
599 | 599 | /** |
600 | 600 | * This is a workalike of PHP's date() function, but with better |
601 | | - * internationalisation, a reduced set of format characters, and a better |
| 601 | + * internationalisation, a reduced set of format characters, and a better |
602 | 602 | * escaping format. |
603 | 603 | * |
604 | | - * Supported format characters are dDjlNwzWFmMntLoYyaAgGhHiscrU. See the |
| 604 | + * Supported format characters are dDjlNwzWFmMntLoYyaAgGhHiscrU. See the |
605 | 605 | * PHP manual for definitions. "o" format character is supported since |
606 | 606 | * PHP 5.1.0, previous versions return literal o. |
607 | 607 | * There are a number of extensions, which start with "x": |
— | — | @@ -648,7 +648,7 @@ |
649 | 649 | * |
650 | 650 | * Input timestamp is assumed to be pre-normalized to the desired local |
651 | 651 | * time zone, if any. |
652 | | - * |
| 652 | + * |
653 | 653 | * @param $format String |
654 | 654 | * @param $ts String: 14-character timestamp |
655 | 655 | * YYYYMMDDHHMMSS |
— | — | @@ -850,7 +850,7 @@ |
851 | 851 | case 'h': |
852 | 852 | $h = substr( $ts, 8, 2 ); |
853 | 853 | $num = sprintf( '%02d', $h % 12 ? $h % 12 : 12 ); |
854 | | - break; |
| 854 | + break; |
855 | 855 | case 'H': |
856 | 856 | $num = substr( $ts, 8, 2 ); |
857 | 857 | break; |
— | — | @@ -921,11 +921,11 @@ |
922 | 922 | private static $GREG_DAYS = array( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ); |
923 | 923 | private static $IRANIAN_DAYS = array( 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29 ); |
924 | 924 | /** |
925 | | - * Algorithm by Roozbeh Pournader and Mohammad Toossi to convert |
| 925 | + * Algorithm by Roozbeh Pournader and Mohammad Toossi to convert |
926 | 926 | * Gregorian dates to Iranian dates. Originally written in C, it |
927 | 927 | * is released under the terms of GNU Lesser General Public |
928 | 928 | * License. Conversion to PHP was performed by Niklas Laxström. |
929 | | - * |
| 929 | + * |
930 | 930 | * Link: http://www.farsiweb.info/jalali/jalali.c |
931 | 931 | */ |
932 | 932 | private static function tsToIranian( $ts ) { |
— | — | @@ -952,7 +952,7 @@ |
953 | 953 | |
954 | 954 | // Days passed in current month |
955 | 955 | $gDayNo += $gd; |
956 | | - |
| 956 | + |
957 | 957 | $jDayNo = $gDayNo - 79; |
958 | 958 | |
959 | 959 | $jNp = floor($jDayNo / 12053); |
— | — | @@ -986,7 +986,7 @@ |
987 | 987 | $year = substr( $ts, 0, 4 ); |
988 | 988 | $month = substr( $ts, 4, 2 ); |
989 | 989 | $day = substr( $ts, 6, 2 ); |
990 | | - |
| 990 | + |
991 | 991 | $zyr = $year; |
992 | 992 | $zd=$day; |
993 | 993 | $zm=$month; |
— | — | @@ -996,15 +996,15 @@ |
997 | 997 | |
998 | 998 | if (($zy>1582)||(($zy==1582)&&($zm>10))||(($zy==1582)&&($zm==10)&&($zd>14))) |
999 | 999 | { |
1000 | | - |
1001 | | - |
| 1000 | + |
| 1001 | + |
1002 | 1002 | $zjd=(int)((1461*($zy + 4800 + (int)( ($zm-14) /12) ))/4) + (int)((367*($zm-2-12*((int)(($zm-14)/12))))/12)-(int)((3*(int)(( ($zy+4900+(int)(($zm-14)/12))/100)))/4)+$zd-32075; |
1003 | 1003 | } |
1004 | 1004 | else |
1005 | 1005 | { |
1006 | 1006 | $zjd = 367*$zy-(int)((7*($zy+5001+(int)(($zm-9)/7)))/4)+(int)((275*$zm)/9)+$zd+1729777; |
1007 | 1007 | } |
1008 | | - |
| 1008 | + |
1009 | 1009 | $zl=$zjd-1948440+10632; |
1010 | 1010 | $zn=(int)(($zl-1)/10631); |
1011 | 1011 | $zl=$zl-10631*$zn+354; |
— | — | @@ -1268,7 +1268,7 @@ |
1269 | 1269 | array( '', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM', 'M' ), |
1270 | 1270 | array( '', 'M', 'MM', 'MMM' ) |
1271 | 1271 | ); |
1272 | | - |
| 1272 | + |
1273 | 1273 | $num = intval( $num ); |
1274 | 1274 | if ( $num > 3000 || $num <= 0 ) { |
1275 | 1275 | return $num; |
— | — | @@ -1378,7 +1378,7 @@ |
1379 | 1379 | if( $datePreference == '' ) { |
1380 | 1380 | return 'default'; |
1381 | 1381 | } |
1382 | | - |
| 1382 | + |
1383 | 1383 | return $datePreference; |
1384 | 1384 | } |
1385 | 1385 | |
— | — | @@ -1415,8 +1415,8 @@ |
1416 | 1416 | * @return string |
1417 | 1417 | */ |
1418 | 1418 | function date( $ts, $adj = false, $format = true, $timecorrection = false ) { |
1419 | | - if ( $adj ) { |
1420 | | - $ts = $this->userAdjust( $ts, $timecorrection ); |
| 1419 | + if ( $adj ) { |
| 1420 | + $ts = $this->userAdjust( $ts, $timecorrection ); |
1421 | 1421 | } |
1422 | 1422 | $df = $this->getDateFormatString( 'date', $this->dateFormat( $format ) ); |
1423 | 1423 | return $this->sprintfDate( $df, $ts ); |
— | — | @@ -1433,8 +1433,8 @@ |
1434 | 1434 | * @return string |
1435 | 1435 | */ |
1436 | 1436 | function time( $ts, $adj = false, $format = true, $timecorrection = false ) { |
1437 | | - if ( $adj ) { |
1438 | | - $ts = $this->userAdjust( $ts, $timecorrection ); |
| 1437 | + if ( $adj ) { |
| 1438 | + $ts = $this->userAdjust( $ts, $timecorrection ); |
1439 | 1439 | } |
1440 | 1440 | $df = $this->getDateFormatString( 'time', $this->dateFormat( $format ) ); |
1441 | 1441 | return $this->sprintfDate( $df, $ts ); |
— | — | @@ -1453,8 +1453,8 @@ |
1454 | 1454 | */ |
1455 | 1455 | function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false) { |
1456 | 1456 | $ts = wfTimestamp( TS_MW, $ts ); |
1457 | | - if ( $adj ) { |
1458 | | - $ts = $this->userAdjust( $ts, $timecorrection ); |
| 1457 | + if ( $adj ) { |
| 1458 | + $ts = $this->userAdjust( $ts, $timecorrection ); |
1459 | 1459 | } |
1460 | 1460 | $df = $this->getDateFormatString( 'both', $this->dateFormat( $format ) ); |
1461 | 1461 | return $this->sprintfDate( $df, $ts ); |
— | — | @@ -1486,25 +1486,25 @@ |
1487 | 1487 | function ucwordbreaksCallbackAscii($matches){ |
1488 | 1488 | return $this->ucfirst($matches[1]); |
1489 | 1489 | } |
1490 | | - |
| 1490 | + |
1491 | 1491 | function ucwordbreaksCallbackMB($matches){ |
1492 | 1492 | return mb_strtoupper($matches[0]); |
1493 | 1493 | } |
1494 | | - |
| 1494 | + |
1495 | 1495 | function ucCallback($matches){ |
1496 | 1496 | list( $wikiUpperChars ) = self::getCaseMaps(); |
1497 | 1497 | return strtr( $matches[1], $wikiUpperChars ); |
1498 | 1498 | } |
1499 | | - |
| 1499 | + |
1500 | 1500 | function lcCallback($matches){ |
1501 | 1501 | list( , $wikiLowerChars ) = self::getCaseMaps(); |
1502 | 1502 | return strtr( $matches[1], $wikiLowerChars ); |
1503 | 1503 | } |
1504 | | - |
| 1504 | + |
1505 | 1505 | function ucwordsCallbackMB($matches){ |
1506 | 1506 | return mb_strtoupper($matches[0]); |
1507 | 1507 | } |
1508 | | - |
| 1508 | + |
1509 | 1509 | function ucwordsCallbackWiki($matches){ |
1510 | 1510 | list( $wikiUpperChars ) = self::getCaseMaps(); |
1511 | 1511 | return strtr( $matches[0], $wikiUpperChars ); |
— | — | @@ -1518,7 +1518,7 @@ |
1519 | 1519 | return ucfirst($str); |
1520 | 1520 | } else { |
1521 | 1521 | // fall back to more complex logic in case of multibyte strings |
1522 | | - return self::uc($str,true); |
| 1522 | + return self::uc($str,true); |
1523 | 1523 | } |
1524 | 1524 | } |
1525 | 1525 | |
— | — | @@ -1547,7 +1547,7 @@ |
1548 | 1548 | } |
1549 | 1549 | } |
1550 | 1550 | } |
1551 | | - |
| 1551 | + |
1552 | 1552 | function lcfirst( $str ) { |
1553 | 1553 | $o = ord( $str ); |
1554 | 1554 | if ( !$o ) { |
— | — | @@ -1602,7 +1602,7 @@ |
1603 | 1603 | array($this,"ucwordsCallbackMB"), |
1604 | 1604 | $str |
1605 | 1605 | ); |
1606 | | - else |
| 1606 | + else |
1607 | 1607 | return preg_replace_callback( |
1608 | 1608 | $replaceRegexp, |
1609 | 1609 | array($this,"ucwordsCallbackWiki"), |
— | — | @@ -1630,7 +1630,7 @@ |
1631 | 1631 | array($this,"ucwordbreaksCallbackMB"), |
1632 | 1632 | $str |
1633 | 1633 | ); |
1634 | | - else |
| 1634 | + else |
1635 | 1635 | return preg_replace_callback( |
1636 | 1636 | $replaceRegexp, |
1637 | 1637 | array($this,"ucwordsCallbackWiki"), |
— | — | @@ -1647,7 +1647,7 @@ |
1648 | 1648 | /** |
1649 | 1649 | * Return a case-folded representation of $s |
1650 | 1650 | * |
1651 | | - * This is a representation such that caseFold($s1)==caseFold($s2) if $s1 |
| 1651 | + * This is a representation such that caseFold($s1)==caseFold($s2) if $s1 |
1652 | 1652 | * and $s2 are the same except for the case of their characters. It is not |
1653 | 1653 | * necessary for the value returned to make sense when displayed. |
1654 | 1654 | * |
— | — | @@ -1677,7 +1677,7 @@ |
1678 | 1678 | function fallback8bitEncoding() { |
1679 | 1679 | return self::$dataCache->getItem( $this->mCode, 'fallback8bitEncoding' ); |
1680 | 1680 | } |
1681 | | - |
| 1681 | + |
1682 | 1682 | /** |
1683 | 1683 | * Most writing systems use whitespace to break up words. |
1684 | 1684 | * Some languages such as Chinese don't conventionally do this, |
— | — | @@ -1687,7 +1687,7 @@ |
1688 | 1688 | function hasWordBreaks() { |
1689 | 1689 | return true; |
1690 | 1690 | } |
1691 | | - |
| 1691 | + |
1692 | 1692 | /** |
1693 | 1693 | * Some languages have special punctuation to strip out |
1694 | 1694 | * or characters which need to be converted for MySQL's |
— | — | @@ -1703,14 +1703,14 @@ |
1704 | 1704 | } |
1705 | 1705 | |
1706 | 1706 | wfProfileIn( __METHOD__ ); |
1707 | | - |
| 1707 | + |
1708 | 1708 | // MySQL fulltext index doesn't grok utf-8, so we |
1709 | 1709 | // need to fold cases and convert to hex |
1710 | 1710 | $out = preg_replace_callback( |
1711 | 1711 | "/([\\xc0-\\xff][\\x80-\\xbf]*)/", |
1712 | 1712 | array( $this, 'stripForSearchCallback' ), |
1713 | 1713 | $this->lc( $string ) ); |
1714 | | - |
| 1714 | + |
1715 | 1715 | // And to add insult to injury, the default indexing |
1716 | 1716 | // ignores short words... Pad them so we can pass them |
1717 | 1717 | // through without reconfiguring the server... |
— | — | @@ -1722,7 +1722,7 @@ |
1723 | 1723 | "$1u800", |
1724 | 1724 | $out ); |
1725 | 1725 | } |
1726 | | - |
| 1726 | + |
1727 | 1727 | // Periods within things like hostnames and IP addresses |
1728 | 1728 | // are also important -- we want a search for "example.com" |
1729 | 1729 | // or "192.168.1.1" to work sanely. |
— | — | @@ -1733,11 +1733,11 @@ |
1734 | 1734 | "/(\w)\.(\w|\*)/u", |
1735 | 1735 | "$1u82e$2", |
1736 | 1736 | $out ); |
1737 | | - |
| 1737 | + |
1738 | 1738 | wfProfileOut( __METHOD__ ); |
1739 | 1739 | return $out; |
1740 | 1740 | } |
1741 | | - |
| 1741 | + |
1742 | 1742 | /** |
1743 | 1743 | * Armor a case-folded UTF-8 string to get through MySQL's |
1744 | 1744 | * fulltext search without being mucked up by funny charset |
— | — | @@ -1746,7 +1746,7 @@ |
1747 | 1747 | protected function stripForSearchCallback( $matches ) { |
1748 | 1748 | return 'u8' . bin2hex( $matches[1] ); |
1749 | 1749 | } |
1750 | | - |
| 1750 | + |
1751 | 1751 | /** |
1752 | 1752 | * Check MySQL server's ft_min_word_len setting so we know |
1753 | 1753 | * if we need to pad short words... |
— | — | @@ -1758,7 +1758,7 @@ |
1759 | 1759 | $result = $dbr->query( $sql ); |
1760 | 1760 | $row = $result->fetchObject(); |
1761 | 1761 | $result->free(); |
1762 | | - |
| 1762 | + |
1763 | 1763 | if( $row && $row->Variable_name == 'ft_min_word_len' ) { |
1764 | 1764 | $this->minSearchLength = intval( $row->Value ); |
1765 | 1765 | } else { |
— | — | @@ -1791,7 +1791,7 @@ |
1792 | 1792 | } |
1793 | 1793 | |
1794 | 1794 | /** |
1795 | | - * Get the first character of a string. |
| 1795 | + * Get the first character of a string. |
1796 | 1796 | * |
1797 | 1797 | * @param $s string |
1798 | 1798 | * @return string |
— | — | @@ -1805,7 +1805,7 @@ |
1806 | 1806 | if ( strlen( $matches[1] ) != 3 ) { |
1807 | 1807 | return $matches[1]; |
1808 | 1808 | } |
1809 | | - |
| 1809 | + |
1810 | 1810 | // Break down Hangul syllables to grab the first jamo |
1811 | 1811 | $code = utf8ToCodepoint( $matches[1] ); |
1812 | 1812 | if ( $code < 0xac00 || 0xd7a4 <= $code) { |
— | — | @@ -1884,7 +1884,7 @@ |
1885 | 1885 | |
1886 | 1886 | /** |
1887 | 1887 | * Convert a UTF-8 string to normal form C. In Malayalam and Arabic, this |
1888 | | - * also cleans up certain backwards-compatible sequences, converting them |
| 1888 | + * also cleans up certain backwards-compatible sequences, converting them |
1889 | 1889 | * to the modern Unicode equivalent. |
1890 | 1890 | * |
1891 | 1891 | * This is language-specific for performance reasons only. |
— | — | @@ -1896,9 +1896,9 @@ |
1897 | 1897 | /** |
1898 | 1898 | * Transform a string using serialized data stored in the given file (which |
1899 | 1899 | * must be in the serialized subdirectory of $IP). The file contains pairs |
1900 | | - * mapping source characters to destination characters. |
| 1900 | + * mapping source characters to destination characters. |
1901 | 1901 | * |
1902 | | - * The data is cached in process memory. This will go faster if you have the |
| 1902 | + * The data is cached in process memory. This will go faster if you have the |
1903 | 1903 | * FastStringSearch extension. |
1904 | 1904 | */ |
1905 | 1905 | function transformUsingPairFile( $file, $string ) { |
— | — | @@ -1917,10 +1917,10 @@ |
1918 | 1918 | * |
1919 | 1919 | * @return bool |
1920 | 1920 | */ |
1921 | | - function isRTL() { |
| 1921 | + function isRTL() { |
1922 | 1922 | return self::$dataCache->getItem( $this->mCode, 'rtl' ); |
1923 | 1923 | } |
1924 | | - |
| 1924 | + |
1925 | 1925 | /** |
1926 | 1926 | * Return the correct HTML 'dir' attribute value for this language. |
1927 | 1927 | * @return String |
— | — | @@ -1928,7 +1928,7 @@ |
1929 | 1929 | function getDir() { |
1930 | 1930 | return $this->isRTL() ? 'rtl' : 'ltr'; |
1931 | 1931 | } |
1932 | | - |
| 1932 | + |
1933 | 1933 | /** |
1934 | 1934 | * Return 'left' or 'right' as appropriate alignment for line-start |
1935 | 1935 | * for this language's text direction. |
— | — | @@ -1940,7 +1940,7 @@ |
1941 | 1941 | function alignStart() { |
1942 | 1942 | return $this->isRTL() ? 'right' : 'left'; |
1943 | 1943 | } |
1944 | | - |
| 1944 | + |
1945 | 1945 | /** |
1946 | 1946 | * Return 'right' or 'left' as appropriate alignment for line-end |
1947 | 1947 | * for this language's text direction. |
— | — | @@ -2044,7 +2044,7 @@ |
2045 | 2045 | // Cache aliases because it may be slow to load them |
2046 | 2046 | if ( is_null( $this->mExtendedSpecialPageAliases ) ) { |
2047 | 2047 | // Initialise array |
2048 | | - $this->mExtendedSpecialPageAliases = |
| 2048 | + $this->mExtendedSpecialPageAliases = |
2049 | 2049 | self::$dataCache->getItem( $this->mCode, 'specialPageAliases' ); |
2050 | 2050 | wfRunHooks( 'LanguageGetSpecialPageAliases', |
2051 | 2051 | array( &$this->mExtendedSpecialPageAliases, $this->getCode() ) ); |
— | — | @@ -2205,7 +2205,7 @@ |
2206 | 2206 | * are included, otherwise broken characters can be passed to the user |
2207 | 2207 | * |
2208 | 2208 | * If $length is negative, the string will be truncated from the beginning |
2209 | | - * |
| 2209 | + * |
2210 | 2210 | * @param $string String to truncate |
2211 | 2211 | * @param $length Int: maximum length (excluding ellipses) |
2212 | 2212 | * @param $ellipsis String to append to the truncated text |
— | — | @@ -2380,7 +2380,7 @@ |
2381 | 2381 | } |
2382 | 2382 | |
2383 | 2383 | # Put custom tags (e.g. -{ }-) around math to prevent conversion |
2384 | | - function armourMath($text){ |
| 2384 | + function armourMath($text){ |
2385 | 2385 | return $this->mConverter->armourMath($text); |
2386 | 2386 | } |
2387 | 2387 | |
— | — | @@ -2509,7 +2509,7 @@ |
2510 | 2510 | static function getFileName( $prefix = 'Language', $code, $suffix = '.php' ) { |
2511 | 2511 | return $prefix . str_replace( '-', '_', ucfirst( $code ) ) . $suffix; |
2512 | 2512 | } |
2513 | | - |
| 2513 | + |
2514 | 2514 | /** |
2515 | 2515 | * Get the language code from a file name. Inverse of getFileName() |
2516 | 2516 | * @param $filename string $prefix . $languageCode . $suffix |
— | — | @@ -2536,7 +2536,7 @@ |
2537 | 2537 | global $IP; |
2538 | 2538 | return self::getFileName( "$IP/languages/classes/Language", $code, '.php' ); |
2539 | 2539 | } |
2540 | | - |
| 2540 | + |
2541 | 2541 | /** |
2542 | 2542 | * Get the fallback for a given language |
2543 | 2543 | */ |
— | — | @@ -2549,7 +2549,7 @@ |
2550 | 2550 | } |
2551 | 2551 | } |
2552 | 2552 | |
2553 | | - /** |
| 2553 | + /** |
2554 | 2554 | * Get all messages for a given language |
2555 | 2555 | * WARNING: this may take a long time |
2556 | 2556 | */ |
— | — | @@ -2557,7 +2557,7 @@ |
2558 | 2558 | return self::getLocalisationCache()->getItem( $code, 'messages' ); |
2559 | 2559 | } |
2560 | 2560 | |
2561 | | - /** |
| 2561 | + /** |
2562 | 2562 | * Get a message for a given language |
2563 | 2563 | */ |
2564 | 2564 | static function getMessageFor( $key, $code ) { |
— | — | @@ -2571,10 +2571,10 @@ |
2572 | 2572 | $talk = str_replace( '$1', $wgMetaNamespace, $talk ); |
2573 | 2573 | |
2574 | 2574 | # Allow grammar transformations |
2575 | | - # Allowing full message-style parsing would make simple requests |
2576 | | - # such as action=raw much more expensive than they need to be. |
| 2575 | + # Allowing full message-style parsing would make simple requests |
| 2576 | + # such as action=raw much more expensive than they need to be. |
2577 | 2577 | # This will hopefully cover most cases. |
2578 | | - $talk = preg_replace_callback( '/{{grammar:(.*?)\|(.*?)}}/i', |
| 2578 | + $talk = preg_replace_callback( '/{{grammar:(.*?)\|(.*?)}}/i', |
2579 | 2579 | array( &$this, 'replaceGrammarInNamespace' ), $talk ); |
2580 | 2580 | return str_replace( ' ', '_', $talk ); |
2581 | 2581 | } |
— | — | @@ -2592,7 +2592,7 @@ |
2593 | 2593 | wfProfileIn( __METHOD__ ); |
2594 | 2594 | $arr = wfGetPrecompiledData( 'Utf8Case.ser' ); |
2595 | 2595 | if ( $arr === false ) { |
2596 | | - throw new MWException( |
| 2596 | + throw new MWException( |
2597 | 2597 | "Utf8Case.ser is missing, please run \"make\" in the serialized directory\n" ); |
2598 | 2598 | } |
2599 | 2599 | extract( $arr ); |
— | — | @@ -2606,13 +2606,13 @@ |
2607 | 2607 | } elseif ( $seconds < 60 ) { |
2608 | 2608 | return $this->formatNum( round( $seconds ) ) . wfMsg( 'seconds-abbrev' ); |
2609 | 2609 | } elseif ( $seconds < 3600 ) { |
2610 | | - return $this->formatNum( floor( $seconds / 60 ) ) . wfMsg( 'minutes-abbrev' ) . |
| 2610 | + return $this->formatNum( floor( $seconds / 60 ) ) . wfMsg( 'minutes-abbrev' ) . |
2611 | 2611 | $this->formatNum( round( fmod( $seconds, 60 ) ) ) . wfMsg( 'seconds-abbrev' ); |
2612 | 2612 | } else { |
2613 | 2613 | $hours = floor( $seconds / 3600 ); |
2614 | 2614 | $minutes = floor( ( $seconds - $hours * 3600 ) / 60 ); |
2615 | 2615 | $secondsPart = round( $seconds - $hours * 3600 - $minutes * 60 ); |
2616 | | - return $this->formatNum( $hours ) . wfMsg( 'hours-abbrev' ) . |
| 2616 | + return $this->formatNum( $hours ) . wfMsg( 'hours-abbrev' ) . |
2617 | 2617 | $this->formatNum( $minutes ) . wfMsg( 'minutes-abbrev' ) . |
2618 | 2618 | $this->formatNum( $secondsPart ) . wfMsg( 'seconds-abbrev' ); |
2619 | 2619 | } |