r70131 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70130‎ | r70131 | r70132 >
Date:09:43, 29 July 2010
Author:reedy
Status:ok
Tags:
Comment:
Stylize languages/*, languages/classes/*, but not languages/messages/*
Modified paths:
  • /trunk/phase3/languages/Language.php (modified) (history)
  • /trunk/phase3/languages/LanguageConverter.php (modified) (history)
  • /trunk/phase3/languages/Names.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageAm.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageAr.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageBat_smg.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageBe.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageBe_tarask.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageBg.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageBh.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageBs.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageCs.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageCu.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageCy.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageDsb.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageEo.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageEt.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageFi.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageFr.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageGa.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageGan.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageGd.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageGv.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageHe.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageHi.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageHr.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageHsb.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageHu.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageHy.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageKaa.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageKk.deps.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageKk.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageKk_cyrl.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageKm.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageKsh.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageKu.deps.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageKu.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageKu_ku.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageLa.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageLn.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageLt.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageLv.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageMg.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageMk.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageMl.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageMo.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageMt.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageMy.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageNso.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguagePl.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageRo.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageRu.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageSe.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageSh.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageSk.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageSl.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageSma.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageSr.deps.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageSr.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageSr_ec.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageSr_el.deps.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageSr_el.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageTg.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageTi.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageTl.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageTr.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageTyv.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageUk.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageWa.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageYue.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageZh.deps.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageZh.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/Language.php
@@ -6,7 +6,7 @@
77 * @ingroup Language
88 */
99
10 -if( !defined( 'MEDIAWIKI' ) ) {
 10+if ( !defined( 'MEDIAWIKI' ) ) {
1111 echo "This file is part of MediaWiki, it is not a valid entry point.\n";
1212 exit( 1 );
1313 }
@@ -23,7 +23,7 @@
2424 $wgInputEncoding = 'UTF-8';
2525 $wgOutputEncoding = 'UTF-8';
2626
27 -if( function_exists( 'mb_strtoupper' ) ) {
 27+if ( function_exists( 'mb_strtoupper' ) ) {
2828 mb_internal_encoding( 'UTF-8' );
2929 }
3030
@@ -41,7 +41,7 @@
4242 function getVariants() { return array( $this->mLang->getCode() ); }
4343 function getPreferredVariant() { return $this->mLang->getCode(); }
4444 function getConvRuleTitle() { return false; }
45 - function findVariantLink( &$l, &$n, $ignoreOtherCond = false ) {}
 45+ function findVariantLink( &$l, &$n, $ignoreOtherCond = false ) { }
4646 function getExtraHashOptions() { return ''; }
4747 function getParsedTitle() { return ''; }
4848 function markNoConversion( $text, $noParse = false ) { return $text; }
@@ -129,7 +129,7 @@
130130 */
131131 static function factory( $code ) {
132132 if ( !isset( self::$mLangObjCache[$code] ) ) {
133 - if( count( self::$mLangObjCache ) > 10 ) {
 133+ if ( count( self::$mLangObjCache ) > 10 ) {
134134 // Don't keep a billion objects around, that's stupid.
135135 self::$mLangObjCache = array();
136136 }
@@ -161,7 +161,7 @@
162162 throw new MWException( "Language fallback loop detected when creating class $class\n" );
163163 }
164164
165 - if( !class_exists( $class ) ) {
 165+ if ( !class_exists( $class ) ) {
166166 $fallback = Language::getFallbackFor( $code );
167167 ++$recursionLevel;
168168 $lang = Language::newFromCode( $fallback );
@@ -209,7 +209,7 @@
210210 * Hook which will be called if this is the content language.
211211 * Descendants can use this to register hook functions or modify globals
212212 */
213 - function initContLang() {}
 213+ function initContLang() { }
214214
215215 /**
216216 * @deprecated Use User::getDefaultOptions()
@@ -274,7 +274,7 @@
275275 */
276276 function getFormattedNamespaces() {
277277 $ns = $this->getNamespaces();
278 - foreach( $ns as $k => $v ) {
 278+ foreach ( $ns as $k => $v ) {
279279 $ns[$k] = strtr( $v, '_', ' ' );
280280 }
281281 return $ns;
@@ -464,7 +464,7 @@
465465 global $IP;
466466 $names = array();
467467 $dir = opendir( "$IP/languages/messages" );
468 - while( false !== ( $file = readdir( $dir ) ) ) {
 468+ while ( false !== ( $file = readdir( $dir ) ) ) {
469469 $code = self::getCodeFromFileName( $file, 'Messages' );
470470 if ( $code && isset( $allNames[$code] ) ) {
471471 $names[$code] = $allNames[$code];
@@ -558,15 +558,15 @@
559559
560560 $minDiff = 0;
561561 if ( $data[0] == 'System' || $tz == '' ) {
562 - # Global offset in minutes.
563 - if( isset( $wgLocalTZoffset ) ) {
 562+ #  Global offset in minutes.
 563+ if ( isset( $wgLocalTZoffset ) ) {
564564 $minDiff = $wgLocalTZoffset;
565565 }
566566 } else if ( $data[0] == 'Offset' ) {
567567 $minDiff = intval( $data[1] );
568568 } else {
569569 $data = explode( ':', $tz );
570 - if( count( $data ) == 2 ) {
 570+ if ( count( $data ) == 2 ) {
571571 $data[0] = intval( $data[0] );
572572 $data[1] = intval( $data[1] );
573573 $minDiff = abs( $data[0] ) * 60 + $data[1];
@@ -588,12 +588,12 @@
589589 # will normalize out-of-range values so we don't have to split $minDiff
590590 # into hours and minutes.
591591 $t = mktime( (
592 - (int)substr( $ts, 8, 2) ), # Hours
 592+ (int)substr( $ts, 8, 2 ) ), # Hours
593593 (int)substr( $ts, 10, 2 ) + $minDiff, # Minutes
594594 (int)substr( $ts, 12, 2 ), # Seconds
595595 (int)substr( $ts, 4, 2 ), # Month
596596 (int)substr( $ts, 6, 2 ), # Day
597 - (int)substr( $ts, 0, 4 ) ); #Year
 597+ (int)substr( $ts, 0, 4 ) ); # Year
598598
599599 $date = date( 'YmdHis', $t );
600600 wfRestoreWarnings();
@@ -967,7 +967,7 @@
968968 } elseif ( $roman ) {
969969 $s .= self::romanNumeral( $num );
970970 $roman = false;
971 - } elseif( $hebrewNum ) {
 971+ } elseif ( $hebrewNum ) {
972972 $s .= self::hebrewNumeral( $num );
973973 $hebrewNum = false;
974974 } else {
@@ -1002,12 +1002,12 @@
10031003
10041004
10051005 // Add days of the past months of this year
1006 - for( $i = 0; $i < $gm; $i++ ) {
 1006+ for ( $i = 0; $i < $gm; $i++ ) {
10071007 $gDayNo += self::$GREG_DAYS[$i];
10081008 }
10091009
10101010 // Leap years
1011 - if ( $gm > 1 && ( ( $gy%4 === 0 && $gy%100 !== 0 || ( $gy%400 == 0 ) ) ) ) {
 1011+ if ( $gm > 1 && ( ( $gy % 4 === 0 && $gy % 100 !== 0 || ( $gy % 400 == 0 ) ) ) ) {
10121012 $gDayNo++;
10131013 }
10141014
@@ -1068,11 +1068,11 @@
10691069 (int)( ( 275 * $zm ) / 9 ) + $zd + 1729777;
10701070 }
10711071
1072 - $zl = $zjd-1948440 + 10632;
 1072+ $zl = $zjd -1948440 + 10632;
10731073 $zn = (int)( ( $zl - 1 ) / 10631 );
10741074 $zl = $zl - 10631 * $zn + 354;
1075 - $zj = ( (int)( ( 10985 - $zl ) / 5316 ) ) * ((int)( ( 50 * $zl ) / 17719 ) ) + ( (int)( $zl / 5670 ) ) * ( (int)( ( 43 * $zl ) / 15238 ) );
1076 - $zl = $zl - ( (int)( ( 30 - $zj ) / 15 ) ) * ((int)( ( 17719 * $zj ) / 50 ) ) - ( (int)( $zj / 16 ) ) * ( (int)( ( 15238 * $zj ) / 43 ) ) + 29;
 1075+ $zj = ( (int)( ( 10985 - $zl ) / 5316 ) ) * ( (int)( ( 50 * $zl ) / 17719 ) ) + ( (int)( $zl / 5670 ) ) * ( (int)( ( 43 * $zl ) / 15238 ) );
 1076+ $zl = $zl - ( (int)( ( 30 - $zj ) / 15 ) ) * ( (int)( ( 17719 * $zj ) / 50 ) ) - ( (int)( $zj / 16 ) ) * ( (int)( ( 15238 * $zj ) / 43 ) ) + 29;
10771077 $zm = (int)( ( 24 * $zl ) / 709 );
10781078 $zd = $zl - (int)( ( 709 * $zm ) / 24 );
10791079 $zy = 30 * $zn + $zj - 30;
@@ -1102,7 +1102,7 @@
11031103
11041104 # Month number when September = 1, August = 12
11051105 $month += 4;
1106 - if( $month > 12 ) {
 1106+ if ( $month > 12 ) {
11071107 # Next year
11081108 $month -= 12;
11091109 $year++;
@@ -1111,15 +1111,15 @@
11121112
11131113 # Calculate day of year from 1 September
11141114 $dayOfYear = $day;
1115 - for( $i = 1; $i < $month; $i++ ) {
1116 - if( $i == 6 ) {
 1115+ for ( $i = 1; $i < $month; $i++ ) {
 1116+ if ( $i == 6 ) {
11171117 # February
11181118 $dayOfYear += 28;
11191119 # Check if the year is leap
1120 - if( $year % 400 == 0 || ( $year % 4 == 0 && $year % 100 > 0 ) ) {
 1120+ if ( $year % 400 == 0 || ( $year % 4 == 0 && $year % 100 > 0 ) ) {
11211121 $dayOfYear++;
11221122 }
1123 - } elseif( $i == 8 || $i == 10 || $i == 1 || $i == 3 ) {
 1123+ } elseif ( $i == 8 || $i == 10 || $i == 1 || $i == 3 ) {
11241124 $dayOfYear += 30;
11251125 } else {
11261126 $dayOfYear += 31;
@@ -1130,7 +1130,7 @@
11311131 $start = self::hebrewYearStart( $hebrewYear );
11321132
11331133 # Calculate next year's start
1134 - if( $dayOfYear <= $start ) {
 1134+ if ( $dayOfYear <= $start ) {
11351135 # Day is before the start of the year - it is the previous year
11361136 # Next year's start
11371137 $nextStart = $start;
@@ -1139,7 +1139,7 @@
11401140 $hebrewYear--;
11411141 # Add days since previous year's 1 September
11421142 $dayOfYear += 365;
1143 - if( ( $year % 400 == 0 ) || ( $year % 100 != 0 && $year % 4 == 0 ) ) {
 1143+ if ( ( $year % 400 == 0 ) || ( $year % 100 != 0 && $year % 4 == 0 ) ) {
11441144 # Leap year
11451145 $dayOfYear++;
11461146 }
@@ -1158,7 +1158,7 @@
11591159 # Add 12 (or 13 for leap years) days to ignore the difference between
11601160 # Hebrew and Gregorian year (353 at least vs. 365/6) - now the
11611161 # difference is only about the year type
1162 - if( ( $year % 400 == 0 ) || ( $year % 100 != 0 && $year % 4 == 0 ) ) {
 1162+ if ( ( $year % 400 == 0 ) || ( $year % 100 != 0 && $year % 4 == 0 ) ) {
11631163 $diff += 13;
11641164 } else {
11651165 $diff += 12;
@@ -1178,14 +1178,14 @@
11791179 $hebrewDay = $hebrewDayOfYear;
11801180 $hebrewMonth = 1;
11811181 $days = 0;
1182 - while( $hebrewMonth <= 12 ) {
 1182+ while ( $hebrewMonth <= 12 ) {
11831183 # Calculate days in this month
1184 - if( $isLeap && $hebrewMonth == 6 ) {
 1184+ if ( $isLeap && $hebrewMonth == 6 ) {
11851185 # Adar in a leap year
1186 - if( $isLeap ) {
 1186+ if ( $isLeap ) {
11871187 # Leap year - has Adar I, with 30 days, and Adar II, with 29 days
11881188 $days = 30;
1189 - if( $hebrewDay <= $days ) {
 1189+ if ( $hebrewDay <= $days ) {
11901190 # Day in Adar I
11911191 $hebrewMonth = 13;
11921192 } else {
@@ -1193,23 +1193,23 @@
11941194 $hebrewDay -= $days;
11951195 # Try Adar II
11961196 $days = 29;
1197 - if( $hebrewDay <= $days ) {
 1197+ if ( $hebrewDay <= $days ) {
11981198 # Day in Adar II
11991199 $hebrewMonth = 14;
12001200 }
12011201 }
12021202 }
1203 - } elseif( $hebrewMonth == 2 && $yearPattern == 2 ) {
 1203+ } elseif ( $hebrewMonth == 2 && $yearPattern == 2 ) {
12041204 # Cheshvan in a complete year (otherwise as the rule below)
12051205 $days = 30;
1206 - } elseif( $hebrewMonth == 3 && $yearPattern == 0 ) {
 1206+ } elseif ( $hebrewMonth == 3 && $yearPattern == 0 ) {
12071207 # Kislev in an incomplete year (otherwise as the rule below)
12081208 $days = 29;
12091209 } else {
12101210 # Odd months have 30 days, even have 29
12111211 $days = 30 - ( $hebrewMonth - 1 ) % 2;
12121212 }
1213 - if( $hebrewDay <= $days ) {
 1213+ if ( $hebrewDay <= $days ) {
12141214 # In the current month
12151215 break;
12161216 } else {
@@ -1232,21 +1232,21 @@
12331233 $a = intval( ( 12 * ( $year - 1 ) + 17 ) % 19 );
12341234 $b = intval( ( $year - 1 ) % 4 );
12351235 $m = 32.044093161144 + 1.5542417966212 * $a + $b / 4.0 - 0.0031777940220923 * ( $year - 1 );
1236 - if( $m < 0 ) {
 1236+ if ( $m < 0 ) {
12371237 $m--;
12381238 }
12391239 $Mar = intval( $m );
1240 - if( $m < 0 ) {
 1240+ if ( $m < 0 ) {
12411241 $m++;
12421242 }
12431243 $m -= $Mar;
12441244
1245 - $c = intval( ( $Mar + 3 * ( $year - 1 ) + 5 * $b + 5 ) % 7);
1246 - if( $c == 0 && $a > 11 && $m >= 0.89772376543210 ) {
 1245+ $c = intval( ( $Mar + 3 * ( $year - 1 ) + 5 * $b + 5 ) % 7 );
 1246+ if ( $c == 0 && $a > 11 && $m >= 0.89772376543210 ) {
12471247 $Mar++;
1248 - } else if( $c == 1 && $a > 6 && $m >= 0.63287037037037 ) {
 1248+ } else if ( $c == 1 && $a > 6 && $m >= 0.63287037037037 ) {
12491249 $Mar += 2;
1250 - } else if( $c == 2 || $c == 4 || $c == 6 ) {
 1250+ } else if ( $c == 2 || $c == 4 || $c == 6 ) {
12511251 $Mar++;
12521252 }
12531253
@@ -1388,14 +1388,14 @@
13891389 $num = 0;
13901390 } else {
13911391 $s .= $table[$i][intval( ( $num / $pow10 ) )];
1392 - if( $pow10 == 1000 ) {
 1392+ if ( $pow10 == 1000 ) {
13931393 $s .= "'";
13941394 }
13951395 }
13961396 }
13971397 $num = $num % $pow10;
13981398 }
1399 - if( strlen( $s ) == 2 ) {
 1399+ if ( strlen( $s ) == 2 ) {
14001400 $str = $s . "'";
14011401 } else {
14021402 $str = substr( $s, 0, strlen( $s ) - 2 ) . '"';
@@ -1443,8 +1443,8 @@
14441444 function dateFormat( $usePrefs = true ) {
14451445 global $wgUser;
14461446
1447 - if( is_bool( $usePrefs ) ) {
1448 - if( $usePrefs ) {
 1447+ if ( is_bool( $usePrefs ) ) {
 1448+ if ( $usePrefs ) {
14491449 $datePreference = $wgUser->getDatePreference();
14501450 } else {
14511451 $datePreference = (string)User::getDefaultOption( 'date' );
@@ -1454,7 +1454,7 @@
14551455 }
14561456
14571457 // return int
1458 - if( $datePreference == '' ) {
 1458+ if ( $datePreference == '' ) {
14591459 return 'default';
14601460 }
14611461
@@ -1530,7 +1530,7 @@
15311531 * validateTimeZone() in Special:Preferences
15321532 * @return string
15331533 */
1534 - function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false) {
 1534+ function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false ) {
15351535 $ts = wfTimestamp( TS_MW, $ts );
15361536 if ( $adj ) {
15371537 $ts = $this->userAdjust( $ts, $timecorrection );
@@ -1746,18 +1746,18 @@
17471747 }
17481748
17491749 function checkTitleEncoding( $s ) {
1750 - if( is_array( $s ) ) {
 1750+ if ( is_array( $s ) ) {
17511751 wfDebugDieBacktrace( 'Given array to checkTitleEncoding.' );
17521752 }
17531753 # Check for non-UTF-8 URLs
1754 - $ishigh = preg_match( '/[\x80-\xff]/', $s);
1755 - if( !$ishigh ) {
 1754+ $ishigh = preg_match( '/[\x80-\xff]/', $s );
 1755+ if ( !$ishigh ) {
17561756 return $s;
17571757 }
17581758
17591759 $isutf8 = preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
17601760 '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s );
1761 - if( $isutf8 ) {
 1761+ if ( $isutf8 ) {
17621762 return $s;
17631763 }
17641764
@@ -1797,7 +1797,7 @@
17981798 * @return String
17991799 */
18001800 function normalizeForSearch( $string ) {
1801 - return self::convertDoubleWidth($string);
 1801+ return self::convertDoubleWidth( $string );
18021802 }
18031803
18041804 /**
@@ -1808,7 +1808,7 @@
18091809 static $full = null;
18101810 static $half = null;
18111811
1812 - if( $full === null ) {
 1812+ if ( $full === null ) {
18131813 $fullWidth = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
18141814 $halfWidth = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
18151815 $full = str_split( $fullWidth, 3 );
@@ -1904,7 +1904,7 @@
19051905 # wgInputEncoding, this text will be further converted
19061906 # to wgOutputEncoding.
19071907 global $wgEditEncoding;
1908 - if( $wgEditEncoding == '' || $wgEditEncoding == 'UTF-8' ) {
 1908+ if ( $wgEditEncoding == '' || $wgEditEncoding == 'UTF-8' ) {
19091909 return $s;
19101910 } else {
19111911 return $this->iconv( 'UTF-8', $wgEditEncoding, $s );
@@ -1914,12 +1914,12 @@
19151915 function recodeInput( $s ) {
19161916 # Take the previous into account.
19171917 global $wgEditEncoding;
1918 - if( $wgEditEncoding != '' ) {
 1918+ if ( $wgEditEncoding != '' ) {
19191919 $enc = $wgEditEncoding;
19201920 } else {
19211921 $enc = 'UTF-8';
19221922 }
1923 - if( $enc == 'UTF-8' ) {
 1923+ if ( $enc == 'UTF-8' ) {
19241924 return $s;
19251925 } else {
19261926 return $this->iconv( $enc, 'UTF-8', $s );
@@ -2058,7 +2058,7 @@
20592059 }
20602060 }
20612061
2062 - if( !is_array( $rawEntry ) ) {
 2062+ if ( !is_array( $rawEntry ) ) {
20632063 error_log( "\"$rawEntry\" is not a valid magic thingie for \"$mw->mId\"" );
20642064 } else {
20652065 $mw->mCaseSensitive = $rawEntry[0];
@@ -2179,7 +2179,7 @@
21802180 * @param $_ mixed
21812181 * @return string
21822182 */
2183 - function commafy($_) {
 2183+ function commafy( $_ ) {
21842184 return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
21852185 }
21862186
@@ -2202,13 +2202,13 @@
22032203 function listToText( $l ) {
22042204 $s = '';
22052205 $m = count( $l ) - 1;
2206 - if( $m == 1 ) {
 2206+ if ( $m == 1 ) {
22072207 return $l[0] . $this->getMessageFromDB( 'and' ) . $this->getMessageFromDB( 'word-separator' ) . $l[1];
22082208 } else {
22092209 for ( $i = $m; $i >= 0; $i-- ) {
22102210 if ( $i == $m ) {
22112211 $s = $l[$i];
2212 - } else if( $i == $m - 1 ) {
 2212+ } else if ( $i == $m - 1 ) {
22132213 $s = $l[$i] . $this->getMessageFromDB( 'and' ) . $this->getMessageFromDB( 'word-separator' ) . $s;
22142214 } else {
22152215 $s = $l[$i] . $this->getMessageFromDB( 'comma-separator' ) . $s;
@@ -2381,8 +2381,8 @@
23822382 $entityState = 0; // 0-not entity, 1-entity
23832383 $tag = $ret = $ch = '';
23842384 $openTags = array();
2385 - $textLen = strlen($text);
2386 - for( $pos = 0; $pos < $textLen; ++$pos ) {
 2385+ $textLen = strlen( $text );
 2386+ for ( $pos = 0; $pos < $textLen; ++$pos ) {
23872387 $ch = $text[$pos];
23882388 $lastCh = $pos ? $text[$pos - 1] : '';
23892389 $ret .= $ch; // add to result string
@@ -2460,7 +2460,7 @@
24612461 // like strcspn() but adds the skipped chars to $ret
24622462 private function truncate_skip( &$ret, $text, $search, $start, $len = -1 ) {
24632463 $skipCount = 0;
2464 - if( $start < strlen( $text ) ) {
 2464+ if ( $start < strlen( $text ) ) {
24652465 $skipCount = strcspn( $text, $search, $start, $len );
24662466 $ret .= substr( $text, $start, $skipCount );
24672467 }
@@ -2472,11 +2472,11 @@
24732473 // (b) clear $tag value
24742474 private function truncate_endBracket( &$tag, $tagType, $lastCh, &$openTags ) {
24752475 $tag = ltrim( $tag );
2476 - if( $tag != '' ) {
2477 - if( $tagType == 0 && $lastCh != '/' ) {
 2476+ if ( $tag != '' ) {
 2477+ if ( $tagType == 0 && $lastCh != '/' ) {
24782478 $openTags[] = $tag; // tag opened (didn't close itself)
2479 - } else if( $tagType == 1 ) {
2480 - if( $openTags && $tag == $openTags[count( $openTags ) - 1] ) {
 2479+ } else if ( $tagType == 1 ) {
 2480+ if ( $openTags && $tag == $openTags[count( $openTags ) - 1] ) {
24812481 array_pop( $openTags ); // tag closed
24822482 }
24832483 }
@@ -2574,7 +2574,7 @@
25752575 return $str;
25762576 }
25772577
2578 - foreach ( explode( ',', $scBlockExpiryOptions) as $option ) {
 2578+ foreach ( explode( ',', $scBlockExpiryOptions ) as $option ) {
25792579 if ( strpos( $option, ':' ) === false ) {
25802580 continue;
25812581 }
@@ -2905,13 +2905,13 @@
29062906 function formatSize( $size ) {
29072907 // For small sizes no decimal places necessary
29082908 $round = 0;
2909 - if( $size > 1024 ) {
 2909+ if ( $size > 1024 ) {
29102910 $size = $size / 1024;
2911 - if( $size > 1024 ) {
 2911+ if ( $size > 1024 ) {
29122912 $size = $size / 1024;
29132913 // For MB and bigger two decimal places are smarter
29142914 $round = 2;
2915 - if( $size > 1024 ) {
 2915+ if ( $size > 1024 ) {
29162916 $size = $size / 1024;
29172917 $msg = 'size-gigabytes';
29182918 } else {
Index: trunk/phase3/languages/Names.php
@@ -178,7 +178,7 @@
179179 'kri' => 'Krio', # Krio
180180 'krj' => 'Kinaray-a', # Kinaray-a
181181 'ks' => 'कश्मीरी - (كشميري)', # Kashmiri
182 - 'ksh' => 'Ripoarisch', # Ripuarian
 182+ 'ksh' => 'Ripoarisch', # Ripuarian
183183 'ku' => 'Kurdî', # Kurdish
184184 'ku-latn' => "\xE2\x80\xAAKurdî (latînî)\xE2\x80\xAC", # Northern Kurdish Latin script
185185 'ku-arab' => "\xE2\x80\xABكوردي (عەرەبی)\xE2\x80\xAC", # Northern Kurdish Arabic script
@@ -204,7 +204,7 @@
205205 'lzh' => '文言', # Literary Chinese -- (bug 8217) lzh instead of zh-classical, http://www.sil.org/iso639-3/codes.asp?order=639_3&letter=l
206206 'lzz' => 'Lazuri', # Laz
207207 'mai' => 'मैथिली', # Maithili
208 - 'map-bms' => 'Basa Banyumasan', # Banyumasan
 208+ 'map-bms' => 'Basa Banyumasan', # Banyumasan
209209 'mdf' => 'Мокшень', # Moksha
210210 'mg' => 'Malagasy', # Malagasy
211211 'mh' => 'Ebon', # Marshallese
@@ -278,7 +278,7 @@
279279 'rue' => 'русиньскый язык', # Rusyn
280280 'ruq' => 'Vlăheşte', # Megleno-Romanian (falls back to ruq-latn)
281281 'ruq-cyrl' => 'Влахесте', # Megleno-Romanian (Cyrillic script)
282 - #'ruq-grek' => 'Βλαεστε', # Megleno-Romanian (Greek script)
 282+ # 'ruq-grek' => 'Βλαεστε', # Megleno-Romanian (Greek script)
283283 'ruq-latn' => 'Vlăheşte', # Megleno-Romanian (Latin script)
284284 'rw' => 'Kinyarwanda', # Kinyarwanda, should possibly be Kinyarwandi
285285 'sa' => 'संस्कृत', # Sanskrit
Index: trunk/phase3/languages/classes/LanguageLn.php
@@ -10,9 +10,9 @@
1111
1212 */
1313 function convertPlural( $count, $forms ) {
14 - if ( !count($forms) ) { return ''; }
 14+ if ( !count( $forms ) ) { return ''; }
1515 $forms = $this->preConvertPlural( $forms, 2 );
1616
17 - return ($count <= 1) ? $forms[0] : $forms[1];
 17+ return ( $count <= 1 ) ? $forms[0] : $forms[1];
1818 }
1919 }
Index: trunk/phase3/languages/classes/LanguageHr.php
@@ -7,15 +7,15 @@
88 class LanguageHr extends Language {
99
1010 function convertPlural( $count, $forms ) {
11 - if ( !count($forms) ) { return ''; }
 11+ if ( !count( $forms ) ) { return ''; }
1212 // FIXME: CLDR defines 4 plural forms instead of 3. Plural for for decimals is missing.
1313 // http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
1414 $forms = $this->preConvertPlural( $forms, 3 );
1515
16 - if ($count > 10 && floor(($count % 100) / 10) == 1) {
 16+ if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) {
1717 return $forms[2];
1818 } else {
19 - switch ($count % 10) {
 19+ switch ( $count % 10 ) {
2020 case 1: return $forms[0];
2121 case 2:
2222 case 3:
Index: trunk/phase3/languages/classes/LanguageTg.php
@@ -1,6 +1,6 @@
22 <?php
33
4 -require_once( dirname(__FILE__).'/../LanguageConverter.php' );
 4+require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
55
66 /**
77 * Converts Tajiki to latin orthography
Index: trunk/phase3/languages/classes/LanguagePl.php
@@ -6,7 +6,7 @@
77 */
88 class LanguagePl extends Language {
99 function convertPlural( $count, $forms ) {
10 - if ( !count($forms) ) { return ''; }
 10+ if ( !count( $forms ) ) { return ''; }
1111 $forms = $this->preConvertPlural( $forms, 3 );
1212 $count = abs( $count );
1313 if ( $count == 1 )
@@ -22,9 +22,9 @@
2323 }
2424 }
2525
26 - function commafy($_) {
27 - if (!preg_match('/^\d{1,4}(.\d+)?$/',$_)) {
28 - return strrev((string)preg_replace('/(\d{3})(?=\d)(?!\d*\.)/','$1,',strrev($_)));
 26+ function commafy( $_ ) {
 27+ if ( !preg_match( '/^\d{1,4}(.\d+)?$/', $_ ) ) {
 28+ return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
2929 } else {
3030 return $_;
3131 }
Index: trunk/phase3/languages/classes/LanguageZh.deps.php
@@ -5,5 +5,5 @@
66 // changed on a subsequent page view.
77 // see http://lists.wikimedia.org/pipermail/wikitech-l/2006-January/021311.html
88
9 -require_once( dirname(__FILE__).'/LanguageZh_hans.php' );
10 -require_once( dirname(__FILE__).'/../LanguageConverter.php' );
 9+require_once( dirname( __FILE__ ) . '/LanguageZh_hans.php' );
 10+require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
Index: trunk/phase3/languages/classes/LanguageTi.php
@@ -8,9 +8,9 @@
99 * Use singular form for zero
1010 */
1111 function convertPlural( $count, $forms ) {
12 - if ( !count($forms) ) { return ''; }
 12+ if ( !count( $forms ) ) { return ''; }
1313 $forms = $this->preConvertPlural( $forms, 2 );
1414
15 - return ($count <= 1) ? $forms[0] : $forms[1];
 15+ return ( $count <= 1 ) ? $forms[0] : $forms[1];
1616 }
1717 }
Index: trunk/phase3/languages/classes/LanguageBat_smg.php
@@ -8,15 +8,15 @@
99 class LanguageBat_smg extends Language {
1010
1111 function convertPlural( $count, $forms ) {
12 - if ( !count($forms) ) { return ''; }
 12+ if ( !count( $forms ) ) { return ''; }
1313 $forms = $this->preConvertPlural( $forms, 4 );
1414
1515 $count = abs( $count );
16 - if ( $count === 0 || ($count%100 === 0 || ($count%100 >= 10 && $count%100 < 20)) ) {
 16+ if ( $count === 0 || ( $count % 100 === 0 || ( $count % 100 >= 10 && $count % 100 < 20 ) ) ) {
1717 return $forms[2];
18 - } elseif ( $count%10 === 1 ) {
 18+ } elseif ( $count % 10 === 1 ) {
1919 return $forms[0];
20 - } elseif ( $count%10 === 2 ) {
 20+ } elseif ( $count % 10 === 2 ) {
2121 return $forms[1];
2222 } else {
2323 return $forms[3];
Index: trunk/phase3/languages/classes/LanguageHu.php
@@ -7,7 +7,7 @@
88 class LanguageHu extends Language {
99 function convertGrammar( $word, $case ) {
1010 global $wgGrammarForms;
11 - if ( isset($wgGrammarForms[$this->getCode()][$case][$word]) ) {
 11+ if ( isset( $wgGrammarForms[$this->getCode()][$case][$word] ) ) {
1212 return $wgGrammarForms[$this->getCode()][$case][$word];
1313 }
1414
Index: trunk/phase3/languages/classes/LanguageSr.deps.php
@@ -5,5 +5,5 @@
66 // changed on a subsequent page view.
77 // see http://lists.wikimedia.org/pipermail/wikitech-l/2006-January/021311.html
88
9 -require_once( dirname(__FILE__).'/LanguageSr_ec.php' );
10 -require_once( dirname(__FILE__).'/../LanguageConverter.php' );
 9+require_once( dirname( __FILE__ ) . '/LanguageSr_ec.php' );
 10+require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
Index: trunk/phase3/languages/classes/LanguageLt.php
@@ -11,15 +11,15 @@
1212 3 - penkiolika (15) lapų
1313 */
1414 function convertPlural( $count, $forms ) {
15 - if ( !count($forms) ) { return ''; }
 15+ if ( !count( $forms ) ) { return ''; }
1616
17 - //if no number with word, then use $form[0] for singular and $form[1] for plural or zero
18 - if( count($forms) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
 17+ // if no number with word, then use $form[0] for singular and $form[1] for plural or zero
 18+ if ( count( $forms ) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
1919
2020 $forms = $this->preConvertPlural( $forms, 3 );
2121
22 - if ($count%10==1 && $count%100!=11) return $forms[0];
23 - if ($count%10>=2 && ($count%100<10 || $count%100>=20)) return $forms[1];
 22+ if ( $count % 10 == 1 && $count % 100 != 11 ) return $forms[0];
 23+ if ( $count % 10 >= 2 && ( $count % 100 < 10 || $count % 100 >= 20 ) ) return $forms[1];
2424 return $forms[2];
2525 }
2626 }
Index: trunk/phase3/languages/classes/LanguageTl.php
@@ -8,9 +8,9 @@
99 * Use singular form for zero
1010 */
1111 function convertPlural( $count, $forms ) {
12 - if ( !count($forms) ) { return ''; }
 12+ if ( !count( $forms ) ) { return ''; }
1313 $forms = $this->preConvertPlural( $forms, 2 );
1414
15 - return ($count <= 1) ? $forms[0] : $forms[1];
 15+ return ( $count <= 1 ) ? $forms[0] : $forms[1];
1616 }
1717 }
Index: trunk/phase3/languages/classes/LanguageHy.php
@@ -10,58 +10,58 @@
1111 # Invoked with {{grammar:case|word}}
1212 function convertGrammar( $word, $case ) {
1313 global $wgGrammarForms;
14 - if ( isset($wgGrammarForms['hy'][$case][$word]) ) {
 14+ if ( isset( $wgGrammarForms['hy'][$case][$word] ) ) {
1515 return $wgGrammarForms['hy'][$case][$word];
1616 }
1717
1818 # These rules are not perfect, but they are currently only used for site names so it doesn't
1919 # matter if they are wrong sometimes. Just add a special case for your site name if necessary.
2020
21 - #join and array_slice instead mb_substr
 21+ # join and array_slice instead mb_substr
2222 $ar = array();
2323 preg_match_all( '/./us', $word, $ar );
24 - if (!preg_match("/[a-zA-Z_]/us", $word))
 24+ if ( !preg_match( "/[a-zA-Z_]/us", $word ) )
2525 switch ( $case ) {
26 - case 'genitive': #սեռական հոլով
27 - if (join('',array_slice($ar[0],-1))=='ա')
28 - $word = join('',array_slice($ar[0],0,-1)).'այի';
29 - elseif (join('',array_slice($ar[0],-1))=='ո')
30 - $word=join('',array_slice($ar[0],0,-1)).'ոյի';
31 - elseif (join('',array_slice($ar[0],-4))=='գիրք')
32 - $word=join('',array_slice($ar[0],0,-4)).'գրքի';
 26+ case 'genitive': # սեռական հոլով
 27+ if ( join( '', array_slice( $ar[0], -1 ) ) == 'ա' )
 28+ $word = join( '', array_slice( $ar[0], 0, -1 ) ) . 'այի';
 29+ elseif ( join( '', array_slice( $ar[0], -1 ) ) == 'ո' )
 30+ $word = join( '', array_slice( $ar[0], 0, -1 ) ) . 'ոյի';
 31+ elseif ( join( '', array_slice( $ar[0], -4 ) ) == 'գիրք' )
 32+ $word = join( '', array_slice( $ar[0], 0, -4 ) ) . 'գրքի';
3333 else
34 - $word.='ի';
 34+ $word .= 'ի';
3535 break;
36 - case 'dative': #Տրական հոլով
37 - #stub
 36+ case 'dative': # Տրական հոլով
 37+ # stub
3838 break;
39 - case 'accusative': #Հայցական հոլով
40 - #stub
 39+ case 'accusative': # Հայցական հոլով
 40+ # stub
4141 break;
4242 case 'instrumental': #
43 - #stub
 43+ # stub
4444 break;
4545 case 'prepositional': #
46 - #stub
 46+ # stub
4747 break;
4848 }
4949 return $word;
5050 }
5151
5252 function convertPlural( $count, $forms ) {
53 - if ( !count($forms) ) { return ''; }
 53+ if ( !count( $forms ) ) { return ''; }
5454 $forms = $this->preConvertPlural( $forms, 2 );
5555
56 - return (abs($count) <= 1) ? $forms[0] : $forms[1];
 56+ return ( abs( $count ) <= 1 ) ? $forms[0] : $forms[1];
5757 }
5858
5959 /*
6060 * Armenian numeric format is "12 345,67" but "1234,56"
6161 */
6262
63 - function commafy($_) {
64 - if (!preg_match('/^\d{1,4}$/',$_)) {
65 - return strrev((string)preg_replace('/(\d{3})(?=\d)(?!\d*\.)/','$1,',strrev($_)));
 63+ function commafy( $_ ) {
 64+ if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
 65+ return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
6666 } else {
6767 return $_;
6868 }
Index: trunk/phase3/languages/classes/LanguageLv.php
@@ -20,7 +20,7 @@
2121 * @return String
2222 */
2323 function convertPlural( $count, $forms ) {
24 - if ( !count($forms) ) { return ''; }
 24+ if ( !count( $forms ) ) { return ''; }
2525
2626 // FIXME: CLDR defines 3 plural forms instead of 2. Form for 0 is missing.
2727 // http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#lv
Index: trunk/phase3/languages/classes/LanguageTyv.php
@@ -16,37 +16,37 @@
1717 */
1818 function convertGrammar( $word, $case ) {
1919 global $wgGrammarForms;
20 - if ( isset($wgGrammarForms['tyv'][$case][$word]) ) {
 20+ if ( isset( $wgGrammarForms['tyv'][$case][$word] ) ) {
2121 return $wgGrammarForms['tyv'][$case][$word];
2222 }
2323
2424 // Set up some constants...
25 - $allVowels = array("е", "и", "э", "ө", "ү", "а", "ё", "о", "у", "ы", "ю", "я", "a", "e", "i", "o", "ö", "u", "ü", "y");
26 - $frontVowels = array("е", "и", "э", "ө", "ү", "e", "i", "ö", "ü");
27 - $backVowels = array("а", "ё", "о", "у", "ы", "ю", "я", "a", "o", "u", "y");
28 - $unroundFrontVowels = array("е", "и", "э", "e", "i");
29 - $roundFrontVowels = array("ө", "ү", "ö", "ü");
30 - $unroundBackVowels = array("а", "ы", "я", "a", "y");
31 - $roundBackVowels = array("ё", "о", "у", "ю", "o", "u");
32 - $voicedPhonemes = array("д", "б", "з", "ж", "г", "d", "b", "z", "g");
33 - $unvoicedPhonemes = array("т", "п", "с", "ш", "к", "ч", "х", "t", "p", "s", "k", "x");
34 - $directiveUnvoicedStems = array("т", "п", "с", "ш", "к", "ч", "х", "л", "м", "н", "ң", "t", "p", "s", "k", "x", "l", "m", "n", "ŋ");
35 - $directiveVoicedStems = array("д", "б", "з", "ж", "г", "р", "й", "d", "b", "z", "g", "r", "j");
 25+ $allVowels = array( "е", "и", "э", "ө", "ү", "а", "ё", "о", "у", "ы", "ю", "я", "a", "e", "i", "o", "ö", "u", "ü", "y" );
 26+ $frontVowels = array( "е", "и", "э", "ө", "ү", "e", "i", "ö", "ü" );
 27+ $backVowels = array( "а", "ё", "о", "у", "ы", "ю", "я", "a", "o", "u", "y" );
 28+ $unroundFrontVowels = array( "е", "и", "э", "e", "i" );
 29+ $roundFrontVowels = array( "ө", "ү", "ö", "ü" );
 30+ $unroundBackVowels = array( "а", "ы", "я", "a", "y" );
 31+ $roundBackVowels = array( "ё", "о", "у", "ю", "o", "u" );
 32+ $voicedPhonemes = array( "д", "б", "з", "ж", "г", "d", "b", "z", "g" );
 33+ $unvoicedPhonemes = array( "т", "п", "с", "ш", "к", "ч", "х", "t", "p", "s", "k", "x" );
 34+ $directiveUnvoicedStems = array( "т", "п", "с", "ш", "к", "ч", "х", "л", "м", "н", "ң", "t", "p", "s", "k", "x", "l", "m", "n", "ŋ" );
 35+ $directiveVoicedStems = array( "д", "б", "з", "ж", "г", "р", "й", "d", "b", "z", "g", "r", "j" );
3636
3737 // $allSonants = array("л", "м", "н", "ң", "р", "й");
3838 // $allNasals = array("м", "н", "ң");
3939
4040 // Put the word in a form we can play with since we're using UTF-8
4141 preg_match_all( '/./us', $word, $ar );
42 -
43 - $wordEnding = $ar[0][count($ar[0]) - 1]; //Here's the last letter in the word
44 - $wordReversed = array_reverse($ar[0]); //Here's an array with the order of the letters in the word reversed so we can find a match quicker *shrug*
4542
 43+ $wordEnding = $ar[0][count( $ar[0] ) - 1]; // Here's the last letter in the word
 44+ $wordReversed = array_reverse( $ar[0] ); // Here's an array with the order of the letters in the word reversed so we can find a match quicker *shrug*
 45+
4646 // Find the last vowel in the word
4747 $wordLastVowel = NULL;
4848 foreach ( $wordReversed as $xvalue ) {
4949 foreach ( $allVowels as $yvalue ) {
50 - if ( strcmp($xvalue, $yvalue) == 0 ) {
 50+ if ( strcmp( $xvalue, $yvalue ) == 0 ) {
5151 $wordLastVowel = $xvalue;
5252 break;
5353 } else {
@@ -63,157 +63,157 @@
6464 // Now convert the word
6565 switch ( $case ) {
6666 case "genitive":
67 - if ( in_array($wordEnding, $unvoicedPhonemes) ) {
68 - if ( in_array($wordLastVowel, $roundFrontVowels) ) {
69 - $word = implode("",$ar[0]) . "түң";
70 - } elseif ( in_array($wordLastVowel, $unroundFrontVowels) ) {
71 - $word = implode("",$ar[0]) . "тиң";
72 - } elseif ( in_array($wordLastVowel, $roundBackVowels) ) {
73 - $word = implode("",$ar[0]) . "туң";
74 - } elseif ( in_array($wordLastVowel, $unroundBackVowels) ) {
75 - $word = implode("",$ar[0]) . "тың";
 67+ if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
 68+ if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
 69+ $word = implode( "", $ar[0] ) . "түң";
 70+ } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
 71+ $word = implode( "", $ar[0] ) . "тиң";
 72+ } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
 73+ $word = implode( "", $ar[0] ) . "туң";
 74+ } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
 75+ $word = implode( "", $ar[0] ) . "тың";
7676 } else {
7777 }
78 - } elseif ( $wordEnding === "л" || $wordEnding === "l") {
79 - if ( in_array($wordLastVowel, $roundFrontVowels) ) {
80 - $word = implode("",$ar[0]) . "дүң";
81 - } elseif ( in_array($wordLastVowel, $unroundFrontVowels) ) {
82 - $word = implode("",$ar[0]) . "диң";
83 - } elseif ( in_array($wordLastVowel, $roundBackVowels) ) {
84 - $word = implode("",$ar[0]) . "дуң";
85 - } elseif ( in_array($wordLastVowel, $unroundBackVowels) ) {
86 - $word = implode("",$ar[0]) . "дың";
 78+ } elseif ( $wordEnding === "л" || $wordEnding === "l" ) {
 79+ if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
 80+ $word = implode( "", $ar[0] ) . "дүң";
 81+ } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
 82+ $word = implode( "", $ar[0] ) . "диң";
 83+ } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
 84+ $word = implode( "", $ar[0] ) . "дуң";
 85+ } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
 86+ $word = implode( "", $ar[0] ) . "дың";
8787 } else {
8888 }
8989 } else {
90 - if ( in_array($wordLastVowel, $roundFrontVowels) ) {
91 - $word = implode("",$ar[0]) . "нүң";
92 - } elseif ( in_array($wordLastVowel, $unroundFrontVowels) ) {
93 - $word = implode("",$ar[0]) . "ниң";
94 - } elseif ( in_array($wordLastVowel, $roundBackVowels) ) {
95 - $word = implode("",$ar[0]) . "нуң";
96 - } elseif ( in_array($wordLastVowel, $unroundBackVowels) ) {
97 - $word = implode("",$ar[0]) . "ның";
 90+ if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
 91+ $word = implode( "", $ar[0] ) . "нүң";
 92+ } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
 93+ $word = implode( "", $ar[0] ) . "ниң";
 94+ } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
 95+ $word = implode( "", $ar[0] ) . "нуң";
 96+ } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
 97+ $word = implode( "", $ar[0] ) . "ның";
9898 } else {
9999 }
100100 }
101101 break;
102102 case "dative":
103 - if ( in_array($wordEnding, $unvoicedPhonemes) ) {
104 - if ( in_array($wordLastVowel, $frontVowels) ) {
105 - $word = implode("",$ar[0]) . "ке";
106 - } elseif ( in_array($wordLastVowel, $backVowels) ) {
107 - $word = implode("",$ar[0]) . "ка";
 103+ if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
 104+ if ( in_array( $wordLastVowel, $frontVowels ) ) {
 105+ $word = implode( "", $ar[0] ) . "ке";
 106+ } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
 107+ $word = implode( "", $ar[0] ) . "ка";
108108 } else {
109109 }
110110 } else {
111 - if ( in_array($wordLastVowel, $frontVowels) ) {
112 - $word = implode("",$ar[0]) . "ге";
113 - } elseif ( in_array($wordLastVowel, $backVowels) ) {
114 - $word = implode("",$ar[0]) . "га";
 111+ if ( in_array( $wordLastVowel, $frontVowels ) ) {
 112+ $word = implode( "", $ar[0] ) . "ге";
 113+ } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
 114+ $word = implode( "", $ar[0] ) . "га";
115115 } else {
116116 }
117117 }
118118 break;
119119 case "accusative":
120 - if ( in_array($wordEnding, $unvoicedPhonemes) ) {
121 - if ( in_array($wordLastVowel, $roundFrontVowels) ) {
122 - $word = implode("",$ar[0]) . "тү";
123 - } elseif ( in_array($wordLastVowel, $unroundFrontVowels) ) {
124 - $word = implode("",$ar[0]) . "ти";
125 - } elseif ( in_array($wordLastVowel, $roundBackVowels) ) {
126 - $word = implode("",$ar[0]) . "ту";
127 - } elseif ( in_array($wordLastVowel, $unroundBackVowels) ) {
128 - $word = implode("",$ar[0]) . "ты";
 120+ if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
 121+ if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
 122+ $word = implode( "", $ar[0] ) . "тү";
 123+ } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
 124+ $word = implode( "", $ar[0] ) . "ти";
 125+ } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
 126+ $word = implode( "", $ar[0] ) . "ту";
 127+ } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
 128+ $word = implode( "", $ar[0] ) . "ты";
129129 } else {
130130 }
131 - } elseif ( $wordEnding === "л" || $wordEnding === "l") {
132 - if ( in_array($wordLastVowel, $roundFrontVowels) ) {
133 - $word = implode("",$ar[0]) . "дү";
134 - } elseif ( in_array($wordLastVowel, $unroundFrontVowels) ) {
135 - $word = implode("",$ar[0]) . "ди";
136 - } elseif ( in_array($wordLastVowel, $roundBackVowels) ) {
137 - $word = implode("",$ar[0]) . "ду";
138 - } elseif ( in_array($wordLastVowel, $unroundBackVowels) ) {
139 - $word = implode("",$ar[0]) . "ды";
 131+ } elseif ( $wordEnding === "л" || $wordEnding === "l" ) {
 132+ if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
 133+ $word = implode( "", $ar[0] ) . "дү";
 134+ } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
 135+ $word = implode( "", $ar[0] ) . "ди";
 136+ } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
 137+ $word = implode( "", $ar[0] ) . "ду";
 138+ } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
 139+ $word = implode( "", $ar[0] ) . "ды";
140140 } else {
141141 }
142142 } else {
143 - if ( in_array($wordLastVowel, $roundFrontVowels) ) {
144 - $word = implode("",$ar[0]) . "нү";
145 - } elseif ( in_array($wordLastVowel, $unroundFrontVowels) ) {
146 - $word = implode("",$ar[0]) . "ни";
147 - } elseif ( in_array($wordLastVowel, $roundBackVowels) ) {
148 - $word = implode("",$ar[0]) . "ну";
149 - } elseif ( in_array($wordLastVowel, $unroundBackVowels) ) {
150 - $word = implode("",$ar[0]) . "ны";
 143+ if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
 144+ $word = implode( "", $ar[0] ) . "нү";
 145+ } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
 146+ $word = implode( "", $ar[0] ) . "ни";
 147+ } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
 148+ $word = implode( "", $ar[0] ) . "ну";
 149+ } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
 150+ $word = implode( "", $ar[0] ) . "ны";
151151 } else {
152152 }
153153 }
154154 break;
155155 case "locative":
156 - if ( in_array($wordEnding, $unvoicedPhonemes) ) {
157 - if ( in_array($wordLastVowel, $frontVowels) ) {
158 - $word = implode("",$ar[0]) . "те";
159 - } elseif ( in_array($wordLastVowel, $backVowels) ) {
160 - $word = implode("",$ar[0]) . "та";
 156+ if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
 157+ if ( in_array( $wordLastVowel, $frontVowels ) ) {
 158+ $word = implode( "", $ar[0] ) . "те";
 159+ } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
 160+ $word = implode( "", $ar[0] ) . "та";
161161 } else {
162162 }
163163 } else {
164 - if ( in_array($wordLastVowel, $frontVowels) ) {
165 - $word = implode("",$ar[0]) . "де";
166 - } elseif ( in_array($wordLastVowel, $backVowels) ) {
167 - $word = implode("",$ar[0]) . "да";
 164+ if ( in_array( $wordLastVowel, $frontVowels ) ) {
 165+ $word = implode( "", $ar[0] ) . "де";
 166+ } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
 167+ $word = implode( "", $ar[0] ) . "да";
168168 } else {
169169 }
170170 }
171171 break;
172172 case "ablative":
173 - if ( in_array($wordEnding, $unvoicedPhonemes) ) {
174 - if ( in_array($wordLastVowel, $frontVowels) ) {
175 - $word = implode("",$ar[0]) . "тен";
176 - } elseif ( in_array($wordLastVowel, $backVowels) ) {
177 - $word = implode("",$ar[0]) . "тан";
 173+ if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
 174+ if ( in_array( $wordLastVowel, $frontVowels ) ) {
 175+ $word = implode( "", $ar[0] ) . "тен";
 176+ } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
 177+ $word = implode( "", $ar[0] ) . "тан";
178178 } else {
179179 }
180180 } else {
181 - if ( in_array($wordLastVowel, $frontVowels) ) {
182 - $word = implode("",$ar[0]) . "ден";
183 - } elseif ( in_array($wordLastVowel, $backVowels) ) {
184 - $word = implode("",$ar[0]) . "дан";
 181+ if ( in_array( $wordLastVowel, $frontVowels ) ) {
 182+ $word = implode( "", $ar[0] ) . "ден";
 183+ } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
 184+ $word = implode( "", $ar[0] ) . "дан";
185185 } else {
186186 }
187187 }
188188 break;
189189 case "directive1":
190 - if ( in_array($wordEnding, $directiveVoicedStems) ) {
191 - $word = implode("",$ar[0]) . "же";
192 - } elseif ( in_array($wordEnding, $directiveUnvoicedStems) ) {
193 - $word = implode("",$ar[0]) . "че";
 190+ if ( in_array( $wordEnding, $directiveVoicedStems ) ) {
 191+ $word = implode( "", $ar[0] ) . "же";
 192+ } elseif ( in_array( $wordEnding, $directiveUnvoicedStems ) ) {
 193+ $word = implode( "", $ar[0] ) . "че";
194194 } else {
195195 }
196196 break;
197197 case "directive2":
198 - if ( in_array($wordEnding, $unvoicedPhonemes) ) {
199 - if ( in_array($wordLastVowel, $roundFrontVowels) ) {
200 - $word = implode("",$ar[0]) . "түве";
201 - } elseif ( in_array($wordLastVowel, $unroundFrontVowels) ) {
202 - $word = implode("",$ar[0]) . "тиве";
203 - } elseif ( in_array($wordLastVowel, $roundBackVowels) ) {
204 - $word = implode("",$ar[0]) . "туве";
205 - } elseif ( in_array($wordLastVowel, $unroundBackVowels) ) {
206 - $word = implode("",$ar[0]) . "тыве";
 198+ if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
 199+ if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
 200+ $word = implode( "", $ar[0] ) . "түве";
 201+ } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
 202+ $word = implode( "", $ar[0] ) . "тиве";
 203+ } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
 204+ $word = implode( "", $ar[0] ) . "туве";
 205+ } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
 206+ $word = implode( "", $ar[0] ) . "тыве";
207207 } else {
208208 }
209209 } else {
210 - if ( in_array($wordLastVowel, $roundFrontVowels) ) {
211 - $word = implode("",$ar[0]) . "дүве";
212 - } elseif ( in_array($wordLastVowel, $unroundFrontVowels) ) {
213 - $word = implode("",$ar[0]) . "диве";
214 - } elseif ( in_array($wordLastVowel, $roundBackVowels) ) {
215 - $word = implode("",$ar[0]) . "дуве";
216 - } elseif ( in_array($wordLastVowel, $unroundBackVowels) ) {
217 - $word = implode("",$ar[0]) . "дыве";
 210+ if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
 211+ $word = implode( "", $ar[0] ) . "дүве";
 212+ } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
 213+ $word = implode( "", $ar[0] ) . "диве";
 214+ } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
 215+ $word = implode( "", $ar[0] ) . "дуве";
 216+ } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
 217+ $word = implode( "", $ar[0] ) . "дыве";
218218 } else {
219219 }
220220 }
Index: trunk/phase3/languages/classes/LanguageTr.php
@@ -7,7 +7,7 @@
88 */
99 class LanguageTr extends Language {
1010 function ucfirst ( $string ) {
11 - if ( !empty($string) && $string[0] == 'i' ) {
 11+ if ( !empty( $string ) && $string[0] == 'i' ) {
1212 return 'İ' . substr( $string, 1 );
1313 } else {
1414 return parent::ucfirst( $string );
Index: trunk/phase3/languages/classes/LanguageKaa.php
@@ -51,7 +51,7 @@
5252 */
5353 function commafy( $_ ) {
5454 if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
55 - return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev($_) ) );
 55+ return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
5656 } else {
5757 return $_;
5858 }
Index: trunk/phase3/languages/classes/LanguageAm.php
@@ -8,9 +8,9 @@
99 * Use singular form for zero
1010 */
1111 function convertPlural( $count, $forms ) {
12 - if ( !count($forms) ) { return ''; }
 12+ if ( !count( $forms ) ) { return ''; }
1313 $forms = $this->preConvertPlural( $forms, 2 );
1414
15 - return ($count <= 1) ? $forms[0] : $forms[1];
 15+ return ( $count <= 1 ) ? $forms[0] : $forms[1];
1616 }
1717 }
Index: trunk/phase3/languages/classes/LanguageSr_el.deps.php
@@ -5,4 +5,4 @@
66 // changed on a subsequent page view.
77 // see http://mail.wikipedia.org/pipermail/wikitech-l/2006-January/033660.html
88
9 -require_once( dirname(__FILE__).'/LanguageSr_ec.php' );
 9+require_once( dirname( __FILE__ ) . '/LanguageSr_ec.php' );
Index: trunk/phase3/languages/classes/LanguageKk.deps.php
@@ -5,5 +5,5 @@
66 // changed on a subsequent page view.
77 // see http://lists.wikimedia.org/pipermail/wikitech-l/2006-January/021311.html
88
9 -require_once( dirname(__FILE__).'/../LanguageConverter.php' );
10 -require_once( dirname(__FILE__).'/LanguageKk_cyrl.php' );
 9+require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
 10+require_once( dirname( __FILE__ ) . '/LanguageKk_cyrl.php' );
Index: trunk/phase3/languages/classes/LanguageAr.php
@@ -7,18 +7,18 @@
88 */
99 class LanguageAr extends Language {
1010 function convertPlural( $count, $forms ) {
11 - if ( !count($forms) ) { return ''; }
 11+ if ( !count( $forms ) ) { return ''; }
1212 $forms = $this->preConvertPlural( $forms, 6 );
1313
1414 if ( $count == 0 ) {
1515 $index = 0;
1616 } elseif ( $count == 1 ) {
1717 $index = 1;
18 - } elseif( $count == 2 ) {
 18+ } elseif ( $count == 2 ) {
1919 $index = 2;
20 - } elseif( $count % 100 >= 3 && $count % 100 <= 10 ) {
 20+ } elseif ( $count % 100 >= 3 && $count % 100 <= 10 ) {
2121 $index = 3;
22 - } elseif( $count % 100 >= 11 && $count % 100 <= 99 ) {
 22+ } elseif ( $count % 100 >= 11 && $count % 100 <= 99 ) {
2323 $index = 4;
2424 } else {
2525 $index = 5;
@@ -27,10 +27,10 @@
2828 }
2929
3030 /**
31 - * Temporary hack for bug 9413: replace Arabic presentation forms with their
32 - * standard equivalents.
 31+ * Temporary hack for bug 9413: replace Arabic presentation forms with their
 32+ * standard equivalents.
3333 *
34 - * FIXME: This is language-specific for now only to avoid the negative
 34+ * FIXME: This is language-specific for now only to avoid the negative
3535 * performance impact of enabling it for all languages.
3636 */
3737 function normalize( $s ) {
Index: trunk/phase3/languages/classes/LanguageEo.php
@@ -8,7 +8,7 @@
99 function iconv( $in, $out, $string ) {
1010 # Por multaj lingvoj, ĉi tiu nur voku la sisteman funkcion iconv()
1111 # Ni ankaŭ konvertu X-sistemajn surogotajn
12 - if( strcasecmp( $in, 'x' ) == 0 and strcasecmp( $out, 'utf-8' ) == 0) {
 12+ if ( strcasecmp( $in, 'x' ) == 0 and strcasecmp( $out, 'utf-8' ) == 0 ) {
1313 $xu = array (
1414 'xx' => 'x' , 'xX' => 'x' ,
1515 'Xx' => 'X' , 'XX' => 'X' ,
@@ -27,7 +27,7 @@
2828 ) ;
2929 return preg_replace ( '/([cghjsu]x?)((?:xx)*)(?!x)/ei',
3030 'strtr( "$1", $xu ) . strtr( "$2", $xu )', $string );
31 - } else if( strcasecmp( $in, 'UTF-8' ) == 0 and strcasecmp( $out, 'x' ) == 0 ) {
 31+ } else if ( strcasecmp( $in, 'UTF-8' ) == 0 and strcasecmp( $out, 'x' ) == 0 ) {
3232 $ux = array (
3333 'x' => 'xx' , 'X' => 'Xx' ,
3434 "\xc4\x88" => "Cx" , "\xc4\x89" => "cx" ,
@@ -38,7 +38,7 @@
3939 "\xc5\xac" => "Ux" , "\xc5\xad" => "ux"
4040 ) ;
4141 # Double Xs only if they follow cxapelutaj literoj.
42 - return preg_replace( '/((?:[cghjsu]|\xc4[\x88\x89\x9c\x9d\xa4\xa5\xb4\xb5]'.
 42+ return preg_replace( '/((?:[cghjsu]|\xc4[\x88\x89\x9c\x9d\xa4\xa5\xb4\xb5]' .
4343 '|\xc5[\x9c\x9d\xac\xad])x*)/ei', 'strtr( "$1", $ux )', $string );
4444 }
4545 return parent::iconv( $in, $out, $string );
@@ -46,20 +46,20 @@
4747
4848 function checkTitleEncoding( $s ) {
4949 # Check for X-system backwards-compatibility URLs
50 - $ishigh = preg_match( '/[\x80-\xff]/', $s);
 50+ $ishigh = preg_match( '/[\x80-\xff]/', $s );
5151 $isutf = preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
5252 '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s );
5353
54 - if($ishigh and !$isutf) {
 54+ if ( $ishigh and !$isutf ) {
5555 # Assume Latin1
5656 $s = utf8_encode( $s );
5757 } else {
58 - if( preg_match( '/(\xc4[\x88\x89\x9c\x9d\xa4\xa5\xb4\xb5]'.
 58+ if ( preg_match( '/(\xc4[\x88\x89\x9c\x9d\xa4\xa5\xb4\xb5]' .
5959 '|\xc5[\x9c\x9d\xac\xad])/', $s ) )
6060 return $s;
6161 }
6262
63 - //if( preg_match( '/[cghjsu]x/i', $s ) )
 63+ // if( preg_match( '/[cghjsu]x/i', $s ) )
6464 // return $this->iconv( 'x', 'utf-8', $s );
6565 return $s;
6666 }
Index: trunk/phase3/languages/classes/LanguageMg.php
@@ -8,9 +8,9 @@
99 * Use singular form for zero
1010 */
1111 function convertPlural( $count, $forms ) {
12 - if ( !count($forms) ) { return ''; }
 12+ if ( !count( $forms ) ) { return ''; }
1313 $forms = $this->preConvertPlural( $forms, 2 );
1414
15 - return ($count <= 1) ? $forms[0] : $forms[1];
 15+ return ( $count <= 1 ) ? $forms[0] : $forms[1];
1616 }
1717 }
Index: trunk/phase3/languages/classes/LanguageGan.php
@@ -1,35 +1,35 @@
22 <?php
33
4 -require_once( dirname(__FILE__).'/../LanguageConverter.php' );
5 -require_once( dirname(__FILE__).'/LanguageZh.php' );
 4+require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
 5+require_once( dirname( __FILE__ ) . '/LanguageZh.php' );
66
77 /**
88 * @ingroup Language
99 */
1010 class GanConverter extends LanguageConverter {
1111
12 - function __construct($langobj, $maincode,
13 - $variants=array(),
14 - $variantfallbacks=array(),
 12+ function __construct( $langobj, $maincode,
 13+ $variants = array(),
 14+ $variantfallbacks = array(),
1515 $flags = array(),
1616 $manualLevel = array() ) {
1717 $this->mDescCodeSep = ':';
1818 $this->mDescVarSep = ';';
19 - parent::__construct($langobj, $maincode,
 19+ parent::__construct( $langobj, $maincode,
2020 $variants,
2121 $variantfallbacks,
2222 $flags,
23 - $manualLevel);
 23+ $manualLevel );
2424 $names = array(
2525 'gan' => '原文',
2626 'gan-hans' => '简体',
2727 'gan-hant' => '繁體',
2828 );
29 - $this->mVariantNames = array_merge($this->mVariantNames,$names);
 29+ $this->mVariantNames = array_merge( $this->mVariantNames, $names );
3030 }
3131
3232 function loadDefaultTables() {
33 - require( dirname(__FILE__)."/../../includes/ZhConversion.php" );
 33+ require( dirname( __FILE__ ) . "/../../includes/ZhConversion.php" );
3434 $this->mTables = array(
3535 'gan-hans' => new ReplacementArray( $zh2Hans ),
3636 'gan-hant' => new ReplacementArray( $zh2Hant ),
@@ -41,7 +41,7 @@
4242 to mark anything.
4343 $noParse is there for compatibility with LanguageConvert::markNoConversion
4444 */
45 - function markNoConversion($text, $noParse = false) {
 45+ function markNoConversion( $text, $noParse = false ) {
4646 return $text;
4747 }
4848
@@ -62,20 +62,20 @@
6363 global $wgHooks;
6464 parent::__construct();
6565
66 - $variants = array('gan','gan-hans','gan-hant');
 66+ $variants = array( 'gan', 'gan-hans', 'gan-hant' );
6767 $variantfallbacks = array(
68 - 'gan' => array('gan-hans','gan-hant'),
69 - 'gan-hans' => array('gan'),
70 - 'gan-hant' => array('gan'),
 68+ 'gan' => array( 'gan-hans', 'gan-hant' ),
 69+ 'gan-hans' => array( 'gan' ),
 70+ 'gan-hant' => array( 'gan' ),
7171 );
72 - $ml=array(
 72+ $ml = array(
7373 'gan' => 'disable',
7474 );
7575
7676 $this->mConverter = new GanConverter( $this, 'gan',
7777 $variants, $variantfallbacks,
7878 array(),
79 - $ml);
 79+ $ml );
8080
8181 $wgHooks['ArticleSaveComplete'][] = $this->mConverter;
8282 }
@@ -84,13 +84,13 @@
8585 function segmentForDiff( $text ) {
8686 return preg_replace(
8787 "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
88 - "' ' .\"$1\"", $text);
 88+ "' ' .\"$1\"", $text );
8989 }
9090
9191 function unsegmentForDiff( $text ) {
9292 return preg_replace(
9393 "/ ([\\xc0-\\xff][\\x80-\\xbf]*)/e",
94 - "\"$1\"", $text);
 94+ "\"$1\"", $text );
9595 }
9696
9797 // word segmentation
@@ -103,7 +103,7 @@
104104 $terms = implode( '|', $termsArray );
105105 $terms = self::convertDoubleWidth( $terms );
106106 $terms = implode( '|', $this->mConverter->autoConvertToAllVariants( $terms ) );
107 - $ret = array_unique( explode('|', $terms) );
 107+ $ret = array_unique( explode( '|', $terms ) );
108108 return $ret;
109109 }
110110 }
Index: trunk/phase3/languages/classes/LanguageMk.php
@@ -9,7 +9,7 @@
1010 * http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#mk
1111 */
1212 function convertPlural( $count, $forms ) {
13 - if ( !count($forms) ) { return ''; }
 13+ if ( !count( $forms ) ) { return ''; }
1414 $forms = $this->preConvertPlural( $forms, 2 );
1515
1616 if ( $count % 10 === 1 && $count % 100 !== 11 ) {
Index: trunk/phase3/languages/classes/LanguageDsb.php
@@ -27,7 +27,7 @@
2828 }
2929
3030 function convertPlural( $count, $forms ) {
31 - if ( !count($forms) ) { return ''; }
 31+ if ( !count( $forms ) ) { return ''; }
3232 $forms = $this->preConvertPlural( $forms, 4 );
3333
3434 switch ( abs( $count ) % 100 ) {
Index: trunk/phase3/languages/classes/LanguageEt.php
@@ -9,9 +9,9 @@
1010 /**
1111 * Avoid grouping whole numbers between 0 to 9999
1212 */
13 - function commafy($_) {
14 - if (!preg_match('/^\d{1,4}$/',$_)) {
15 - return strrev((string)preg_replace('/(\d{3})(?=\d)(?!\d*\.)/','$1,',strrev($_)));
 13+ function commafy( $_ ) {
 14+ if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
 15+ return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
1616 } else {
1717 return $_;
1818 }
Index: trunk/phase3/languages/classes/LanguageMl.php
@@ -2,13 +2,13 @@
33
44 class LanguageMl extends Language {
55 /**
6 - * Temporary hack for the issue described at
 6+ * Temporary hack for the issue described at
77 * http://permalink.gmane.org/gmane.science.linguistics.wikipedia.technical/46396
8 - * Convert Unicode 5.0 style Malayalam input to Unicode 5.1. Similar to
9 - * bug 9413. Also fixes miscellaneous problems due to mishandling of ZWJ,
 8+ * Convert Unicode 5.0 style Malayalam input to Unicode 5.1. Similar to
 9+ * bug 9413. Also fixes miscellaneous problems due to mishandling of ZWJ,
1010 * e.g. bug 11162.
11 - *
12 - * FIXME: This is language-specific for now only to avoid the negative
 11+ *
 12+ * FIXME: This is language-specific for now only to avoid the negative
1313 * performance impact of enabling it for all languages.
1414 */
1515 function normalize( $s ) {
Index: trunk/phase3/languages/classes/LanguageMo.php
@@ -7,7 +7,7 @@
88 function convertPlural( $count, $forms ) {
99 // Plural rules per
1010 // http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#mo
11 - if ( !count($forms) ) { return ''; }
 11+ if ( !count( $forms ) ) { return ''; }
1212
1313 $forms = $this->preConvertPlural( $forms, 3 );
1414
Index: trunk/phase3/languages/classes/LanguageHsb.php
@@ -28,7 +28,7 @@
2929 }
3030
3131 function convertPlural( $count, $forms ) {
32 - if ( !count($forms) ) { return ''; }
 32+ if ( !count( $forms ) ) { return ''; }
3333 $forms = $this->preConvertPlural( $forms, 4 );
3434
3535 switch ( abs( $count ) % 100 ) {
Index: trunk/phase3/languages/classes/LanguageUk.php
@@ -9,67 +9,67 @@
1010 # Invoked with {{grammar:case|word}}
1111 function convertGrammar( $word, $case ) {
1212 global $wgGrammarForms;
13 - if ( isset($wgGrammarForms['uk'][$case][$word]) ) {
 13+ if ( isset( $wgGrammarForms['uk'][$case][$word] ) ) {
1414 return $wgGrammarForms['uk'][$case][$word];
1515 }
1616
1717 # These rules are not perfect, but they are currently only used for site names so it doesn't
1818 # matter if they are wrong sometimes. Just add a special case for your site name if necessary.
1919
20 - #join and array_slice instead mb_substr
 20+ # join and array_slice instead mb_substr
2121 $ar = array();
2222 preg_match_all( '/./us', $word, $ar );
23 - if (!preg_match("/[a-zA-Z_]/us", $word))
 23+ if ( !preg_match( "/[a-zA-Z_]/us", $word ) )
2424 switch ( $case ) {
25 - case 'genitive': #родовий відмінок
26 - if ((join('',array_slice($ar[0],-4))=='вікі') || (join('',array_slice($ar[0],-4))=='Вікі'))
27 - {}
28 - elseif (join('',array_slice($ar[0],-1))=='ь')
29 - $word = join('',array_slice($ar[0],0,-1)).'я';
30 - elseif (join('',array_slice($ar[0],-2))=='ія')
31 - $word=join('',array_slice($ar[0],0,-2)).'ії';
32 - elseif (join('',array_slice($ar[0],-2))=='ка')
33 - $word=join('',array_slice($ar[0],0,-2)).'ки';
34 - elseif (join('',array_slice($ar[0],-2))=='ти')
35 - $word=join('',array_slice($ar[0],0,-2)).'тей';
36 - elseif (join('',array_slice($ar[0],-2))=='ди')
37 - $word=join('',array_slice($ar[0],0,-2)).'дів';
38 - elseif (join('',array_slice($ar[0],-3))=='ник')
39 - $word=join('',array_slice($ar[0],0,-3)).'ника';
 25+ case 'genitive': # родовий відмінок
 26+ if ( ( join( '', array_slice( $ar[0], -4 ) ) == 'вікі' ) || ( join( '', array_slice( $ar[0], -4 ) ) == 'Вікі' ) )
 27+ { }
 28+ elseif ( join( '', array_slice( $ar[0], -1 ) ) == 'ь' )
 29+ $word = join( '', array_slice( $ar[0], 0, -1 ) ) . 'я';
 30+ elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ія' )
 31+ $word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'ії';
 32+ elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ка' )
 33+ $word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'ки';
 34+ elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ти' )
 35+ $word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'тей';
 36+ elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ди' )
 37+ $word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'дів';
 38+ elseif ( join( '', array_slice( $ar[0], -3 ) ) == 'ник' )
 39+ $word = join( '', array_slice( $ar[0], 0, -3 ) ) . 'ника';
4040 break;
41 - case 'dative': #давальний відмінок
42 - #stub
 41+ case 'dative': # давальний відмінок
 42+ # stub
4343 break;
44 - case 'accusative': #знахідний відмінок
45 - if ((join('',array_slice($ar[0],-4))=='вікі') || (join('',array_slice($ar[0],-4))=='Вікі'))
46 - {}
47 - elseif (join('',array_slice($ar[0],-2))=='ія')
48 - $word=join('',array_slice($ar[0],0,-2)).'ію';
 44+ case 'accusative': # знахідний відмінок
 45+ if ( ( join( '', array_slice( $ar[0], -4 ) ) == 'вікі' ) || ( join( '', array_slice( $ar[0], -4 ) ) == 'Вікі' ) )
 46+ { }
 47+ elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ія' )
 48+ $word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'ію';
4949 break;
50 - case 'instrumental': #орудний відмінок
51 - #stub
 50+ case 'instrumental': # орудний відмінок
 51+ # stub
5252 break;
53 - case 'prepositional': #місцевий відмінок
54 - #stub
 53+ case 'prepositional': # місцевий відмінок
 54+ # stub
5555 break;
5656 }
5757 return $word;
5858 }
5959
6060 function convertPlural( $count, $forms ) {
61 - if ( !count($forms) ) { return ''; }
 61+ if ( !count( $forms ) ) { return ''; }
6262
63 - //if no number with word, then use $form[0] for singular and $form[1] for plural or zero
64 - if( count($forms) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
 63+ // if no number with word, then use $form[0] for singular and $form[1] for plural or zero
 64+ if ( count( $forms ) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
6565
6666 // FIXME: CLDR defines 4 plural forms. Form for decimals is missing/
6767 // See http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#uk
6868 $forms = $this->preConvertPlural( $forms, 3 );
6969
70 - if ($count > 10 && floor(($count % 100) / 10) == 1) {
 70+ if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) {
7171 return $forms[2];
7272 } else {
73 - switch ($count % 10) {
 73+ switch ( $count % 10 ) {
7474 case 1: return $forms[0];
7575 case 2:
7676 case 3:
@@ -83,9 +83,9 @@
8484 * Ukrainian numeric format is "12 345,67" but "1234,56"
8585 */
8686
87 - function commafy($_) {
88 - if (!preg_match('/^\d{1,4}$/',$_)) {
89 - return strrev((string)preg_replace('/(\d{3})(?=\d)(?!\d*\.)/','$1,',strrev($_)));
 87+ function commafy( $_ ) {
 88+ if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
 89+ return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
9090 } else {
9191 return $_;
9292 }
Index: trunk/phase3/languages/classes/LanguageMt.php
@@ -9,13 +9,13 @@
1010
1111 class LanguageMt extends Language {
1212 function convertPlural( $count, $forms ) {
13 - if ( !count($forms) ) { return ''; }
 13+ if ( !count( $forms ) ) { return ''; }
1414
1515 $forms = $this->preConvertPlural( $forms, 4 );
1616
1717 if ( $count === 1 ) $index = 0;
18 - elseif ( $count === 0 || ( $count%100>1 && $count%100<11) ) $index = 1;
19 - elseif ( $count%100>10 && $count%100<20 ) $index = 2;
 18+ elseif ( $count === 0 || ( $count % 100 > 1 && $count % 100 < 11 ) ) $index = 1;
 19+ elseif ( $count % 100 > 10 && $count % 100 < 20 ) $index = 2;
2020 else $index = 3;
2121 return $forms[$index];
2222 }
Index: trunk/phase3/languages/classes/LanguageSma.php
@@ -5,14 +5,14 @@
66 */
77 class LanguageSma extends Language {
88 function convertPlural( $count, $forms ) {
9 - if ( !count($forms) ) { return ''; }
 9+ if ( !count( $forms ) ) { return ''; }
1010
1111 // plural forms per http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#sma
1212 $forms = $this->preConvertPlural( $forms, 3 );
1313
1414 if ( $count == 1 ) {
1515 $index = 1;
16 - } elseif( $count == 2 ) {
 16+ } elseif ( $count == 2 ) {
1717 $index = 2;
1818 } else {
1919 $index = 3;
Index: trunk/phase3/languages/classes/LanguageMy.php
@@ -8,7 +8,7 @@
99 */
1010
1111 class LanguageMy extends Language {
12 - function commafy($_) {
 12+ function commafy( $_ ) {
1313 /* NO-op. Cannot use
1414 * $separatorTransformTable = array( ',' => '' )
1515 * That would break when parsing and doing strstr '' => 'foo';
Index: trunk/phase3/languages/classes/LanguageBe.php
@@ -15,15 +15,15 @@
1616 class LanguageBe extends Language {
1717
1818 function convertPlural( $count, $forms ) {
19 - if ( !count($forms) ) { return ''; }
 19+ if ( !count( $forms ) ) { return ''; }
2020 // FIXME: CLDR defines 4 plural forms instead of 3
2121 // http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
2222 $forms = $this->preConvertPlural( $forms, 3 );
2323
24 - if ($count > 10 && floor(($count % 100) / 10) == 1) {
 24+ if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) {
2525 return $forms[2];
2626 } else {
27 - switch ($count % 10) {
 27+ switch ( $count % 10 ) {
2828 case 1: return $forms[0];
2929 case 2:
3030 case 3:
Index: trunk/phase3/languages/classes/LanguageBg.php
@@ -9,9 +9,9 @@
1010 * ISO number formatting: 123 456 789,99.
1111 * Avoid tripple grouping by numbers with whole part up to 4 digits.
1212 */
13 - function commafy($_) {
14 - if (!preg_match('/^\d{1,4}$/',$_)) {
15 - return strrev((string)preg_replace('/(\d{3})(?=\d)(?!\d*\.)/','$1,',strrev($_)));
 13+ function commafy( $_ ) {
 14+ if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
 15+ return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
1616 } else {
1717 return $_;
1818 }
Index: trunk/phase3/languages/classes/LanguageBh.php
@@ -8,9 +8,9 @@
99 * Use singular form for zero
1010 */
1111 function convertPlural( $count, $forms ) {
12 - if ( !count($forms) ) { return ''; }
 12+ if ( !count( $forms ) ) { return ''; }
1313 $forms = $this->preConvertPlural( $forms, 2 );
1414
15 - return ($count <= 1) ? $forms[0] : $forms[1];
 15+ return ( $count <= 1 ) ? $forms[0] : $forms[1];
1616 }
1717 }
Index: trunk/phase3/languages/classes/LanguageKk_cyrl.php
@@ -27,10 +27,10 @@
2828 $allVowels = array( "е", "ө", "ү", "і", "ә", "э", "а", "о", "ұ", "ы", "я", "ё", "и" );
2929 // Preceding letters
3030 $Nasals = array( "м", "н", "ң" );
31 - $Sonants = array( "и", "й", "л", "р", "у", "ю");
 31+ $Sonants = array( "и", "й", "л", "р", "у", "ю" );
3232 $Consonants = array( "п", "ф", "к", "қ", "т", "ш", "с", "х", "ц", "ч", "щ", "б", "в", "г", "д" );
3333 $Sibilants = array( "ж", "з" );
34 - $Sonorants = array( "и", "й", "л", "р", "у", "ю", "м", "н", "ң", "ж", "з");
 34+ $Sonorants = array( "и", "й", "л", "р", "у", "ю", "м", "н", "ң", "ж", "з" );
3535
3636 // Possessives
3737 $firstPerson = array( "м", "ң" ); // 1st singular, 2nd unformal
@@ -44,7 +44,7 @@
4545 // Now convert the word
4646 switch ( $case ) {
4747 case "dc1":
48 - case "genitive": #ilik
 48+ case "genitive": # ilik
4949 if ( in_array( $wordEnding, $Consonants ) ) {
5050 if ( in_array( $wordLastVowel, $frontVowels ) ) {
5151 $word = $word . "тің";
@@ -57,7 +57,7 @@
5858 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
5959 $word = $word . "ның";
6060 }
61 - } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants )) {
 61+ } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) {
6262 if ( in_array( $wordLastVowel, $frontVowels ) ) {
6363 $word = $word . "дің";
6464 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@@ -66,7 +66,7 @@
6767 }
6868 break;
6969 case "dc2":
70 - case "dative": #barıs
 70+ case "dative": # barıs
7171 if ( in_array( $wordEnding, $Consonants ) ) {
7272 if ( in_array( $wordLastVowel, $frontVowels ) ) {
7373 $word = $word . "ке";
@@ -82,7 +82,7 @@
8383 }
8484 break;
8585 case "dc21":
86 - case "possessive dative": #täweldık + barıs
 86+ case "possessive dative": # täweldık + barıs
8787 if ( in_array( $wordEnding, $firstPerson ) ) {
8888 if ( in_array( $wordLastVowel, $frontVowels ) ) {
8989 $word = $word . "е";
@@ -104,7 +104,7 @@
105105 }
106106 break;
107107 case "dc3":
108 - case "accusative": #tabıs
 108+ case "accusative": # tabıs
109109 if ( in_array( $wordEnding, $Consonants ) ) {
110110 if ( in_array( $wordLastVowel, $frontVowels ) ) {
111111 $word = $word . "ті";
@@ -112,13 +112,13 @@
113113 $word = $word . "ты";
114114 }
115115 } elseif ( in_array( $wordEnding, $allVowels ) ) {
116 - if ( in_array($wordLastVowel, $frontVowels ) ) {
 116+ if ( in_array( $wordLastVowel, $frontVowels ) ) {
117117 $word = $word . "ні";
118118 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
119119 $word = $word . "ны";
120120 }
121 - } elseif ( in_array( $wordEnding, $Sonorants) ) {
122 - if ( in_array( $wordLastVowel, $frontVowels) ) {
 121+ } elseif ( in_array( $wordEnding, $Sonorants ) ) {
 122+ if ( in_array( $wordLastVowel, $frontVowels ) ) {
123123 $word = $word . "ді";
124124 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
125125 $word = $word . "ды";
@@ -126,7 +126,7 @@
127127 }
128128 break;
129129 case "dc31":
130 - case "possessive accusative": #täweldık + tabıs
 130+ case "possessive accusative": # täweldık + tabıs
131131 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
132132 if ( in_array( $wordLastVowel, $frontVowels ) ) {
133133 $word = $word . "ді";
@@ -138,7 +138,7 @@
139139 }
140140 break;
141141 case "dc4":
142 - case "locative": #jatıs
 142+ case "locative": # jatıs
143143 if ( in_array( $wordEnding, $Consonants ) ) {
144144 if ( in_array( $wordLastVowel, $frontVowels ) ) {
145145 $word = $word . "те";
@@ -146,7 +146,7 @@
147147 $word = $word . "та";
148148 }
149149 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
150 - if ( in_array( $wordLastVowel, $frontVowels) ) {
 150+ if ( in_array( $wordLastVowel, $frontVowels ) ) {
151151 $word = $word . "де";
152152 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
153153 $word = $word . "да";
@@ -154,7 +154,7 @@
155155 }
156156 break;
157157 case "dc41":
158 - case "possessive locative": #täweldık + jatıs
 158+ case "possessive locative": # täweldık + jatıs
159159 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
160160 if ( in_array( $wordLastVowel, $frontVowels ) ) {
161161 $word = $word . "де";
@@ -162,7 +162,7 @@
163163 $word = $word . "да";
164164 }
165165 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
166 - if ( in_array( $wordLastVowel, $frontVowels) ) {
 166+ if ( in_array( $wordLastVowel, $frontVowels ) ) {
167167 $word = $word . "нде";
168168 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
169169 $word = $word . "нда";
@@ -170,20 +170,20 @@
171171 }
172172 break;
173173 case "dc5":
174 - case "ablative": #şığıs
 174+ case "ablative": # şığıs
175175 if ( in_array( $wordEnding, $Consonants ) ) {
176176 if ( in_array( $wordLastVowel, $frontVowels ) ) {
177177 $word = $word . "тен";
178178 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
179179 $word = $word . "тан";
180180 }
181 - } elseif ( in_array($wordEnding, $allVowels ) || in_array($wordEnding, $Sonants ) || in_array($wordEnding, $Sibilants ) ) {
 181+ } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) {
182182 if ( in_array( $wordLastVowel, $frontVowels ) ) {
183183 $word = $word . "ден";
184184 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
185185 $word = $word . "дан";
186186 }
187 - } elseif ( in_array($wordEnding, $Nasals ) ) {
 187+ } elseif ( in_array( $wordEnding, $Nasals ) ) {
188188 if ( in_array( $wordLastVowel, $frontVowels ) ) {
189189 $word = $word . "нен";
190190 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@@ -192,14 +192,14 @@
193193 }
194194 break;
195195 case "dc51":
196 - case "possessive ablative": #täweldık + şığıs
 196+ case "possessive ablative": # täweldık + şığıs
197197 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
198198 if ( in_array( $wordLastVowel, $frontVowels ) ) {
199199 $word = $word . "нен";
200200 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
201201 $word = $word . "нан";
202202 }
203 - } elseif ( in_array($wordEnding, $secondPerson ) ) {
 203+ } elseif ( in_array( $wordEnding, $secondPerson ) ) {
204204 if ( in_array( $wordLastVowel, $frontVowels ) ) {
205205 $word = $word . "ден";
206206 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@@ -208,7 +208,7 @@
209209 }
210210 break;
211211 case "dc6":
212 - case "comitative": #kömektes
 212+ case "comitative": # kömektes
213213 if ( in_array( $wordEnding, $Consonants ) ) {
214214 $word = $word . "пен";
215215 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) {
@@ -218,7 +218,7 @@
219219 }
220220 break;
221221 case "dc61":
222 - case "possessive comitative": #täweldık + kömektes
 222+ case "possessive comitative": # täweldık + kömektes
223223 if ( in_array( $wordEnding, $Consonants ) ) {
224224 $word = $word . "пенен";
225225 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) {
@@ -227,7 +227,7 @@
228228 $word = $word . "бенен";
229229 }
230230 break;
231 - default: #dc0 #nominative #ataw
 231+ default: # dc0 #nominative #ataw
232232 }
233233 return $word;
234234 }
@@ -247,10 +247,10 @@
248248 $allVowels = array( "e", "ö", "ü", "i", "ä", "é", "a", "o", "u", "ı" );
249249 // Preceding letters
250250 $Nasals = array( "m", "n", "ñ" );
251 - $Sonants = array( "ï", "y", "ý", "l", "r", "w");
 251+ $Sonants = array( "ï", "y", "ý", "l", "r", "w" );
252252 $Consonants = array( "p", "f", "k", "q", "t", "ş", "s", "x", "c", "ç", "b", "v", "g", "d" );
253253 $Sibilants = array( "j", "z" );
254 - $Sonorants = array( "ï", "y", "ý", "l", "r", "w", "m", "n", "ñ", "j", "z");
 254+ $Sonorants = array( "ï", "y", "ý", "l", "r", "w", "m", "n", "ñ", "j", "z" );
255255
256256 // Possessives
257257 $firstPerson = array( "m", "ñ" ); // 1st singular, 2nd unformal
@@ -264,7 +264,7 @@
265265 // Now convert the word
266266 switch ( $case ) {
267267 case "dc1":
268 - case "genitive": #ilik
 268+ case "genitive": # ilik
269269 if ( in_array( $wordEnding, $Consonants ) ) {
270270 if ( in_array( $wordLastVowel, $frontVowels ) ) {
271271 $word = $word . "tiñ";
@@ -277,7 +277,7 @@
278278 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
279279 $word = $word . "nıñ";
280280 }
281 - } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants )) {
 281+ } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) {
282282 if ( in_array( $wordLastVowel, $frontVowels ) ) {
283283 $word = $word . "diñ";
284284 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@@ -286,7 +286,7 @@
287287 }
288288 break;
289289 case "dc2":
290 - case "dative": #barıs
 290+ case "dative": # barıs
291291 if ( in_array( $wordEnding, $Consonants ) ) {
292292 if ( in_array( $wordLastVowel, $frontVowels ) ) {
293293 $word = $word . "ke";
@@ -302,7 +302,7 @@
303303 }
304304 break;
305305 case "dc21":
306 - case "possessive dative": #täweldık + barıs
 306+ case "possessive dative": # täweldık + barıs
307307 if ( in_array( $wordEnding, $firstPerson ) ) {
308308 if ( in_array( $wordLastVowel, $frontVowels ) ) {
309309 $word = $word . "e";
@@ -324,7 +324,7 @@
325325 }
326326 break;
327327 case "dc3":
328 - case "accusative": #tabıs
 328+ case "accusative": # tabıs
329329 if ( in_array( $wordEnding, $Consonants ) ) {
330330 if ( in_array( $wordLastVowel, $frontVowels ) ) {
331331 $word = $word . "ti";
@@ -332,13 +332,13 @@
333333 $word = $word . "tı";
334334 }
335335 } elseif ( in_array( $wordEnding, $allVowels ) ) {
336 - if ( in_array($wordLastVowel, $frontVowels ) ) {
 336+ if ( in_array( $wordLastVowel, $frontVowels ) ) {
337337 $word = $word . "ni";
338338 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
339339 $word = $word . "nı";
340340 }
341 - } elseif ( in_array( $wordEnding, $Sonorants) ) {
342 - if ( in_array( $wordLastVowel, $frontVowels) ) {
 341+ } elseif ( in_array( $wordEnding, $Sonorants ) ) {
 342+ if ( in_array( $wordLastVowel, $frontVowels ) ) {
343343 $word = $word . "di";
344344 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
345345 $word = $word . "dı";
@@ -346,7 +346,7 @@
347347 }
348348 break;
349349 case "dc31":
350 - case "possessive accusative": #täweldık + tabıs
 350+ case "possessive accusative": # täweldık + tabıs
351351 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
352352 if ( in_array( $wordLastVowel, $frontVowels ) ) {
353353 $word = $word . "di";
@@ -358,7 +358,7 @@
359359 }
360360 break;
361361 case "dc4":
362 - case "locative": #jatıs
 362+ case "locative": # jatıs
363363 if ( in_array( $wordEnding, $Consonants ) ) {
364364 if ( in_array( $wordLastVowel, $frontVowels ) ) {
365365 $word = $word . "te";
@@ -366,7 +366,7 @@
367367 $word = $word . "ta";
368368 }
369369 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
370 - if ( in_array( $wordLastVowel, $frontVowels) ) {
 370+ if ( in_array( $wordLastVowel, $frontVowels ) ) {
371371 $word = $word . "de";
372372 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
373373 $word = $word . "da";
@@ -374,7 +374,7 @@
375375 }
376376 break;
377377 case "dc41":
378 - case "possessive locative": #täweldık + jatıs
 378+ case "possessive locative": # täweldık + jatıs
379379 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
380380 if ( in_array( $wordLastVowel, $frontVowels ) ) {
381381 $word = $word . "de";
@@ -382,7 +382,7 @@
383383 $word = $word . "da";
384384 }
385385 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
386 - if ( in_array( $wordLastVowel, $frontVowels) ) {
 386+ if ( in_array( $wordLastVowel, $frontVowels ) ) {
387387 $word = $word . "nde";
388388 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
389389 $word = $word . "nda";
@@ -390,20 +390,20 @@
391391 }
392392 break;
393393 case "dc5":
394 - case "ablative": #şığıs
 394+ case "ablative": # şığıs
395395 if ( in_array( $wordEnding, $Consonants ) ) {
396396 if ( in_array( $wordLastVowel, $frontVowels ) ) {
397397 $word = $word . "ten";
398398 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
399399 $word = $word . "tan";
400400 }
401 - } elseif ( in_array($wordEnding, $allVowels ) || in_array($wordEnding, $Sonants ) || in_array($wordEnding, $Sibilants ) ) {
 401+ } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) {
402402 if ( in_array( $wordLastVowel, $frontVowels ) ) {
403403 $word = $word . "den";
404404 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
405405 $word = $word . "dan";
406406 }
407 - } elseif ( in_array($wordEnding, $Nasals ) ) {
 407+ } elseif ( in_array( $wordEnding, $Nasals ) ) {
408408 if ( in_array( $wordLastVowel, $frontVowels ) ) {
409409 $word = $word . "nen";
410410 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@@ -412,14 +412,14 @@
413413 }
414414 break;
415415 case "dc51":
416 - case "possessive ablative": #täweldık + şığıs
 416+ case "possessive ablative": # täweldık + şığıs
417417 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
418418 if ( in_array( $wordLastVowel, $frontVowels ) ) {
419419 $word = $word . "nen";
420420 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
421421 $word = $word . "nan";
422422 }
423 - } elseif ( in_array($wordEnding, $secondPerson ) ) {
 423+ } elseif ( in_array( $wordEnding, $secondPerson ) ) {
424424 if ( in_array( $wordLastVowel, $frontVowels ) ) {
425425 $word = $word . "den";
426426 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@@ -428,7 +428,7 @@
429429 }
430430 break;
431431 case "dc6":
432 - case "comitative": #kömektes
 432+ case "comitative": # kömektes
433433 if ( in_array( $wordEnding, $Consonants ) ) {
434434 $word = $word . "pen";
435435 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) {
@@ -438,7 +438,7 @@
439439 }
440440 break;
441441 case "dc61":
442 - case "possessive comitative": #täweldık + kömektes
 442+ case "possessive comitative": # täweldık + kömektes
443443 if ( in_array( $wordEnding, $Consonants ) ) {
444444 $word = $word . "penen";
445445 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) {
@@ -447,7 +447,7 @@
448448 $word = $word . "benen";
449449 }
450450 break;
451 - default: #dc0 #nominative #ataw
 451+ default: # dc0 #nominative #ataw
452452 }
453453 return $word;
454454 }
@@ -467,10 +467,10 @@
468468 $allVowels = array( "ە", "ٶ", "ٷ", "ٸ", "ٵ", "ە", "ا", "و", "ۇ", "ى" );
469469 // Preceding letters
470470 $Nasals = array( "م", "ن", "ڭ" );
471 - $Sonants = array( "ي", "ي", "ل", "ر", "ۋ");
 471+ $Sonants = array( "ي", "ي", "ل", "ر", "ۋ" );
472472 $Consonants = array( "پ", "ف", "ك", "ق", "ت", "ش", "س", "ح", "تس", "چ", "ب", "ۆ", "گ", "د" );
473473 $Sibilants = array( "ج", "ز" );
474 - $Sonorants = array( "ي", "ي", "ل", "ر", "ۋ", "م", "ن", "ڭ", "ج", "ز");
 474+ $Sonorants = array( "ي", "ي", "ل", "ر", "ۋ", "م", "ن", "ڭ", "ج", "ز" );
475475
476476 // Possessives
477477 $firstPerson = array( "م", "ڭ" ); // 1st singular, 2nd unformal
@@ -484,7 +484,7 @@
485485 // Now convert the word
486486 switch ( $case ) {
487487 case "dc1":
488 - case "genitive": #ilik
 488+ case "genitive": # ilik
489489 if ( in_array( $wordEnding, $Consonants ) ) {
490490 if ( in_array( $wordLastVowel, $frontVowels ) ) {
491491 $word = $word . "تٸڭ";
@@ -497,7 +497,7 @@
498498 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
499499 $word = $word . "نىڭ";
500500 }
501 - } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants )) {
 501+ } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) {
502502 if ( in_array( $wordLastVowel, $frontVowels ) ) {
503503 $word = $word . "دٸڭ";
504504 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@@ -506,7 +506,7 @@
507507 }
508508 break;
509509 case "dc2":
510 - case "dative": #barıs
 510+ case "dative": # barıs
511511 if ( in_array( $wordEnding, $Consonants ) ) {
512512 if ( in_array( $wordLastVowel, $frontVowels ) ) {
513513 $word = $word . "كە";
@@ -522,7 +522,7 @@
523523 }
524524 break;
525525 case "dc21":
526 - case "possessive dative": #täweldık + barıs
 526+ case "possessive dative": # täweldık + barıs
527527 if ( in_array( $wordEnding, $firstPerson ) ) {
528528 if ( in_array( $wordLastVowel, $frontVowels ) ) {
529529 $word = $word . "ە";
@@ -544,7 +544,7 @@
545545 }
546546 break;
547547 case "dc3":
548 - case "accusative": #tabıs
 548+ case "accusative": # tabıs
549549 if ( in_array( $wordEnding, $Consonants ) ) {
550550 if ( in_array( $wordLastVowel, $frontVowels ) ) {
551551 $word = $word . "تٸ";
@@ -552,13 +552,13 @@
553553 $word = $word . "تى";
554554 }
555555 } elseif ( in_array( $wordEnding, $allVowels ) ) {
556 - if ( in_array($wordLastVowel, $frontVowels ) ) {
 556+ if ( in_array( $wordLastVowel, $frontVowels ) ) {
557557 $word = $word . "نٸ";
558558 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
559559 $word = $word . "نى";
560560 }
561 - } elseif ( in_array( $wordEnding, $Sonorants) ) {
562 - if ( in_array( $wordLastVowel, $frontVowels) ) {
 561+ } elseif ( in_array( $wordEnding, $Sonorants ) ) {
 562+ if ( in_array( $wordLastVowel, $frontVowels ) ) {
563563 $word = $word . "دٸ";
564564 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
565565 $word = $word . "دى";
@@ -566,7 +566,7 @@
567567 }
568568 break;
569569 case "dc31":
570 - case "possessive accusative": #täweldık + tabıs
 570+ case "possessive accusative": # täweldık + tabıs
571571 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
572572 if ( in_array( $wordLastVowel, $frontVowels ) ) {
573573 $word = $word . "دٸ";
@@ -578,7 +578,7 @@
579579 }
580580 break;
581581 case "dc4":
582 - case "locative": #jatıs
 582+ case "locative": # jatıs
583583 if ( in_array( $wordEnding, $Consonants ) ) {
584584 if ( in_array( $wordLastVowel, $frontVowels ) ) {
585585 $word = $word . "تە";
@@ -586,7 +586,7 @@
587587 $word = $word . "تا";
588588 }
589589 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
590 - if ( in_array( $wordLastVowel, $frontVowels) ) {
 590+ if ( in_array( $wordLastVowel, $frontVowels ) ) {
591591 $word = $word . "دە";
592592 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
593593 $word = $word . "دا";
@@ -594,7 +594,7 @@
595595 }
596596 break;
597597 case "dc41":
598 - case "possessive locative": #täweldık + jatıs
 598+ case "possessive locative": # täweldık + jatıs
599599 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
600600 if ( in_array( $wordLastVowel, $frontVowels ) ) {
601601 $word = $word . "دە";
@@ -602,7 +602,7 @@
603603 $word = $word . "دا";
604604 }
605605 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
606 - if ( in_array( $wordLastVowel, $frontVowels) ) {
 606+ if ( in_array( $wordLastVowel, $frontVowels ) ) {
607607 $word = $word . "ندە";
608608 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
609609 $word = $word . "ندا";
@@ -610,20 +610,20 @@
611611 }
612612 break;
613613 case "dc5":
614 - case "ablative": #şığıs
 614+ case "ablative": # şığıs
615615 if ( in_array( $wordEnding, $Consonants ) ) {
616616 if ( in_array( $wordLastVowel, $frontVowels ) ) {
617617 $word = $word . "تەن";
618618 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
619619 $word = $word . "تان";
620620 }
621 - } elseif ( in_array($wordEnding, $allVowels ) || in_array($wordEnding, $Sonants ) || in_array($wordEnding, $Sibilants ) ) {
 621+ } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) {
622622 if ( in_array( $wordLastVowel, $frontVowels ) ) {
623623 $word = $word . "دەن";
624624 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
625625 $word = $word . "دان";
626626 }
627 - } elseif ( in_array($wordEnding, $Nasals ) ) {
 627+ } elseif ( in_array( $wordEnding, $Nasals ) ) {
628628 if ( in_array( $wordLastVowel, $frontVowels ) ) {
629629 $word = $word . "نەن";
630630 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@@ -632,14 +632,14 @@
633633 }
634634 break;
635635 case "dc51":
636 - case "possessive ablative": #täweldık + şığıs
 636+ case "possessive ablative": # täweldık + şığıs
637637 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
638638 if ( in_array( $wordLastVowel, $frontVowels ) ) {
639639 $word = $word . "نەن";
640640 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
641641 $word = $word . "نان";
642642 }
643 - } elseif ( in_array($wordEnding, $secondPerson ) ) {
 643+ } elseif ( in_array( $wordEnding, $secondPerson ) ) {
644644 if ( in_array( $wordLastVowel, $frontVowels ) ) {
645645 $word = $word . "دەن";
646646 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@@ -648,7 +648,7 @@
649649 }
650650 break;
651651 case "dc6":
652 - case "comitative": #kömektes
 652+ case "comitative": # kömektes
653653 if ( in_array( $wordEnding, $Consonants ) ) {
654654 $word = $word . "پەن";
655655 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) {
@@ -658,7 +658,7 @@
659659 }
660660 break;
661661 case "dc61":
662 - case "possessive comitative": #täweldık + kömektes
 662+ case "possessive comitative": # täweldık + kömektes
663663 if ( in_array( $wordEnding, $Consonants ) ) {
664664 $word = $word . "پەنەن";
665665 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) {
@@ -667,7 +667,7 @@
668668 $word = $word . "بەنەن";
669669 }
670670 break;
671 - default: #dc0 #nominative #ataw
 671+ default: # dc0 #nominative #ataw
672672 }
673673 return $word;
674674 }
@@ -677,7 +677,7 @@
678678 $ar = array();
679679
680680 // Put the word in a form we can play with since we're using UTF-8
681 - $ar = preg_split('//u', parent::lc($word), -1, PREG_SPLIT_NO_EMPTY);
 681+ $ar = preg_split( '//u', parent::lc( $word ), -1, PREG_SPLIT_NO_EMPTY );
682682
683683 // Here's an array with the order of the letters in the word reversed
684684 // so we can find a match quicker *shrug*
@@ -712,7 +712,7 @@
713713 */
714714 function commafy( $_ ) {
715715 if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
716 - return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev($_) ) );
 716+ return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
717717 } else {
718718 return $_;
719719 }
Index: trunk/phase3/languages/classes/LanguageFi.php
@@ -12,7 +12,7 @@
1313 # Invoked with {{GRAMMAR:case|word}}
1414 function convertGrammar( $word, $case ) {
1515 global $wgGrammarForms;
16 - if ( isset($wgGrammarForms['fi'][$case][$word]) ) {
 16+ if ( isset( $wgGrammarForms['fi'][$case][$word] ) ) {
1717 return $wgGrammarForms['fi'][$case][$word];
1818 }
1919
@@ -38,18 +38,18 @@
3939 $word .= 'n';
4040 break;
4141 case 'elative':
42 - $word .= ($aou ? 'sta' : 'stä');
 42+ $word .= ( $aou ? 'sta' : 'stä' );
4343 break;
4444 case 'partitive':
45 - $word .= ($aou ? 'a' : 'ä');
 45+ $word .= ( $aou ? 'a' : 'ä' );
4646 break;
4747 case 'illative':
4848 # Double the last letter and add 'n'
4949 # mb_substr has a compatibility function in GlobalFunctions.php
50 - $word = $word . mb_substr($word, -1) . 'n';
 50+ $word = $word . mb_substr( $word, -1 ) . 'n';
5151 break;
5252 case 'inessive':
53 - $word .= ($aou ? 'ssa' : 'ssä');
 53+ $word .= ( $aou ? 'ssa' : 'ssä' );
5454 break;
5555 }
5656 return $word;
@@ -113,15 +113,15 @@
114114 );
115115
116116 $final = '';
117 - $tokens = explode ( ' ', $str);
118 - foreach( $tokens as $item ) {
119 - if ( !is_numeric($item) ) {
120 - if ( count ( explode( '-', $item ) ) == 3 && strlen($item) == 10 ) {
 117+ $tokens = explode ( ' ', $str );
 118+ foreach ( $tokens as $item ) {
 119+ if ( !is_numeric( $item ) ) {
 120+ if ( count ( explode( '-', $item ) ) == 3 && strlen( $item ) == 10 ) {
121121 list( $yyyy, $mm, $dd ) = explode( '-', $item );
122 - $final .= ' ' . $this->date( "{$yyyy}{$mm}{$dd}00000000");
 122+ $final .= ' ' . $this->date( "{$yyyy}{$mm}{$dd}00000000" );
123123 continue;
124124 }
125 - if( isset( $weekds[$item] ) ) {
 125+ if ( isset( $weekds[$item] ) ) {
126126 $final .= ' ' . $weekds[$item];
127127 continue;
128128 }
Index: trunk/phase3/languages/classes/LanguageNso.php
@@ -8,9 +8,9 @@
99 * Use singular form for zero
1010 */
1111 function convertPlural( $count, $forms ) {
12 - if ( !count($forms) ) { return ''; }
 12+ if ( !count( $forms ) ) { return ''; }
1313 $forms = $this->preConvertPlural( $forms, 2 );
1414
15 - return ($count <= 1) ? $forms[0] : $forms[1];
 15+ return ( $count <= 1 ) ? $forms[0] : $forms[1];
1616 }
1717 }
Index: trunk/phase3/languages/classes/LanguageYue.php
@@ -17,7 +17,7 @@
1818 $s = self::insertSpace( $string, $reg );
1919 return $s;
2020 }
21 -
 21+
2222 function normalizeForSearch( $string ) {
2323 wfProfileIn( __METHOD__ );
2424
Index: trunk/phase3/languages/classes/LanguageBs.php
@@ -7,15 +7,15 @@
88 class LanguageBs extends Language {
99
1010 function convertPlural( $count, $forms ) {
11 - if ( !count($forms) ) { return ''; }
 11+ if ( !count( $forms ) ) { return ''; }
1212 $forms = $this->preConvertPlural( $forms, 3 );
1313
1414 // FIXME: CLDR defines 4 plural forms instead of 3. Plural for decimals is missing.
1515 // http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
16 - if ($count > 10 && floor(($count % 100) / 10) == 1) {
 16+ if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) {
1717 return $forms[2];
1818 } else {
19 - switch ($count % 10) {
 19+ switch ( $count % 10 ) {
2020 case 1: return $forms[0];
2121 case 2:
2222 case 3:
@@ -32,7 +32,7 @@
3333 */
3434 function convertGrammar( $word, $case ) {
3535 global $wgGrammarForms;
36 - if ( isset($wgGrammarForms['bs'][$case][$word]) ) {
 36+ if ( isset( $wgGrammarForms['bs'][$case][$word] ) ) {
3737 return $wgGrammarForms['bs'][$case][$word];
3838 }
3939 switch ( $case ) {
Index: trunk/phase3/languages/classes/LanguageFr.php
@@ -9,9 +9,9 @@
1010 * Use singular form for zero (see bug 7309)
1111 */
1212 function convertPlural( $count, $forms ) {
13 - if ( !count($forms) ) { return ''; }
 13+ if ( !count( $forms ) ) { return ''; }
1414 $forms = $this->preConvertPlural( $forms, 2 );
1515
16 - return ($count <= 1) ? $forms[0] : $forms[1];
 16+ return ( $count <= 1 ) ? $forms[0] : $forms[1];
1717 }
1818 }
Index: trunk/phase3/languages/classes/LanguageRo.php
@@ -7,7 +7,7 @@
88 function convertPlural( $count, $forms ) {
99 // Plural rules per
1010 // http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#ro
11 - if ( !count($forms) ) { return ''; }
 11+ if ( !count( $forms ) ) { return ''; }
1212
1313 $forms = $this->preConvertPlural( $forms, 3 );
1414
Index: trunk/phase3/languages/classes/LanguageZh.php
@@ -1,25 +1,25 @@
22 <?php
33
4 -require_once( dirname(__FILE__).'/../LanguageConverter.php' );
5 -require_once( dirname(__FILE__).'/LanguageZh_hans.php' );
 4+require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
 5+require_once( dirname( __FILE__ ) . '/LanguageZh_hans.php' );
66
77 /**
88 * @ingroup Language
99 */
1010 class ZhConverter extends LanguageConverter {
1111
12 - function __construct($langobj, $maincode,
13 - $variants=array(),
14 - $variantfallbacks=array(),
 12+ function __construct( $langobj, $maincode,
 13+ $variants = array(),
 14+ $variantfallbacks = array(),
1515 $flags = array(),
1616 $manualLevel = array() ) {
1717 $this->mDescCodeSep = ':';
1818 $this->mDescVarSep = ';';
19 - parent::__construct($langobj, $maincode,
 19+ parent::__construct( $langobj, $maincode,
2020 $variants,
2121 $variantfallbacks,
2222 $flags,
23 - $manualLevel);
 23+ $manualLevel );
2424 $names = array(
2525 'zh' => '原文',
2626 'zh-hans' => '简体',
@@ -31,20 +31,20 @@
3232 'zh-sg' => '新加坡',
3333 'zh-my' => '大马',
3434 );
35 - $this->mVariantNames = array_merge($this->mVariantNames,$names);
 35+ $this->mVariantNames = array_merge( $this->mVariantNames, $names );
3636 }
3737
3838 function loadDefaultTables() {
39 - require( dirname(__FILE__)."/../../includes/ZhConversion.php" );
 39+ require( dirname( __FILE__ ) . "/../../includes/ZhConversion.php" );
4040 $this->mTables = array(
4141 'zh-hans' => new ReplacementArray( $zh2Hans ),
4242 'zh-hant' => new ReplacementArray( $zh2Hant ),
43 - 'zh-cn' => new ReplacementArray( array_merge($zh2Hans, $zh2CN) ),
44 - 'zh-hk' => new ReplacementArray( array_merge($zh2Hant, $zh2HK) ),
45 - 'zh-mo' => new ReplacementArray( array_merge($zh2Hant, $zh2HK) ),
46 - 'zh-my' => new ReplacementArray( array_merge($zh2Hans, $zh2SG) ),
47 - 'zh-sg' => new ReplacementArray( array_merge($zh2Hans, $zh2SG) ),
48 - 'zh-tw' => new ReplacementArray( array_merge($zh2Hant, $zh2TW) ),
 43+ 'zh-cn' => new ReplacementArray( array_merge( $zh2Hans, $zh2CN ) ),
 44+ 'zh-hk' => new ReplacementArray( array_merge( $zh2Hant, $zh2HK ) ),
 45+ 'zh-mo' => new ReplacementArray( array_merge( $zh2Hant, $zh2HK ) ),
 46+ 'zh-my' => new ReplacementArray( array_merge( $zh2Hans, $zh2SG ) ),
 47+ 'zh-sg' => new ReplacementArray( array_merge( $zh2Hans, $zh2SG ) ),
 48+ 'zh-tw' => new ReplacementArray( array_merge( $zh2Hant, $zh2TW ) ),
4949 'zh' => new ReplacementArray
5050 );
5151 }
@@ -62,7 +62,7 @@
6363 to mark anything.
6464 $noParse is there for compatibility with LanguageConvert::markNoConversion
6565 */
66 - function markNoConversion($text, $noParse = false) {
 66+ function markNoConversion( $text, $noParse = false ) {
6767 return $text;
6868 }
6969
@@ -83,20 +83,20 @@
8484 global $wgHooks;
8585 parent::__construct();
8686
87 - $variants = array('zh','zh-hans','zh-hant','zh-cn','zh-hk','zh-mo','zh-my','zh-sg','zh-tw');
88 -
 87+ $variants = array( 'zh', 'zh-hans', 'zh-hant', 'zh-cn', 'zh-hk', 'zh-mo', 'zh-my', 'zh-sg', 'zh-tw' );
 88+
8989 $variantfallbacks = array(
90 - 'zh' => array('zh-hans','zh-hant','zh-cn','zh-tw','zh-hk','zh-sg','zh-mo','zh-my'),
91 - 'zh-hans' => array('zh-cn','zh-sg','zh-my'),
92 - 'zh-hant' => array('zh-tw','zh-hk','zh-mo'),
93 - 'zh-cn' => array('zh-hans','zh-sg','zh-my'),
94 - 'zh-sg' => array('zh-hans','zh-cn','zh-my'),
95 - 'zh-my' => array('zh-hans','zh-sg','zh-cn'),
96 - 'zh-tw' => array('zh-hant','zh-hk','zh-mo'),
97 - 'zh-hk' => array('zh-hant','zh-mo','zh-tw'),
98 - 'zh-mo' => array('zh-hant','zh-hk','zh-tw'),
 90+ 'zh' => array( 'zh-hans', 'zh-hant', 'zh-cn', 'zh-tw', 'zh-hk', 'zh-sg', 'zh-mo', 'zh-my' ),
 91+ 'zh-hans' => array( 'zh-cn', 'zh-sg', 'zh-my' ),
 92+ 'zh-hant' => array( 'zh-tw', 'zh-hk', 'zh-mo' ),
 93+ 'zh-cn' => array( 'zh-hans', 'zh-sg', 'zh-my' ),
 94+ 'zh-sg' => array( 'zh-hans', 'zh-cn', 'zh-my' ),
 95+ 'zh-my' => array( 'zh-hans', 'zh-sg', 'zh-cn' ),
 96+ 'zh-tw' => array( 'zh-hant', 'zh-hk', 'zh-mo' ),
 97+ 'zh-hk' => array( 'zh-hant', 'zh-mo', 'zh-tw' ),
 98+ 'zh-mo' => array( 'zh-hant', 'zh-hk', 'zh-tw' ),
9999 );
100 - $ml=array(
 100+ $ml = array(
101101 'zh' => 'disable',
102102 'zh-hans' => 'unidirectional',
103103 'zh-hant' => 'unidirectional',
@@ -105,7 +105,7 @@
106106 $this->mConverter = new ZhConverter( $this, 'zh',
107107 $variants, $variantfallbacks,
108108 array(),
109 - $ml);
 109+ $ml );
110110
111111 $wgHooks['ArticleSaveComplete'][] = $this->mConverter;
112112 }
@@ -114,13 +114,13 @@
115115 function segmentForDiff( $text ) {
116116 return preg_replace(
117117 "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
118 - "' ' .\"$1\"", $text);
 118+ "' ' .\"$1\"", $text );
119119 }
120120
121121 function unsegmentForDiff( $text ) {
122122 return preg_replace(
123123 "/ ([\\xc0-\\xff][\\x80-\\xbf]*)/e",
124 - "\"$1\"", $text);
 124+ "\"$1\"", $text );
125125 }
126126
127127 /**
@@ -149,7 +149,7 @@
150150 $terms = implode( '|', $termsArray );
151151 $terms = self::convertDoubleWidth( $terms );
152152 $terms = implode( '|', $this->mConverter->autoConvertToAllVariants( $terms ) );
153 - $ret = array_unique( explode('|', $terms) );
 153+ $ret = array_unique( explode( '|', $terms ) );
154154 return $ret;
155155 }
156156 }
Index: trunk/phase3/languages/classes/LanguageRu.php
@@ -11,45 +11,45 @@
1212 # Invoked with {{grammar:case|word}}
1313 function convertGrammar( $word, $case ) {
1414 global $wgGrammarForms;
15 - if ( isset($wgGrammarForms['ru'][$case][$word]) ) {
 15+ if ( isset( $wgGrammarForms['ru'][$case][$word] ) ) {
1616 return $wgGrammarForms['ru'][$case][$word];
1717 }
1818
1919 # These rules are not perfect, but they are currently only used for site names so it doesn't
2020 # matter if they are wrong sometimes. Just add a special case for your site name if necessary.
2121
22 - #join and array_slice instead mb_substr
 22+ # join and array_slice instead mb_substr
2323 $ar = array();
2424 preg_match_all( '/./us', $word, $ar );
25 - if (!preg_match("/[a-zA-Z_]/us", $word))
 25+ if ( !preg_match( "/[a-zA-Z_]/us", $word ) )
2626 switch ( $case ) {
27 - case 'genitive': #родительный падеж
28 - if ((join('',array_slice($ar[0],-4))=='вики') || (join('',array_slice($ar[0],-4))=='Вики'))
29 - {}
30 - elseif (join('',array_slice($ar[0],-1))=='ь')
31 - $word = join('',array_slice($ar[0],0,-1)).'я';
32 - elseif (join('',array_slice($ar[0],-2))=='ия')
33 - $word=join('',array_slice($ar[0],0,-2)).'ии';
34 - elseif (join('',array_slice($ar[0],-2))=='ка')
35 - $word=join('',array_slice($ar[0],0,-2)).'ки';
36 - elseif (join('',array_slice($ar[0],-2))=='ти')
37 - $word=join('',array_slice($ar[0],0,-2)).'тей';
38 - elseif (join('',array_slice($ar[0],-2))=='ды')
39 - $word=join('',array_slice($ar[0],0,-2)).'дов';
40 - elseif (join('',array_slice($ar[0],-3))=='ник')
41 - $word=join('',array_slice($ar[0],0,-3)).'ника';
 27+ case 'genitive': # родительный падеж
 28+ if ( ( join( '', array_slice( $ar[0], -4 ) ) == 'вики' ) || ( join( '', array_slice( $ar[0], -4 ) ) == 'Вики' ) )
 29+ { }
 30+ elseif ( join( '', array_slice( $ar[0], -1 ) ) == 'ь' )
 31+ $word = join( '', array_slice( $ar[0], 0, -1 ) ) . 'я';
 32+ elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ия' )
 33+ $word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'ии';
 34+ elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ка' )
 35+ $word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'ки';
 36+ elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ти' )
 37+ $word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'тей';
 38+ elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ды' )
 39+ $word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'дов';
 40+ elseif ( join( '', array_slice( $ar[0], -3 ) ) == 'ник' )
 41+ $word = join( '', array_slice( $ar[0], 0, -3 ) ) . 'ника';
4242 break;
43 - case 'dative': #дательный падеж
44 - #stub
 43+ case 'dative': # дательный падеж
 44+ # stub
4545 break;
46 - case 'accusative': #винительный падеж
47 - #stub
 46+ case 'accusative': # винительный падеж
 47+ # stub
4848 break;
49 - case 'instrumental': #творительный падеж
50 - #stub
 49+ case 'instrumental': # творительный падеж
 50+ # stub
5151 break;
52 - case 'prepositional': #предложный падеж
53 - #stub
 52+ case 'prepositional': # предложный падеж
 53+ # stub
5454 break;
5555 }
5656 return $word;
@@ -71,19 +71,19 @@
7272 */
7373
7474 function convertPlural( $count, $forms ) {
75 - if ( !count($forms) ) { return ''; }
 75+ if ( !count( $forms ) ) { return ''; }
7676
77 - //if no number with word, then use $form[0] for singular and $form[1] for plural or zero
78 - if( count($forms) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
 77+ // if no number with word, then use $form[0] for singular and $form[1] for plural or zero
 78+ if ( count( $forms ) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
7979
8080 // FIXME: CLDR defines 4 plural forms. Form with decimals missing.
8181 // See http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#ru
8282 $forms = $this->preConvertPlural( $forms, 3 );
8383
84 - if ($count > 10 && floor(($count % 100) / 10) == 1) {
 84+ if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) {
8585 return $forms[2];
8686 } else {
87 - switch ($count % 10) {
 87+ switch ( $count % 10 ) {
8888 case 1: return $forms[0];
8989 case 2:
9090 case 3:
@@ -98,11 +98,11 @@
9999 * See manual of style at http://ru.wikipedia.org/wiki/Википедия:Оформление_статей
100100 * So "1 234 567", "12 345" but "1234"
101101 */
102 - function commafy($_) {
103 - if (preg_match('/^-?\d{1,4}(\.\d*)?$/',$_)) {
 102+ function commafy( $_ ) {
 103+ if ( preg_match( '/^-?\d{1,4}(\.\d*)?$/', $_ ) ) {
104104 return $_;
105105 } else {
106 - return strrev((string)preg_replace('/(\d{3})(?=\d)(?!\d*\.)/','$1,',strrev($_)));
 106+ return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
107107 }
108108 }
109109 }
Index: trunk/phase3/languages/classes/LanguageGa.php
@@ -9,13 +9,13 @@
1010 # Invoked with {{GRAMMAR:transformation|word}}
1111 function convertGrammar( $word, $case ) {
1212 global $wgGrammarForms;
13 - if ( isset($wgGrammarForms['ga'][$case][$word]) ) {
 13+ if ( isset( $wgGrammarForms['ga'][$case][$word] ) ) {
1414 return $wgGrammarForms['ga'][$case][$word];
1515 }
1616
1717 switch ( $case ) {
1818 case 'ainmlae':
19 - switch ($word) {
 19+ switch ( $word ) {
2020 case 'an Domhnach':
2121 $word = 'Dé Domhnaigh'; break;
2222 case 'an Luan':
@@ -36,14 +36,14 @@
3737 }
3838
3939 function convertPlural( $count, $forms ) {
40 - if ( !count($forms) ) { return ''; }
 40+ if ( !count( $forms ) ) { return ''; }
4141
4242 // plural forms per http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#ga
4343 $forms = $this->preConvertPlural( $forms, 3 );
4444
4545 if ( $count == 1 ) {
4646 $index = 0;
47 - } elseif( $count == 2 ) {
 47+ } elseif ( $count == 2 ) {
4848 $index = 1;
4949 } else {
5050 $index = 2;
Index: trunk/phase3/languages/classes/LanguageGd.php
@@ -18,7 +18,7 @@
1919 *
2020 */
2121 function convertPlural( $count, $forms ) {
22 - if ( !count($forms) ) { return ''; }
 22+ if ( !count( $forms ) ) { return ''; }
2323 $forms = $this->preConvertPlural( $forms, 4 );
2424
2525 $count = abs( $count );
Index: trunk/phase3/languages/classes/LanguageKk.php
@@ -1,15 +1,15 @@
22 <?php
33
4 -require_once( dirname(__FILE__).'/../LanguageConverter.php' );
5 -require_once( dirname(__FILE__).'/LanguageKk_cyrl.php' );
 4+require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
 5+require_once( dirname( __FILE__ ) . '/LanguageKk_cyrl.php' );
66
77 define( 'KK_C_UC', 'АӘБВГҒДЕЁЖЗИЙКҚЛМНҢОӨПРСТУҰҮФХҺЦЧШЩЪЫІЬЭЮЯ' ); # Kazakh Cyrillic uppercase
88 define( 'KK_C_LC', 'аәбвгғдеёжзийкқлмнңоөпрстуұүфхһцчшщъыіьэюя' ); # Kazakh Cyrillic lowercase
99 define( 'KK_L_UC', 'AÄBCÇDEÉFGĞHIİÏJKLMNÑOÖPQRSŞTUÜVWXYÝZ' ); # Kazakh Latin uppercase
1010 define( 'KK_L_LC', 'aäbcçdeéfgğhıiïjklmnñoöpqrsştuüvwxyýz' ); # Kazakh Latin lowercase
11 -//define( 'KK_A', 'ٴابپتجحدرزسشعفقكلمنڭەوۇۋۆىيچھ' ); # Kazakh Arabic
 11+// define( 'KK_A', 'ٴابپتجحدرزسشعفقكلمنڭەوۇۋۆىيچھ' ); # Kazakh Arabic
1212 define( 'H_HAMZA', 'ٴ' ); # U+0674 ARABIC LETTER HIGH HAMZA
13 -//define( 'ZWNJ', '‌' ); # U+200C ZERO WIDTH NON-JOINER
 13+// define( 'ZWNJ', '‌' ); # U+200C ZERO WIDTH NON-JOINER
1414
1515 /** Kazakh (Қазақша)
1616 * converter routines
@@ -18,10 +18,10 @@
1919 */
2020 class KkConverter extends LanguageConverter {
2121
22 - function __construct($langobj, $maincode,
23 - $variants=array(),
24 - $variantfallbacks=array(),
25 - $flags = array()) {
 22+ function __construct( $langobj, $maincode,
 23+ $variants = array(),
 24+ $variantfallbacks = array(),
 25+ $flags = array() ) {
2626 parent::__construct( $langobj, $maincode,
2727 $variants, $variantfallbacks, $flags );
2828
@@ -46,9 +46,9 @@
4747 'kk-cyrl' => new ReplacementArray( $kk2Cyrl ),
4848 'kk-latn' => new ReplacementArray( $kk2Latn ),
4949 'kk-arab' => new ReplacementArray( $kk2Arab ),
50 - 'kk-kz' => new ReplacementArray( array_merge($kk2Cyrl, $kk2KZ) ),
51 - 'kk-tr' => new ReplacementArray( array_merge($kk2Latn, $kk2TR) ),
52 - 'kk-cn' => new ReplacementArray( array_merge($kk2Arab, $kk2CN) ),
 50+ 'kk-kz' => new ReplacementArray( array_merge( $kk2Cyrl, $kk2KZ ) ),
 51+ 'kk-tr' => new ReplacementArray( array_merge( $kk2Latn, $kk2TR ) ),
 52+ 'kk-cn' => new ReplacementArray( array_merge( $kk2Arab, $kk2CN ) ),
5353 'kk' => new ReplacementArray()
5454 );
5555 }
@@ -62,24 +62,24 @@
6363 function loadRegs() {
6464
6565 $this->mCyrl2Latn = array(
66 - ## Punctuation
 66+ # # Punctuation
6767 '/№/u' => 'No.',
68 - ## Е after vowels
 68+ # # Е after vowels
6969 '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])Е/u' => '$1YE',
7070 '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])е/ui' => '$1ye',
71 - ## leading ЁЮЯЩ
72 - '/^Ё(['.KK_C_UC.']|$)/u' => 'YO$1', '/^Ё(['.KK_C_LC.']|$)/u' => 'Yo$1',
73 - '/^Ю(['.KK_C_UC.']|$)/u' => 'YU$1', '/^Ю(['.KK_C_LC.']|$)/u' => 'Yu$1',
74 - '/^Я(['.KK_C_UC.']|$)/u' => 'YA$1', '/^Я(['.KK_C_LC.']|$)/u' => 'Ya$1',
75 - '/^Щ(['.KK_C_UC.']|$)/u' => 'ŞÇ$1', '/^Щ(['.KK_C_LC.']|$)/u' => 'Şç$1',
76 - ## other ЁЮЯ
 71+ # # leading ЁЮЯЩ
 72+ '/^Ё([' . KK_C_UC . ']|$)/u' => 'YO$1', '/^Ё([' . KK_C_LC . ']|$)/u' => 'Yo$1',
 73+ '/^Ю([' . KK_C_UC . ']|$)/u' => 'YU$1', '/^Ю([' . KK_C_LC . ']|$)/u' => 'Yu$1',
 74+ '/^Я([' . KK_C_UC . ']|$)/u' => 'YA$1', '/^Я([' . KK_C_LC . ']|$)/u' => 'Ya$1',
 75+ '/^Щ([' . KK_C_UC . ']|$)/u' => 'ŞÇ$1', '/^Щ([' . KK_C_LC . ']|$)/u' => 'Şç$1',
 76+ # # other ЁЮЯ
7777 '/Ё/u' => 'YO', '/ё/u' => 'yo',
7878 '/Ю/u' => 'YU', '/ю/u' => 'yu',
7979 '/Я/u' => 'YA', '/я/u' => 'ya',
8080 '/Щ/u' => 'ŞÇ', '/щ/u' => 'şç',
81 - ## soft and hard signs
 81+ # # soft and hard signs
8282 '/[ъЪ]/u' => 'ʺ', '/[ьЬ]/u' => 'ʹ',
83 - ## other characters
 83+ # # other characters
8484 '/А/u' => 'A', '/а/u' => 'a', '/Ә/u' => 'Ä', '/ә/u' => 'ä',
8585 '/Б/u' => 'B', '/б/u' => 'b', '/В/u' => 'V', '/в/u' => 'v',
8686 '/Г/u' => 'G', '/г/u' => 'g', '/Ғ/u' => 'Ğ', '/ғ/u' => 'ğ',
@@ -101,24 +101,24 @@
102102 );
103103
104104 $this->mLatn2Cyrl = array(
105 - ## Punctuation
 105+ # # Punctuation
106106 '/#|No\./' => '№',
107 - ## Şç
108 - '/ŞÇʹ/u'=> 'ЩЬ', '/Şçʹ/u'=> 'Щь', '/Şçʹ/u'=> 'Щь',
 107+ # # Şç
 108+ '/ŞÇʹ/u' => 'ЩЬ', '/Şçʹ/u' => 'Щь', '/Şçʹ/u' => 'Щь',
109109 '/Ş[Çç]/u' => 'Щ', '/şç/u' => 'щ',
110 - ## soft and hard signs
111 - '/(['.KK_L_UC.'])ʺ(['.KK_L_UC.'])/u' => '$1Ъ$2',
112 - '/ʺ(['.KK_L_LC.'])/u' => 'ъ$1',
113 - '/(['.KK_L_UC.'])ʹ(['.KK_L_UC.'])/u' => '$1Ь$2',
114 - '/ʹ(['.KK_L_LC.'])/u' => 'ь$1',
 110+ # # soft and hard signs
 111+ '/([' . KK_L_UC . '])ʺ([' . KK_L_UC . '])/u' => '$1Ъ$2',
 112+ '/ʺ([' . KK_L_LC . '])/u' => 'ъ$1',
 113+ '/([' . KK_L_UC . '])ʹ([' . KK_L_UC . '])/u' => '$1Ь$2',
 114+ '/ʹ([' . KK_L_LC . '])/u' => 'ь$1',
115115 '/ʺ/u' => 'ъ',
116116 '/ʹ/u' => 'ь',
117 - ## Ye Yo Yu Ya.
 117+ # # Ye Yo Yu Ya.
118118 '/Y[Ee]/u' => 'Е', '/ye/u' => 'е',
119119 '/Y[Oo]/u' => 'Ё', '/yo/u' => 'ё',
120120 '/Y[UWuw]/u' => 'Ю', '/y[uw]/u' => 'ю',
121121 '/Y[Aa]/u' => 'Я', '/ya/u' => 'я',
122 - ## other characters
 122+ # # other characters
123123 '/A/u' => 'А', '/a/u' => 'а', '/Ä/u' => 'Ә', '/ä/u' => 'ә',
124124 '/B/u' => 'Б', '/b/u' => 'б', '/C/u' => 'Ц', '/c/u' => 'ц',
125125 '/Ç/u' => 'Ч', '/ç/u' => 'ч', '/D/u' => 'Д', '/d/u' => 'д',
@@ -140,14 +140,14 @@
141141 );
142142
143143 $this->mCyLa2Arab = array(
144 - ## Punctuation -> Arabic
 144+ # # Punctuation -> Arabic
145145 '/#|№|No\./u' => '؀', # &#x0600;
146146 '/\,/' => '،', # &#x060C;
147147 '/;/' => '؛', # &#x061B;
148148 '/\?/' => '؟', # &#x061F;
149149 '/%/' => '٪', # &#x066A;
150150 '/\*/' => '٭', # &#x066D;
151 - ## Digits -> Arabic
 151+ # # Digits -> Arabic
152152 '/0/' => '۰', # &#x06F0;
153153 '/1/' => '۱', # &#x06F1;
154154 '/2/' => '۲', # &#x06F2;
@@ -158,7 +158,7 @@
159159 '/7/' => '۷', # &#x06F7;
160160 '/8/' => '۸', # &#x06F8;
161161 '/9/' => '۹', # &#x06F9;
162 - ## Cyrillic -> Arabic
 162+ # # Cyrillic -> Arabic
163163 '/Аллаһ/ui' => 'ﷲ',
164164 '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])е/ui' => '$1يە',
165165 '/[еэ]/ui' => 'ە', '/[ъь]/ui' => '',
@@ -166,14 +166,14 @@
167167 '/[и]/ui' => 'ىي', '/ё/ui' => 'يو', '/ю/ui' => 'يۋ', '/я/ui' => 'يا', '/[й]/ui' => 'ي',
168168 '/ц/ui' => 'تس', '/щ/ui' => 'شش',
169169 '/һ/ui' => 'ح', '/ч/ui' => 'تش',
170 - #'/һ/ui' => 'ھ', '/ч/ui' => 'چ',
 170+ # '/һ/ui' => 'ھ', '/ч/ui' => 'چ',
171171 '/б/ui' => 'ب', '/в/ui' => 'ۆ', '/г/ui' => 'گ', '/ғ/ui' => 'ع',
172172 '/д/ui' => 'د', '/ж/ui' => 'ج', '/з/ui' => 'ز', '/к/ui' => 'ك',
173173 '/қ/ui' => 'ق', '/л/ui' => 'ل', '/м/ui' => 'م', '/н/ui' => 'ن',
174174 '/ң/ui' => 'ڭ', '/п/ui' => 'پ', '/р/ui' => 'ر', '/с/ui' => 'س',
175175 '/т/ui' => 'ت', '/у/ui' => 'ۋ', '/ф/ui' => 'ف', '/х/ui' => 'ح',
176176 '/ш/ui' => 'ش',
177 - ## Latin -> Arabic // commented for now...
 177+ # # Latin -> Arabic // commented for now...
178178 /*'/Allah/ui' => 'ﷲ',
179179 '/[eé]/ui' => 'ە', '/[yý]/ui' => 'ي', '/[ʺʹ]/ui' => '',
180180 '/[aä]/ui' => 'ا', '/[oö]/ui' => 'و', '/[uü]/ui' => 'ۇ',
@@ -195,13 +195,13 @@
196196 update: delete all rule parsing because it's not used
197197 currently, and just produces a couple of bugs
198198 */
199 - function parseManualRule($rule, $flags=array()) {
200 - if(in_array('T',$flags)){
201 - return parent::parseManualRule($rule, $flags);
 199+ function parseManualRule( $rule, $flags = array() ) {
 200+ if ( in_array( 'T', $flags ) ) {
 201+ return parent::parseManualRule( $rule, $flags );
202202 }
203203
204204 // otherwise ignore all formatting
205 - foreach($this->mVariants as $v) {
 205+ foreach ( $this->mVariants as $v ) {
206206 $carray[$v] = $rule;
207207 }
208208
@@ -216,35 +216,35 @@
217217 */
218218 function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
219219 // check for user namespace
220 - if(is_object($nt)){
 220+ if ( is_object( $nt ) ) {
221221 $ns = $nt->getNamespace();
222 - if($ns==NS_USER || $ns==NS_USER_TALK)
 222+ if ( $ns == NS_USER || $ns == NS_USER_TALK )
223223 return;
224224 }
225225
226 - $oldlink=$link;
 226+ $oldlink = $link;
227227 parent::findVariantLink( $link, $nt, $ignoreOtherCond );
228 - if( $this->getPreferredVariant()==$this->mMainLanguageCode )
229 - $link=$oldlink;
 228+ if ( $this->getPreferredVariant() == $this->mMainLanguageCode )
 229+ $link = $oldlink;
230230 }
231231
232232 /*
233233 * An ugly function wrapper for parsing Image titles
234234 * (to prevent image name conversion)
235235 */
236 - function autoConvert($text, $toVariant=false) {
 236+ function autoConvert( $text, $toVariant = false ) {
237237 global $wgTitle;
238 - if(is_object($wgTitle) && $wgTitle->getNameSpace()==NS_FILE){
 238+ if ( is_object( $wgTitle ) && $wgTitle->getNameSpace() == NS_FILE ) {
239239 $imagename = $wgTitle->getNsText();
240 - if(preg_match("/^$imagename:/",$text)) return $text;
 240+ if ( preg_match( "/^$imagename:/", $text ) ) return $text;
241241 }
242 - return parent::autoConvert($text,$toVariant);
 242+ return parent::autoConvert( $text, $toVariant );
243243 }
244244
245245 /**
246246 * It translates text into variant
247247 */
248 - function translate( $text, $toVariant ){
 248+ function translate( $text, $toVariant ) {
249249 global $wgContLanguageCode;
250250 $text = parent::translate( $text, $toVariant );
251251
@@ -262,7 +262,7 @@
263263 break;
264264 case 'kk-arab':
265265 case 'kk-cn':
266 - $letters = KK_C_UC.KK_C_LC./*KK_L_UC.KK_L_LC.'ʺʹ'.*/',;\?%\*№0123456789';
 266+ $letters = KK_C_UC . KK_C_LC . /*KK_L_UC.KK_L_LC.'ʺʹ'.*/',;\?%\*№0123456789';
267267 $wgContLanguageCode = 'kk-Arab';
268268 break;
269269 default:
@@ -272,60 +272,60 @@
273273 // disable conversion variables like $1, $2...
274274 $varsfix = '\$[0-9]';
275275
276 - $matches = preg_split( '/' . $varsfix . '[^' . $letters . ']+/u', $text, -1, PREG_SPLIT_OFFSET_CAPTURE);
 276+ $matches = preg_split( '/' . $varsfix . '[^' . $letters . ']+/u', $text, -1, PREG_SPLIT_OFFSET_CAPTURE );
277277 $mstart = 0;
278278 $ret = '';
279 - foreach( $matches as $m ) {
280 - $ret .= substr( $text, $mstart, $m[1]-$mstart );
 279+ foreach ( $matches as $m ) {
 280+ $ret .= substr( $text, $mstart, $m[1] -$mstart );
281281 $ret .= $this->regsConverter( $m[0], $toVariant );
282 - $mstart = $m[1] + strlen($m[0]);
 282+ $mstart = $m[1] + strlen( $m[0] );
283283 }
284284 return $ret;
285285 }
286286
287287 function regsConverter( $text, $toVariant ) {
288 - if ($text == '') return $text;
 288+ if ( $text == '' ) return $text;
289289
290290 $pat = array();
291291 $rep = array();
292292 switch( $toVariant ) {
293293 case 'kk-arab':
294294 case 'kk-cn':
295 - $letters = KK_C_LC.KK_C_UC/*.KK_L_LC.KK_L_UC*/;
 295+ $letters = KK_C_LC . KK_C_UC/*.KK_L_LC.KK_L_UC*/;
296296 $front = 'әөүіӘӨҮІ'/*.'äöüiÄÖÜİ'*/;
297297 $excludes = 'еэгғкқЕЭГҒКҚ'/*.'eégğkqEÉGĞKQ'*/;
298298 // split text to words
299 - $matches = preg_split( '/[\b\s\-\.:]+/', $text, -1, PREG_SPLIT_OFFSET_CAPTURE);
 299+ $matches = preg_split( '/[\b\s\-\.:]+/', $text, -1, PREG_SPLIT_OFFSET_CAPTURE );
300300 $mstart = 0;
301301 $ret = '';
302 - foreach( $matches as $m ) {
 302+ foreach ( $matches as $m ) {
303303 $ret .= substr( $text, $mstart, $m[1] - $mstart );
304304 // is matched the word to front vowels?
305305 // exclude a words matched to е, э, г, к, к, қ,
306306 // them should be without hamza
307 - if ( preg_match('/['.$front.']/u', $m[0]) && !preg_match('/['.$excludes.']/u', $m[0]) ) {
308 - $ret .= preg_replace('/['.$letters.']+/u', H_HAMZA.'$0', $m[0]);
 307+ if ( preg_match( '/[' . $front . ']/u', $m[0] ) && !preg_match( '/[' . $excludes . ']/u', $m[0] ) ) {
 308+ $ret .= preg_replace( '/[' . $letters . ']+/u', H_HAMZA . '$0', $m[0] );
309309 } else {
310310 $ret .= $m[0];
311311 }
312 - $mstart = $m[1] + strlen($m[0]);
 312+ $mstart = $m[1] + strlen( $m[0] );
313313 }
314314 $text =& $ret;
315 - foreach( $this->mCyLa2Arab as $pat => $rep ) {
 315+ foreach ( $this->mCyLa2Arab as $pat => $rep ) {
316316 $text = preg_replace( $pat, $rep, $text );
317317 }
318318 return $text;
319319 break;
320320 case 'kk-latn':
321321 case 'kk-tr':
322 - foreach( $this->mCyrl2Latn as $pat => $rep ) {
 322+ foreach ( $this->mCyrl2Latn as $pat => $rep ) {
323323 $text = preg_replace( $pat, $rep, $text );
324324 }
325325 return $text;
326326 break;
327327 case 'kk-cyrl':
328328 case 'kk-kz':
329 - foreach( $this->mLatn2Cyrl as $pat => $rep ) {
 329+ foreach ( $this->mLatn2Cyrl as $pat => $rep ) {
330330 $text = preg_replace( $pat, $rep, $text );
331331 }
332332 return $text;
@@ -339,8 +339,8 @@
340340 * We want our external link captions to be converted in variants,
341341 * so we return the original text instead -{$text}-, except for URLs
342342 */
343 - function markNoConversion( $text, $noParse=false ) {
344 - if( $noParse || preg_match( "/^https?:\/\/|ftp:\/\/|irc:\/\//", $text ) )
 343+ function markNoConversion( $text, $noParse = false ) {
 344+ if ( $noParse || preg_match( "/^https?:\/\/|ftp:\/\/|irc:\/\//", $text ) )
345345 return parent::markNoConversion( $text );
346346 return $text;
347347 }
@@ -399,7 +399,7 @@
400400 */
401401 function ucfirst ( $string ) {
402402 $variant = $this->getPreferredVariant();
403 - if ( ($variant == 'kk-latn' || $variant == 'kk-tr') && $string[0] == 'i' ) {
 403+ if ( ( $variant == 'kk-latn' || $variant == 'kk-tr' ) && $string[0] == 'i' ) {
404404 $string = 'İ' . substr( $string, 1 );
405405 } else {
406406 $string = parent::ucfirst( $string );
@@ -413,7 +413,7 @@
414414 */
415415 function lcfirst ( $string ) {
416416 $variant = $this->getPreferredVariant();
417 - if ( ($variant == 'kk-latn' || $variant == 'kk-tr') && $string[0] == 'I' ) {
 417+ if ( ( $variant == 'kk-latn' || $variant == 'kk-tr' ) && $string[0] == 'I' ) {
418418 $string = 'ı' . substr( $string, 1 );
419419 } else {
420420 $string = parent::lcfirst( $string );
Index: trunk/phase3/languages/classes/LanguageCs.php
@@ -12,7 +12,7 @@
1313 # {{plural:count|form1|form0,2+}} for single form plurals
1414 # in a message
1515 function convertPlural( $count, $forms ) {
16 - if ( !count($forms) ) { return ''; }
 16+ if ( !count( $forms ) ) { return ''; }
1717 $forms = $this->preConvertPlural( $forms, 3 );
1818
1919 switch ( $count ) {
Index: trunk/phase3/languages/classes/LanguageWa.php
@@ -13,17 +13,17 @@
1414 * Use singular form for zero
1515 */
1616 function convertPlural( $count, $forms ) {
17 - if ( !count($forms) ) { return ''; }
 17+ if ( !count( $forms ) ) { return ''; }
1818 $forms = $this->preConvertPlural( $forms, 2 );
1919
20 - return ($count <= 1) ? $forms[0] : $forms[1];
 20+ return ( $count <= 1 ) ? $forms[0] : $forms[1];
2121 }
2222
23 - ###
24 - ### Dates in Walloon are "1î d' <monthname>" for 1st of the month,
25 - ### "<day> di <monthname>" for months starting by a consoun, and
26 - ### "<day> d' <monthname>" for months starting with a vowel
27 - ###
 23+ ## #
 24+ ## # Dates in Walloon are "1î d' <monthname>" for 1st of the month,
 25+ ## # "<day> di <monthname>" for months starting by a consoun, and
 26+ ## # "<day> d' <monthname>" for months starting with a vowel
 27+ ## #
2828 function date( $ts, $adj = false, $format = true, $tc = false ) {
2929 if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); }
3030 $datePreference = $this->dateFormat( $format );
@@ -32,13 +32,13 @@
3333 #
3434 # we also output this format for YMD (eg: 2001 January 15)
3535 if ( $datePreference == 'ISO 8601' ) {
36 - $d = substr($ts, 0, 4). '-' . substr($ts, 4, 2). '-' .substr($ts, 6, 2);
 36+ $d = substr( $ts, 0, 4 ) . '-' . substr( $ts, 4, 2 ) . '-' . substr( $ts, 6, 2 );
3737 return $d;
3838 }
3939
4040 # dd/mm/YYYY format
4141 if ( $datePreference == 'walloon short' ) {
42 - $d = substr($ts, 6, 2). '/' . substr($ts, 4, 2). '/' .substr($ts, 0, 4);
 42+ $d = substr( $ts, 6, 2 ) . '/' . substr( $ts, 4, 2 ) . '/' . substr( $ts, 0, 4 );
4343 return $d;
4444 }
4545
@@ -47,17 +47,17 @@
4848 # we output this in all other cases
4949 $m = substr( $ts, 4, 2 );
5050 $n = substr( $ts, 6, 2 );
51 - if ($n == 1) {
 51+ if ( $n == 1 ) {
5252 $d = "1î d' " . $this->getMonthName( $m ) .
5353 " " . substr( $ts, 0, 4 );
54 - } else if ($n == 2 || $n == 3 || $n == 20 || $n == 22 || $n == 23) {
55 - $d = (0 + $n) . " d' " . $this->getMonthName( $m ) .
 54+ } else if ( $n == 2 || $n == 3 || $n == 20 || $n == 22 || $n == 23 ) {
 55+ $d = ( 0 + $n ) . " d' " . $this->getMonthName( $m ) .
5656 " " . substr( $ts, 0, 4 );
57 - } else if ($m == 4 || $m == 8 || $m == 10) {
58 - $d = (0 + $n) . " d' " . $this->getMonthName( $m ) .
 57+ } else if ( $m == 4 || $m == 8 || $m == 10 ) {
 58+ $d = ( 0 + $n ) . " d' " . $this->getMonthName( $m ) .
5959 " " . substr( $ts, 0, 4 );
6060 } else {
61 - $d = (0 + $n) . " di " . $this->getMonthName( $m ) .
 61+ $d = ( 0 + $n ) . " di " . $this->getMonthName( $m ) .
6262 " " . substr( $ts, 0, 4 );
6363 }
6464 return $d;
Index: trunk/phase3/languages/classes/LanguageCu.php
@@ -9,36 +9,36 @@
1010 # Invoked with {{grammar:case|word}}
1111 function convertGrammar( $word, $case ) {
1212 global $wgGrammarForms;
13 - if ( isset($wgGrammarForms['сu'][$case][$word]) ) {
 13+ if ( isset( $wgGrammarForms['сu'][$case][$word] ) ) {
1414 return $wgGrammarForms['сu'][$case][$word];
1515 }
1616
1717 # These rules are not perfect, but they are currently only used for site names so it doesn't
1818 # matter if they are wrong sometimes. Just add a special case for your site name if necessary.
1919
20 - #join and array_slice instead mb_substr
 20+ # join and array_slice instead mb_substr
2121 $ar = array();
2222 preg_match_all( '/./us', $word, $ar );
23 - if (!preg_match("/[a-zA-Z_]/us", $word))
 23+ if ( !preg_match( "/[a-zA-Z_]/us", $word ) )
2424 switch ( $case ) {
25 - case 'genitive': #родительный падеж
26 - if ((join('',array_slice($ar[0],-4))=='вики') || (join('',array_slice($ar[0],-4))=='Вики'))
27 - {}
28 - elseif (join('',array_slice($ar[0],-2))=='ї')
29 - $word = join('',array_slice($ar[0],0,-2)).'їѩ';
 25+ case 'genitive': # родительный падеж
 26+ if ( ( join( '', array_slice( $ar[0], -4 ) ) == 'вики' ) || ( join( '', array_slice( $ar[0], -4 ) ) == 'Вики' ) )
 27+ { }
 28+ elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ї' )
 29+ $word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'їѩ';
3030 break;
31 - case 'accusative': #винительный падеж
32 - #stub
 31+ case 'accusative': # винительный падеж
 32+ # stub
3333 break;
3434 }
3535 return $word;
3636 }
3737
3838 function convertPlural( $count, $forms ) {
39 - if ( !count($forms) ) { return ''; }
 39+ if ( !count( $forms ) ) { return ''; }
4040 $forms = $this->preConvertPlural( $forms, 4 );
4141
42 - switch ($count % 10) {
 42+ switch ( $count % 10 ) {
4343 case 1: return $forms[0];
4444 case 2: return $forms[1];
4545 case 3:
Index: trunk/phase3/languages/classes/LanguageKm.php
@@ -6,7 +6,7 @@
77 * @author Niklas Laxström
88 */
99 class LanguageKm extends Language {
10 - function commafy($_) {
 10+ function commafy( $_ ) {
1111 /* NO-op for Khmer. Cannot use
1212 * $separatorTransformTable = array( ',' => '' )
1313 * That would break when parsing and doing strstr '' => 'foo';
Index: trunk/phase3/languages/classes/LanguageSe.php
@@ -5,14 +5,14 @@
66 */
77 class LanguageSe extends Language {
88 function convertPlural( $count, $forms ) {
9 - if ( !count($forms) ) { return ''; }
 9+ if ( !count( $forms ) ) { return ''; }
1010
1111 // plural forms per http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#se
1212 $forms = $this->preConvertPlural( $forms, 3 );
1313
1414 if ( $count == 1 ) {
1515 $index = 0;
16 - } elseif( $count == 2 ) {
 16+ } elseif ( $count == 2 ) {
1717 $index = 1;
1818 } else {
1919 $index = 2;
Index: trunk/phase3/languages/classes/LanguageKu.deps.php
@@ -5,5 +5,5 @@
66 // changed on a subsequent page view.
77 // see http://lists.wikimedia.org/pipermail/wikitech-l/2006-January/021311.html
88
9 -require_once( dirname(__FILE__).'/../LanguageConverter.php' );
10 -require_once( dirname(__FILE__).'/LanguageKu_ku.php' );
 9+require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
 10+require_once( dirname( __FILE__ ) . '/LanguageKu_ku.php' );
Index: trunk/phase3/languages/classes/LanguageSh.php
@@ -5,19 +5,19 @@
66 */
77 class LanguageSh extends Language {
88 function convertPlural( $count, $forms ) {
9 - if ( !count($forms) ) { return ''; }
 9+ if ( !count( $forms ) ) { return ''; }
1010
11 - //if no number with word, then use $form[0] for singular and $form[1] for plural or zero
12 - if( count($forms) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
 11+ // if no number with word, then use $form[0] for singular and $form[1] for plural or zero
 12+ if ( count( $forms ) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
1313
1414 // FIXME: CLDR defines 4 plural forms. Form with decimals missing.
1515 // See http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#sh
1616 $forms = $this->preConvertPlural( $forms, 3 );
1717
18 - if ($count > 10 && floor(($count % 100) / 10) == 1) {
 18+ if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) {
1919 return $forms[2];
2020 } else {
21 - switch ($count % 10) {
 21+ switch ( $count % 10 ) {
2222 case 1: return $forms[0];
2323 case 2:
2424 case 3:
Index: trunk/phase3/languages/classes/LanguageCy.php
@@ -7,7 +7,7 @@
88 */
99 class LanguageCy extends Language {
1010 function convertPlural( $count, $forms ) {
11 - if ( !count($forms) ) { return ''; }
 11+ if ( !count( $forms ) ) { return ''; }
1212
1313 // FIXME: CLDR defines 4 plural forms; very different, actually.
1414 // See http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#cy
Index: trunk/phase3/languages/classes/LanguageGv.php
@@ -9,14 +9,14 @@
1010 class LanguageGv extends Language {
1111
1212 function convertPlural( $count, $forms ) {
13 - if ( !count($forms) ) { return ''; }
 13+ if ( !count( $forms ) ) { return ''; }
1414
1515 $forms = $this->preConvertPlural( $forms, 4 );
1616
17 - if ($count > 0 && ($count % 20) === 0 ) {
 17+ if ( $count > 0 && ( $count % 20 ) === 0 ) {
1818 return $forms[0];
1919 } else {
20 - switch ($count % 10) {
 20+ switch ( $count % 10 ) {
2121 case 1: return $forms[1];
2222 case 2: return $forms[2];
2323 default: return $forms[3];
Index: trunk/phase3/languages/classes/LanguageSk.php
@@ -6,7 +6,7 @@
77 */
88 class LanguageSk extends Language {
99 function convertPlural( $count, $forms ) {
10 - if ( !count($forms) ) { return ''; }
 10+ if ( !count( $forms ) ) { return ''; }
1111 $forms = $this->preConvertPlural( $forms, 3 );
1212
1313 if ( $count == 1 ) {
Index: trunk/phase3/languages/classes/LanguageKu_ku.php
@@ -12,7 +12,7 @@
1313 function commafy( $_ ) {
1414
1515 if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
16 - return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev($_) ) );
 16+ return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
1717 } else {
1818 return $_;
1919 }
Index: trunk/phase3/languages/classes/LanguageSl.php
@@ -12,7 +12,7 @@
1313 */
1414 function convertGrammar( $word, $case ) {
1515 global $wgGrammarForms;
16 - if ( isset($wgGrammarForms['sl'][$case][$word]) ) {
 16+ if ( isset( $wgGrammarForms['sl'][$case][$word] ) ) {
1717 return $wgGrammarForms['sl'][$case][$word];
1818 }
1919
@@ -27,7 +27,7 @@
2828 }
2929
3030 function convertPlural( $count, $forms ) {
31 - if ( !count($forms) ) { return ''; }
 31+ if ( !count( $forms ) ) { return ''; }
3232 $forms = $this->preConvertPlural( $forms, 5 );
3333
3434 if ( $count % 100 == 1 ) {
Index: trunk/phase3/languages/classes/LanguageKu.php
@@ -1,6 +1,6 @@
22 <?php
3 -require_once( dirname(__FILE__).'/../LanguageConverter.php' );
4 -require_once( dirname(__FILE__).'/LanguageKu_ku.php' );
 3+require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
 4+require_once( dirname( __FILE__ ) . '/LanguageKu_ku.php' );
55
66 /** Kurdish
77 * converter routines
@@ -18,8 +18,8 @@
1919 // و ك=> ku -- ist auch richtig
2020
2121 /* Doppel- und Halbvokale */
22 - 'ڵ' => 'll', #ll
23 - 'ڕ' => 'rr', #rr
 22+ 'ڵ' => 'll', # ll
 23+ 'ڕ' => 'rr', # rr
2424 'ا' => 'a',
2525 # 'ئێ' => 'ê', # initial e
2626 'ە' => 'e',
@@ -69,7 +69,7 @@
7070 # 'rr' => 'ڕ', # selbiges für doppel-r
7171
7272 /* Einzelne Großbuchstaben */
73 - //' C' => 'ج',
 73+ // ' C' => 'ج',
7474
7575 /* Vowels */
7676 'a' => 'ا',
@@ -140,25 +140,25 @@
141141 */
142142 function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
143143 // check for user namespace
144 - if(is_object($nt)){
 144+ if ( is_object( $nt ) ) {
145145 $ns = $nt->getNamespace();
146 - if($ns==NS_USER || $ns==NS_USER_TALK)
 146+ if ( $ns == NS_USER || $ns == NS_USER_TALK )
147147 return;
148148 }
149149
150 - $oldlink=$link;
 150+ $oldlink = $link;
151151 parent::findVariantLink( $link, $nt, $ignoreOtherCond );
152 - if( $this->getPreferredVariant() == $this->mMainLanguageCode )
153 - $link=$oldlink;
 152+ if ( $this->getPreferredVariant() == $this->mMainLanguageCode )
 153+ $link = $oldlink;
154154 }
155155
156156 /*
157157 * We want our external link captions to be converted in variants,
158158 * so we return the original text instead -{$text}-, except for URLs
159159 */
160 - function markNoConversion($text, $noParse=false) {
161 - if($noParse || preg_match("/^https?:\/\/|ftp:\/\/|irc:\/\//",$text))
162 - return parent::markNoConversion($text);
 160+ function markNoConversion( $text, $noParse = false ) {
 161+ if ( $noParse || preg_match( "/^https?:\/\/|ftp:\/\/|irc:\/\//", $text ) )
 162+ return parent::markNoConversion( $text );
163163 return $text;
164164 }
165165
@@ -166,20 +166,20 @@
167167 * An ugly function wrapper for parsing Image titles
168168 * (to prevent image name conversion)
169169 */
170 - function autoConvert($text, $toVariant=false) {
 170+ function autoConvert( $text, $toVariant = false ) {
171171 global $wgTitle;
172 - if(is_object($wgTitle) && $wgTitle->getNameSpace()==NS_FILE){
 172+ if ( is_object( $wgTitle ) && $wgTitle->getNameSpace() == NS_FILE ) {
173173 $imagename = $wgTitle->getNsText();
174 - if(preg_match("/^$imagename:/",$text)) return $text;
 174+ if ( preg_match( "/^$imagename:/", $text ) ) return $text;
175175 }
176 - return parent::autoConvert($text,$toVariant);
 176+ return parent::autoConvert( $text, $toVariant );
177177 }
178178
179179 /**
180180 * It translates text into variant, specials:
181181 * - ommiting roman numbers
182182 */
183 - function translate($text, $toVariant){
 183+ function translate( $text, $toVariant ) {
184184 $breaks = '[^\w\x80-\xff]';
185185
186186 /* From Kazakh interface, maybe we need it later
@@ -207,7 +207,7 @@
208208 return $ret;
209209 */
210210
211 - if( !isset( $this->mTables[$toVariant] ) ) {
 211+ if ( !isset( $this->mTables[$toVariant] ) ) {
212212 throw new MWException( "Broken variant table: " . implode( ',', array_keys( $this->mTables ) ) );
213213 }
214214
Index: trunk/phase3/languages/classes/LanguageSr.php
@@ -1,8 +1,8 @@
22 <?php
33
4 -require_once( dirname(__FILE__).'/../LanguageConverter.php' );
5 -require_once( dirname(__FILE__).'/LanguageSr_ec.php' );
6 -require_once( dirname(__FILE__).'/LanguageSr_el.php' );
 4+require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
 5+require_once( dirname( __FILE__ ) . '/LanguageSr_ec.php' );
 6+require_once( dirname( __FILE__ ) . '/LanguageSr_el.php' );
77
88 /**
99 * There are two levels of conversion for Serbian: the script level
@@ -45,15 +45,15 @@
4646 'O' => 'О', 'P' => 'П', 'R' => 'Р', 'S' => 'С', 'Š' => 'Ш',
4747 'T' => 'Т', 'U' => 'У', 'V' => 'В', 'Z' => 'З', 'Ž' => 'Ж',
4848
49 - 'DŽ' => 'Џ', 'd!ž' => 'дж', 'D!ž'=> 'Дж', 'D!Ž'=> 'ДЖ',
50 - 'Lj' => 'Љ', 'l!j' => 'лј', 'L!j'=> 'Лј', 'L!J'=> 'ЛЈ',
51 - 'Nj' => 'Њ', 'n!j' => 'нј', 'N!j'=> 'Нј', 'N!J'=> 'НЈ'
 49+ 'DŽ' => 'Џ', 'd!ž' => 'дж', 'D!ž' => 'Дж', 'D!Ž' => 'ДЖ',
 50+ 'Lj' => 'Љ', 'l!j' => 'лј', 'L!j' => 'Лј', 'L!J' => 'ЛЈ',
 51+ 'Nj' => 'Њ', 'n!j' => 'нј', 'N!j' => 'Нј', 'N!J' => 'НЈ'
5252 );
5353
5454 function loadDefaultTables() {
5555 $this->mTables = array(
5656 'sr-ec' => new ReplacementArray( $this->mToCyrillics ),
57 - 'sr-el' => new ReplacementArray( $this->mToLatin),
 57+ 'sr-el' => new ReplacementArray( $this->mToLatin ),
5858 'sr' => new ReplacementArray()
5959 );
6060 }
@@ -63,13 +63,13 @@
6464 update: delete all rule parsing because it's not used
6565 currently, and just produces a couple of bugs
6666 */
67 - function parseManualRule($rule, $flags=array()) {
68 - if(in_array('T',$flags)){
69 - return parent::parseManualRule($rule, $flags);
 67+ function parseManualRule( $rule, $flags = array() ) {
 68+ if ( in_array( 'T', $flags ) ) {
 69+ return parent::parseManualRule( $rule, $flags );
7070 }
7171
7272 // otherwise ignore all formatting
73 - foreach($this->mVariants as $v) {
 73+ foreach ( $this->mVariants as $v ) {
7474 $carray[$v] = $rule;
7575 }
7676
@@ -84,25 +84,25 @@
8585 */
8686 function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
8787 // check for user namespace
88 - if(is_object($nt)){
 88+ if ( is_object( $nt ) ) {
8989 $ns = $nt->getNamespace();
90 - if($ns==NS_USER || $ns==NS_USER_TALK)
 90+ if ( $ns == NS_USER || $ns == NS_USER_TALK )
9191 return;
9292 }
9393
94 - $oldlink=$link;
 94+ $oldlink = $link;
9595 parent::findVariantLink( $link, $nt, $ignoreOtherCond );
96 - if($this->getPreferredVariant()==$this->mMainLanguageCode)
97 - $link=$oldlink;
 96+ if ( $this->getPreferredVariant() == $this->mMainLanguageCode )
 97+ $link = $oldlink;
9898 }
9999
100100 /*
101101 * We want our external link captions to be converted in variants,
102102 * so we return the original text instead -{$text}-, except for URLs
103103 */
104 - function markNoConversion($text, $noParse=false) {
105 - if($noParse || preg_match("/^https?:\/\/|ftp:\/\/|irc:\/\//",$text))
106 - return parent::markNoConversion($text);
 104+ function markNoConversion( $text, $noParse = false ) {
 105+ if ( $noParse || preg_match( "/^https?:\/\/|ftp:\/\/|irc:\/\//", $text ) )
 106+ return parent::markNoConversion( $text );
107107 return $text;
108108 }
109109
@@ -110,39 +110,39 @@
111111 * An ugly function wrapper for parsing Image titles
112112 * (to prevent image name conversion)
113113 */
114 - function autoConvert($text, $toVariant=false) {
 114+ function autoConvert( $text, $toVariant = false ) {
115115 global $wgTitle;
116 - if(is_object($wgTitle) && $wgTitle->getNameSpace()==NS_FILE){
 116+ if ( is_object( $wgTitle ) && $wgTitle->getNameSpace() == NS_FILE ) {
117117 $imagename = $wgTitle->getNsText();
118 - if(preg_match("/^$imagename:/",$text)) return $text;
 118+ if ( preg_match( "/^$imagename:/", $text ) ) return $text;
119119 }
120 - return parent::autoConvert($text,$toVariant);
 120+ return parent::autoConvert( $text, $toVariant );
121121 }
122122
123123 /**
124124 * It translates text into variant, specials:
125125 * - ommiting roman numbers
126126 */
127 - function translate($text, $toVariant){
 127+ function translate( $text, $toVariant ) {
128128 $breaks = '[^\w\x80-\xff]';
129129
130130 // regexp for roman numbers
131131 $roman = 'M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})';
132132
133 - $reg = '/^'.$roman.'$|^'.$roman.$breaks.'|'.$breaks.$roman.'$|'.$breaks.$roman.$breaks.'/';
 133+ $reg = '/^' . $roman . '$|^' . $roman . $breaks . '|' . $breaks . $roman . '$|' . $breaks . $roman . $breaks . '/';
134134
135 - $matches = preg_split($reg, $text, -1, PREG_SPLIT_OFFSET_CAPTURE);
 135+ $matches = preg_split( $reg, $text, -1, PREG_SPLIT_OFFSET_CAPTURE );
136136
137 - $m = array_shift($matches);
138 - if( !isset( $this->mTables[$toVariant] ) ) {
 137+ $m = array_shift( $matches );
 138+ if ( !isset( $this->mTables[$toVariant] ) ) {
139139 throw new MWException( "Broken variant table: " . implode( ',', array_keys( $this->mTables ) ) );
140140 }
141141 $ret = $this->mTables[$toVariant]->replace( $m[0] );
142 - $mstart = $m[1]+strlen($m[0]);
143 - foreach($matches as $m) {
144 - $ret .= substr($text, $mstart, $m[1]-$mstart);
145 - $ret .= parent::translate($m[0], $toVariant);
146 - $mstart = $m[1] + strlen($m[0]);
 142+ $mstart = $m[1] + strlen( $m[0] );
 143+ foreach ( $matches as $m ) {
 144+ $ret .= substr( $text, $mstart, $m[1] -$mstart );
 145+ $ret .= parent::translate( $m[0], $toVariant );
 146+ $mstart = $m[1] + strlen( $m[0] );
147147 }
148148
149149 return $ret;
@@ -158,7 +158,7 @@
159159
160160 parent::__construct();
161161
162 - $variants = array('sr', 'sr-ec', 'sr-el');
 162+ $variants = array( 'sr', 'sr-ec', 'sr-el' );
163163 $variantfallbacks = array(
164164 'sr' => 'sr-ec',
165165 'sr-ec' => 'sr',
@@ -169,24 +169,24 @@
170170 'S' => 'S', 'писмо' => 'S', 'pismo' => 'S',
171171 'W' => 'W', 'реч' => 'W', 'reč' => 'W', 'ријеч' => 'W', 'riječ' => 'W'
172172 );
173 - $this->mConverter = new SrConverter($this, 'sr', $variants, $variantfallbacks, $flags);
 173+ $this->mConverter = new SrConverter( $this, 'sr', $variants, $variantfallbacks, $flags );
174174 $wgHooks['ArticleSaveComplete'][] = $this->mConverter;
175175 }
176176
177177 function convertPlural( $count, $forms ) {
178 - if ( !count($forms) ) { return ''; }
 178+ if ( !count( $forms ) ) { return ''; }
179179
180 - //if no number with word, then use $form[0] for singular and $form[1] for plural or zero
181 - if( count($forms) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
 180+ // if no number with word, then use $form[0] for singular and $form[1] for plural or zero
 181+ if ( count( $forms ) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
182182
183183 // FIXME: CLDR defines 4 plural forms. Form with decimals missing.
184184 // See http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#ru
185185 $forms = $this->preConvertPlural( $forms, 3 );
186186
187 - if ($count > 10 && floor(($count % 100) / 10) == 1) {
 187+ if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) {
188188 return $forms[2];
189189 } else {
190 - switch ($count % 10) {
 190+ switch ( $count % 10 ) {
191191 case 1: return $forms[0];
192192 case 2:
193193 case 3:
Index: trunk/phase3/languages/classes/LanguageKsh.php
@@ -22,7 +22,7 @@
2323 * Handle cases of (1, other, 0) or (1, other)
2424 */
2525 function convertPlural( $count, $forms ) {
26 - if ( !count($forms) ) { return ''; }
 26+ if ( !count( $forms ) ) { return ''; }
2727 $forms = $this->preConvertPlural( $forms, 3 );
2828
2929 if ( $count == 1 ) {
Index: trunk/phase3/languages/classes/LanguageSr_ec.php
@@ -5,13 +5,13 @@
66 */
77 class LanguageSr_ec extends Language {
88 function convertPlural( $count, $forms ) {
9 - if ( !count($forms) ) { return ''; }
 9+ if ( !count( $forms ) ) { return ''; }
1010 $forms = $this->preConvertPlural( $forms, 3 );
1111
12 - if ($count > 10 && floor(($count % 100) / 10) == 1) {
 12+ if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) {
1313 return $forms[2];
1414 } else {
15 - switch ($count % 10) {
 15+ switch ( $count % 10 ) {
1616 case 1: return $forms[0];
1717 case 2:
1818 case 3:
Index: trunk/phase3/languages/classes/LanguageBe_tarask.php
@@ -19,19 +19,19 @@
2020 */
2121
2222 function convertPlural( $count, $forms ) {
23 - if ( !count($forms) ) { return ''; }
 23+ if ( !count( $forms ) ) { return ''; }
2424
25 - //if no number with word, then use $form[0] for singular and $form[1] for plural or zero
26 - if( count($forms) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
 25+ // if no number with word, then use $form[0] for singular and $form[1] for plural or zero
 26+ if ( count( $forms ) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
2727
2828 // FIXME: CLDR defines 4 plural forms instead of 3
2929 // http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
3030 $forms = $this->preConvertPlural( $forms, 3 );
3131
32 - if ($count > 10 && floor(($count % 100) / 10) == 1) {
 32+ if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) {
3333 return $forms[2];
3434 } else {
35 - switch ($count % 10) {
 35+ switch ( $count % 10 ) {
3636 case 1: return $forms[0];
3737 case 2:
3838 case 3:
@@ -40,9 +40,9 @@
4141 }
4242 }
4343 }
44 -
 44+
4545 /*
46 - * The Belarusian language uses apostrophe sign,
 46+ * The Belarusian language uses apostrophe sign,
4747 * but the characters used for this could be both U+0027 and U+2019.
4848 * This function unifies apostrophe sign in search index values
4949 * to enable seach using both apostrophe signs.
@@ -61,16 +61,16 @@
6262 wfProfileOut( __METHOD__ );
6363 return $s;
6464 }
65 -
 65+
6666 /*
6767 * Four-digit number should be without group commas (spaces)
6868 * So "1 234 567", "12 345" but "1234"
6969 */
70 - function commafy($_) {
71 - if (preg_match('/^-?\d{1,4}(\.\d*)?$/',$_)) {
 70+ function commafy( $_ ) {
 71+ if ( preg_match( '/^-?\d{1,4}(\.\d*)?$/', $_ ) ) {
7272 return $_;
7373 } else {
74 - return strrev((string)preg_replace('/(\d{3})(?=\d)(?!\d*\.)/','$1,',strrev($_)));
 74+ return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
7575 }
7676 }
7777 }
Index: trunk/phase3/languages/classes/LanguageLa.php
@@ -15,7 +15,7 @@
1616 */
1717 function convertGrammar( $word, $case ) {
1818 global $wgGrammarForms;
19 - if ( isset($wgGrammarForms['la'][$case][$word]) ) {
 19+ if ( isset( $wgGrammarForms['la'][$case][$word] ) ) {
2020 return $wgGrammarForms['la'][$case][$word];
2121 }
2222
Index: trunk/phase3/languages/classes/LanguageHe.php
@@ -20,7 +20,7 @@
2121 */
2222 public function convertGrammar( $word, $case ) {
2323 global $wgGrammarForms;
24 - if ( isset($wgGrammarForms['he'][$case][$word]) ) {
 24+ if ( isset( $wgGrammarForms['he'][$case][$word] ) ) {
2525 return $wgGrammarForms['he'][$case][$word];
2626 }
2727
@@ -29,7 +29,7 @@
3030 case 'תחילית':
3131 # Duplicate the "Waw" if prefixed
3232 if ( substr( $word, 0, 2 ) == "ו" && substr( $word, 0, 4 ) != "וו" ) {
33 - $word = "ו".$word;
 33+ $word = "ו" . $word;
3434 }
3535
3636 # Remove the "He" if prefixed
@@ -39,7 +39,7 @@
4040
4141 # Add a hyphen if non-Hebrew letters
4242 if ( substr( $word, 0, 2 ) < "א" || substr( $word, 0, 2 ) > "ת" ) {
43 - $word = "־".$word;
 43+ $word = "־" . $word;
4444 }
4545 }
4646
@@ -54,12 +54,12 @@
5555 * @return String: the suited form of word
5656 */
5757 function convertPlural( $count, $forms ) {
58 - if ( !count($forms) ) { return ''; }
 58+ if ( !count( $forms ) ) { return ''; }
5959 $forms = $this->preConvertPlural( $forms, 3 );
6060
6161 if ( $count == '1' ) {
6262 return $forms[0];
63 - } elseif ( $count == '2' && isset($forms[2]) ) {
 63+ } elseif ( $count == '2' && isset( $forms[2] ) ) {
6464 return $forms[2];
6565 } else {
6666 return $forms[1];
Index: trunk/phase3/languages/classes/LanguageHi.php
@@ -8,9 +8,9 @@
99 * Use singular form for zero
1010 */
1111 function convertPlural( $count, $forms ) {
12 - if ( !count($forms) ) { return ''; }
 12+ if ( !count( $forms ) ) { return ''; }
1313 $forms = $this->preConvertPlural( $forms, 2 );
1414
15 - return ($count <= 1) ? $forms[0] : $forms[1];
 15+ return ( $count <= 1 ) ? $forms[0] : $forms[1];
1616 }
1717 }
Index: trunk/phase3/languages/classes/LanguageSr_el.php
@@ -5,13 +5,13 @@
66 */
77 class LanguageSr_el extends Language {
88 function convertPlural( $count, $forms ) {
9 - if ( !count($forms) ) { return ''; }
 9+ if ( !count( $forms ) ) { return ''; }
1010 $forms = $this->preConvertPlural( $forms, 3 );
1111
12 - if ($count > 10 && floor(($count % 100) / 10) == 1) {
 12+ if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) {
1313 return $forms[2];
1414 } else {
15 - switch ($count % 10) {
 15+ switch ( $count % 10 ) {
1616 case 1: return $forms[0];
1717 case 2:
1818 case 3:
Index: trunk/phase3/languages/LanguageConverter.php
@@ -447,7 +447,7 @@
448448
449449 /**
450450 * Apply manual conversion rules.
451 - *
 451+ *
452452 * @param $convRule Object: Object of ConverterRule
453453 */
454454 protected function applyManualConv( $convRule ) {
@@ -456,7 +456,7 @@
457457 // Bug 24072: $mConvRuleTitle was overwritten by other manual
458458 // rule(s) not for title, this breaks the title conversion.
459459 $newConvRuleTitle = $convRule->getTitle();
460 - if( $newConvRuleTitle ) {
 460+ if ( $newConvRuleTitle ) {
461461 // So I add an empty check for getTitle()
462462 $this->mConvRuleTitle = $newConvRuleTitle;
463463 }
@@ -532,7 +532,7 @@
533533 $variant = $this->getPreferredVariant();
534534 return $this->convertTo( $text, $variant );
535535 }
536 -
 536+
537537 /**
538538 * Same as convert() except a extra parameter to custom variant.
539539 *
@@ -562,7 +562,7 @@
563563 while ( $startPos < $length ) {
564564 $m = false;
565565 $pos = strpos( $text, '-{', $startPos );
566 -
 566+
567567 if ( $pos === false ) {
568568 // No more markup, append final segment
569569 $out .= $this->autoConvert( substr( $text, $startPos ), $variant );
@@ -595,7 +595,7 @@
596596 protected function recursiveConvertRule( $text, $variant, &$startPos, $depth = 0 ) {
597597 // Quick sanity check (no function calls)
598598 if ( $text[$startPos] !== '-' || $text[$startPos + 1] !== '{' ) {
599 - throw new MWException( __METHOD__.': invalid input string' );
 599+ throw new MWException( __METHOD__ . ': invalid input string' );
600600 }
601601
602602 $startPos += 2;
@@ -628,7 +628,7 @@
629629 $inner .= '-{';
630630 if ( !$warningDone ) {
631631 $inner .= '<span class="error">' .
632 - wfMsgForContent( 'language-converter-depth-warning',
 632+ wfMsgForContent( 'language-converter-depth-warning',
633633 $this->mMaxDepth ) .
634634 '</span>';
635635 $warningDone = true;
@@ -647,7 +647,7 @@
648648 $this->applyManualConv( $rule );
649649 return $rule->getDisplay();
650650 default:
651 - throw new MWException( __METHOD__.': invalid regex match' );
 651+ throw new MWException( __METHOD__ . ': invalid regex match' );
652652 }
653653 }
654654
@@ -841,7 +841,7 @@
842842
843843 if ( strpos( $code, '/' ) === false ) {
844844 $txt = $wgMessageCache->get( 'Conversiontable', true, $code );
845 - if( $txt === false ){
 845+ if ( $txt === false ) {
846846 # FIXME: this method doesn't seem to be expecting
847847 # this possible outcome...
848848 $txt = '&lt;Conversiontable&gt;';
@@ -1277,7 +1277,7 @@
12781278 }
12791279 /*for unidirectional array fill to convert tables */
12801280 if ( ( $manLevel[$v] == 'bidirectional' || $manLevel[$v] == 'unidirectional' )
1281 - && isset( $unidtable[$v] ) )
 1281+ && isset( $unidtable[$v] ) )
12821282 {
12831283 if ( isset( $this->mConvTable[$v] ) ) {
12841284 $this->mConvTable[$v] = array_merge( $this->mConvTable[$v], $unidtable[$v] );

Status & tagging log