Index: trunk/phase3/languages/Language.php |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | * @ingroup Language |
8 | 8 | */ |
9 | 9 | |
10 | | -if( !defined( 'MEDIAWIKI' ) ) { |
| 10 | +if ( !defined( 'MEDIAWIKI' ) ) { |
11 | 11 | echo "This file is part of MediaWiki, it is not a valid entry point.\n"; |
12 | 12 | exit( 1 ); |
13 | 13 | } |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | $wgInputEncoding = 'UTF-8'; |
25 | 25 | $wgOutputEncoding = 'UTF-8'; |
26 | 26 | |
27 | | -if( function_exists( 'mb_strtoupper' ) ) { |
| 27 | +if ( function_exists( 'mb_strtoupper' ) ) { |
28 | 28 | mb_internal_encoding( 'UTF-8' ); |
29 | 29 | } |
30 | 30 | |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | function getVariants() { return array( $this->mLang->getCode() ); } |
43 | 43 | function getPreferredVariant() { return $this->mLang->getCode(); } |
44 | 44 | function getConvRuleTitle() { return false; } |
45 | | - function findVariantLink( &$l, &$n, $ignoreOtherCond = false ) {} |
| 45 | + function findVariantLink( &$l, &$n, $ignoreOtherCond = false ) { } |
46 | 46 | function getExtraHashOptions() { return ''; } |
47 | 47 | function getParsedTitle() { return ''; } |
48 | 48 | function markNoConversion( $text, $noParse = false ) { return $text; } |
— | — | @@ -129,7 +129,7 @@ |
130 | 130 | */ |
131 | 131 | static function factory( $code ) { |
132 | 132 | if ( !isset( self::$mLangObjCache[$code] ) ) { |
133 | | - if( count( self::$mLangObjCache ) > 10 ) { |
| 133 | + if ( count( self::$mLangObjCache ) > 10 ) { |
134 | 134 | // Don't keep a billion objects around, that's stupid. |
135 | 135 | self::$mLangObjCache = array(); |
136 | 136 | } |
— | — | @@ -161,7 +161,7 @@ |
162 | 162 | throw new MWException( "Language fallback loop detected when creating class $class\n" ); |
163 | 163 | } |
164 | 164 | |
165 | | - if( !class_exists( $class ) ) { |
| 165 | + if ( !class_exists( $class ) ) { |
166 | 166 | $fallback = Language::getFallbackFor( $code ); |
167 | 167 | ++$recursionLevel; |
168 | 168 | $lang = Language::newFromCode( $fallback ); |
— | — | @@ -209,7 +209,7 @@ |
210 | 210 | * Hook which will be called if this is the content language. |
211 | 211 | * Descendants can use this to register hook functions or modify globals |
212 | 212 | */ |
213 | | - function initContLang() {} |
| 213 | + function initContLang() { } |
214 | 214 | |
215 | 215 | /** |
216 | 216 | * @deprecated Use User::getDefaultOptions() |
— | — | @@ -274,7 +274,7 @@ |
275 | 275 | */ |
276 | 276 | function getFormattedNamespaces() { |
277 | 277 | $ns = $this->getNamespaces(); |
278 | | - foreach( $ns as $k => $v ) { |
| 278 | + foreach ( $ns as $k => $v ) { |
279 | 279 | $ns[$k] = strtr( $v, '_', ' ' ); |
280 | 280 | } |
281 | 281 | return $ns; |
— | — | @@ -464,7 +464,7 @@ |
465 | 465 | global $IP; |
466 | 466 | $names = array(); |
467 | 467 | $dir = opendir( "$IP/languages/messages" ); |
468 | | - while( false !== ( $file = readdir( $dir ) ) ) { |
| 468 | + while ( false !== ( $file = readdir( $dir ) ) ) { |
469 | 469 | $code = self::getCodeFromFileName( $file, 'Messages' ); |
470 | 470 | if ( $code && isset( $allNames[$code] ) ) { |
471 | 471 | $names[$code] = $allNames[$code]; |
— | — | @@ -558,15 +558,15 @@ |
559 | 559 | |
560 | 560 | $minDiff = 0; |
561 | 561 | if ( $data[0] == 'System' || $tz == '' ) { |
562 | | - # Global offset in minutes. |
563 | | - if( isset( $wgLocalTZoffset ) ) { |
| 562 | + # Global offset in minutes. |
| 563 | + if ( isset( $wgLocalTZoffset ) ) { |
564 | 564 | $minDiff = $wgLocalTZoffset; |
565 | 565 | } |
566 | 566 | } else if ( $data[0] == 'Offset' ) { |
567 | 567 | $minDiff = intval( $data[1] ); |
568 | 568 | } else { |
569 | 569 | $data = explode( ':', $tz ); |
570 | | - if( count( $data ) == 2 ) { |
| 570 | + if ( count( $data ) == 2 ) { |
571 | 571 | $data[0] = intval( $data[0] ); |
572 | 572 | $data[1] = intval( $data[1] ); |
573 | 573 | $minDiff = abs( $data[0] ) * 60 + $data[1]; |
— | — | @@ -588,12 +588,12 @@ |
589 | 589 | # will normalize out-of-range values so we don't have to split $minDiff |
590 | 590 | # into hours and minutes. |
591 | 591 | $t = mktime( ( |
592 | | - (int)substr( $ts, 8, 2) ), # Hours |
| 592 | + (int)substr( $ts, 8, 2 ) ), # Hours |
593 | 593 | (int)substr( $ts, 10, 2 ) + $minDiff, # Minutes |
594 | 594 | (int)substr( $ts, 12, 2 ), # Seconds |
595 | 595 | (int)substr( $ts, 4, 2 ), # Month |
596 | 596 | (int)substr( $ts, 6, 2 ), # Day |
597 | | - (int)substr( $ts, 0, 4 ) ); #Year |
| 597 | + (int)substr( $ts, 0, 4 ) ); # Year |
598 | 598 | |
599 | 599 | $date = date( 'YmdHis', $t ); |
600 | 600 | wfRestoreWarnings(); |
— | — | @@ -967,7 +967,7 @@ |
968 | 968 | } elseif ( $roman ) { |
969 | 969 | $s .= self::romanNumeral( $num ); |
970 | 970 | $roman = false; |
971 | | - } elseif( $hebrewNum ) { |
| 971 | + } elseif ( $hebrewNum ) { |
972 | 972 | $s .= self::hebrewNumeral( $num ); |
973 | 973 | $hebrewNum = false; |
974 | 974 | } else { |
— | — | @@ -1002,12 +1002,12 @@ |
1003 | 1003 | |
1004 | 1004 | |
1005 | 1005 | // Add days of the past months of this year |
1006 | | - for( $i = 0; $i < $gm; $i++ ) { |
| 1006 | + for ( $i = 0; $i < $gm; $i++ ) { |
1007 | 1007 | $gDayNo += self::$GREG_DAYS[$i]; |
1008 | 1008 | } |
1009 | 1009 | |
1010 | 1010 | // 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 ) ) ) ) { |
1012 | 1012 | $gDayNo++; |
1013 | 1013 | } |
1014 | 1014 | |
— | — | @@ -1068,11 +1068,11 @@ |
1069 | 1069 | (int)( ( 275 * $zm ) / 9 ) + $zd + 1729777; |
1070 | 1070 | } |
1071 | 1071 | |
1072 | | - $zl = $zjd-1948440 + 10632; |
| 1072 | + $zl = $zjd -1948440 + 10632; |
1073 | 1073 | $zn = (int)( ( $zl - 1 ) / 10631 ); |
1074 | 1074 | $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; |
1077 | 1077 | $zm = (int)( ( 24 * $zl ) / 709 ); |
1078 | 1078 | $zd = $zl - (int)( ( 709 * $zm ) / 24 ); |
1079 | 1079 | $zy = 30 * $zn + $zj - 30; |
— | — | @@ -1102,7 +1102,7 @@ |
1103 | 1103 | |
1104 | 1104 | # Month number when September = 1, August = 12 |
1105 | 1105 | $month += 4; |
1106 | | - if( $month > 12 ) { |
| 1106 | + if ( $month > 12 ) { |
1107 | 1107 | # Next year |
1108 | 1108 | $month -= 12; |
1109 | 1109 | $year++; |
— | — | @@ -1111,15 +1111,15 @@ |
1112 | 1112 | |
1113 | 1113 | # Calculate day of year from 1 September |
1114 | 1114 | $dayOfYear = $day; |
1115 | | - for( $i = 1; $i < $month; $i++ ) { |
1116 | | - if( $i == 6 ) { |
| 1115 | + for ( $i = 1; $i < $month; $i++ ) { |
| 1116 | + if ( $i == 6 ) { |
1117 | 1117 | # February |
1118 | 1118 | $dayOfYear += 28; |
1119 | 1119 | # 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 ) ) { |
1121 | 1121 | $dayOfYear++; |
1122 | 1122 | } |
1123 | | - } elseif( $i == 8 || $i == 10 || $i == 1 || $i == 3 ) { |
| 1123 | + } elseif ( $i == 8 || $i == 10 || $i == 1 || $i == 3 ) { |
1124 | 1124 | $dayOfYear += 30; |
1125 | 1125 | } else { |
1126 | 1126 | $dayOfYear += 31; |
— | — | @@ -1130,7 +1130,7 @@ |
1131 | 1131 | $start = self::hebrewYearStart( $hebrewYear ); |
1132 | 1132 | |
1133 | 1133 | # Calculate next year's start |
1134 | | - if( $dayOfYear <= $start ) { |
| 1134 | + if ( $dayOfYear <= $start ) { |
1135 | 1135 | # Day is before the start of the year - it is the previous year |
1136 | 1136 | # Next year's start |
1137 | 1137 | $nextStart = $start; |
— | — | @@ -1139,7 +1139,7 @@ |
1140 | 1140 | $hebrewYear--; |
1141 | 1141 | # Add days since previous year's 1 September |
1142 | 1142 | $dayOfYear += 365; |
1143 | | - if( ( $year % 400 == 0 ) || ( $year % 100 != 0 && $year % 4 == 0 ) ) { |
| 1143 | + if ( ( $year % 400 == 0 ) || ( $year % 100 != 0 && $year % 4 == 0 ) ) { |
1144 | 1144 | # Leap year |
1145 | 1145 | $dayOfYear++; |
1146 | 1146 | } |
— | — | @@ -1158,7 +1158,7 @@ |
1159 | 1159 | # Add 12 (or 13 for leap years) days to ignore the difference between |
1160 | 1160 | # Hebrew and Gregorian year (353 at least vs. 365/6) - now the |
1161 | 1161 | # 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 ) ) { |
1163 | 1163 | $diff += 13; |
1164 | 1164 | } else { |
1165 | 1165 | $diff += 12; |
— | — | @@ -1178,14 +1178,14 @@ |
1179 | 1179 | $hebrewDay = $hebrewDayOfYear; |
1180 | 1180 | $hebrewMonth = 1; |
1181 | 1181 | $days = 0; |
1182 | | - while( $hebrewMonth <= 12 ) { |
| 1182 | + while ( $hebrewMonth <= 12 ) { |
1183 | 1183 | # Calculate days in this month |
1184 | | - if( $isLeap && $hebrewMonth == 6 ) { |
| 1184 | + if ( $isLeap && $hebrewMonth == 6 ) { |
1185 | 1185 | # Adar in a leap year |
1186 | | - if( $isLeap ) { |
| 1186 | + if ( $isLeap ) { |
1187 | 1187 | # Leap year - has Adar I, with 30 days, and Adar II, with 29 days |
1188 | 1188 | $days = 30; |
1189 | | - if( $hebrewDay <= $days ) { |
| 1189 | + if ( $hebrewDay <= $days ) { |
1190 | 1190 | # Day in Adar I |
1191 | 1191 | $hebrewMonth = 13; |
1192 | 1192 | } else { |
— | — | @@ -1193,23 +1193,23 @@ |
1194 | 1194 | $hebrewDay -= $days; |
1195 | 1195 | # Try Adar II |
1196 | 1196 | $days = 29; |
1197 | | - if( $hebrewDay <= $days ) { |
| 1197 | + if ( $hebrewDay <= $days ) { |
1198 | 1198 | # Day in Adar II |
1199 | 1199 | $hebrewMonth = 14; |
1200 | 1200 | } |
1201 | 1201 | } |
1202 | 1202 | } |
1203 | | - } elseif( $hebrewMonth == 2 && $yearPattern == 2 ) { |
| 1203 | + } elseif ( $hebrewMonth == 2 && $yearPattern == 2 ) { |
1204 | 1204 | # Cheshvan in a complete year (otherwise as the rule below) |
1205 | 1205 | $days = 30; |
1206 | | - } elseif( $hebrewMonth == 3 && $yearPattern == 0 ) { |
| 1206 | + } elseif ( $hebrewMonth == 3 && $yearPattern == 0 ) { |
1207 | 1207 | # Kislev in an incomplete year (otherwise as the rule below) |
1208 | 1208 | $days = 29; |
1209 | 1209 | } else { |
1210 | 1210 | # Odd months have 30 days, even have 29 |
1211 | 1211 | $days = 30 - ( $hebrewMonth - 1 ) % 2; |
1212 | 1212 | } |
1213 | | - if( $hebrewDay <= $days ) { |
| 1213 | + if ( $hebrewDay <= $days ) { |
1214 | 1214 | # In the current month |
1215 | 1215 | break; |
1216 | 1216 | } else { |
— | — | @@ -1232,21 +1232,21 @@ |
1233 | 1233 | $a = intval( ( 12 * ( $year - 1 ) + 17 ) % 19 ); |
1234 | 1234 | $b = intval( ( $year - 1 ) % 4 ); |
1235 | 1235 | $m = 32.044093161144 + 1.5542417966212 * $a + $b / 4.0 - 0.0031777940220923 * ( $year - 1 ); |
1236 | | - if( $m < 0 ) { |
| 1236 | + if ( $m < 0 ) { |
1237 | 1237 | $m--; |
1238 | 1238 | } |
1239 | 1239 | $Mar = intval( $m ); |
1240 | | - if( $m < 0 ) { |
| 1240 | + if ( $m < 0 ) { |
1241 | 1241 | $m++; |
1242 | 1242 | } |
1243 | 1243 | $m -= $Mar; |
1244 | 1244 | |
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 ) { |
1247 | 1247 | $Mar++; |
1248 | | - } else if( $c == 1 && $a > 6 && $m >= 0.63287037037037 ) { |
| 1248 | + } else if ( $c == 1 && $a > 6 && $m >= 0.63287037037037 ) { |
1249 | 1249 | $Mar += 2; |
1250 | | - } else if( $c == 2 || $c == 4 || $c == 6 ) { |
| 1250 | + } else if ( $c == 2 || $c == 4 || $c == 6 ) { |
1251 | 1251 | $Mar++; |
1252 | 1252 | } |
1253 | 1253 | |
— | — | @@ -1388,14 +1388,14 @@ |
1389 | 1389 | $num = 0; |
1390 | 1390 | } else { |
1391 | 1391 | $s .= $table[$i][intval( ( $num / $pow10 ) )]; |
1392 | | - if( $pow10 == 1000 ) { |
| 1392 | + if ( $pow10 == 1000 ) { |
1393 | 1393 | $s .= "'"; |
1394 | 1394 | } |
1395 | 1395 | } |
1396 | 1396 | } |
1397 | 1397 | $num = $num % $pow10; |
1398 | 1398 | } |
1399 | | - if( strlen( $s ) == 2 ) { |
| 1399 | + if ( strlen( $s ) == 2 ) { |
1400 | 1400 | $str = $s . "'"; |
1401 | 1401 | } else { |
1402 | 1402 | $str = substr( $s, 0, strlen( $s ) - 2 ) . '"'; |
— | — | @@ -1443,8 +1443,8 @@ |
1444 | 1444 | function dateFormat( $usePrefs = true ) { |
1445 | 1445 | global $wgUser; |
1446 | 1446 | |
1447 | | - if( is_bool( $usePrefs ) ) { |
1448 | | - if( $usePrefs ) { |
| 1447 | + if ( is_bool( $usePrefs ) ) { |
| 1448 | + if ( $usePrefs ) { |
1449 | 1449 | $datePreference = $wgUser->getDatePreference(); |
1450 | 1450 | } else { |
1451 | 1451 | $datePreference = (string)User::getDefaultOption( 'date' ); |
— | — | @@ -1454,7 +1454,7 @@ |
1455 | 1455 | } |
1456 | 1456 | |
1457 | 1457 | // return int |
1458 | | - if( $datePreference == '' ) { |
| 1458 | + if ( $datePreference == '' ) { |
1459 | 1459 | return 'default'; |
1460 | 1460 | } |
1461 | 1461 | |
— | — | @@ -1530,7 +1530,7 @@ |
1531 | 1531 | * validateTimeZone() in Special:Preferences |
1532 | 1532 | * @return string |
1533 | 1533 | */ |
1534 | | - function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false) { |
| 1534 | + function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false ) { |
1535 | 1535 | $ts = wfTimestamp( TS_MW, $ts ); |
1536 | 1536 | if ( $adj ) { |
1537 | 1537 | $ts = $this->userAdjust( $ts, $timecorrection ); |
— | — | @@ -1746,18 +1746,18 @@ |
1747 | 1747 | } |
1748 | 1748 | |
1749 | 1749 | function checkTitleEncoding( $s ) { |
1750 | | - if( is_array( $s ) ) { |
| 1750 | + if ( is_array( $s ) ) { |
1751 | 1751 | wfDebugDieBacktrace( 'Given array to checkTitleEncoding.' ); |
1752 | 1752 | } |
1753 | 1753 | # 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 ) { |
1756 | 1756 | return $s; |
1757 | 1757 | } |
1758 | 1758 | |
1759 | 1759 | $isutf8 = preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' . |
1760 | 1760 | '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s ); |
1761 | | - if( $isutf8 ) { |
| 1761 | + if ( $isutf8 ) { |
1762 | 1762 | return $s; |
1763 | 1763 | } |
1764 | 1764 | |
— | — | @@ -1797,7 +1797,7 @@ |
1798 | 1798 | * @return String |
1799 | 1799 | */ |
1800 | 1800 | function normalizeForSearch( $string ) { |
1801 | | - return self::convertDoubleWidth($string); |
| 1801 | + return self::convertDoubleWidth( $string ); |
1802 | 1802 | } |
1803 | 1803 | |
1804 | 1804 | /** |
— | — | @@ -1808,7 +1808,7 @@ |
1809 | 1809 | static $full = null; |
1810 | 1810 | static $half = null; |
1811 | 1811 | |
1812 | | - if( $full === null ) { |
| 1812 | + if ( $full === null ) { |
1813 | 1813 | $fullWidth = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; |
1814 | 1814 | $halfWidth = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; |
1815 | 1815 | $full = str_split( $fullWidth, 3 ); |
— | — | @@ -1904,7 +1904,7 @@ |
1905 | 1905 | # wgInputEncoding, this text will be further converted |
1906 | 1906 | # to wgOutputEncoding. |
1907 | 1907 | global $wgEditEncoding; |
1908 | | - if( $wgEditEncoding == '' || $wgEditEncoding == 'UTF-8' ) { |
| 1908 | + if ( $wgEditEncoding == '' || $wgEditEncoding == 'UTF-8' ) { |
1909 | 1909 | return $s; |
1910 | 1910 | } else { |
1911 | 1911 | return $this->iconv( 'UTF-8', $wgEditEncoding, $s ); |
— | — | @@ -1914,12 +1914,12 @@ |
1915 | 1915 | function recodeInput( $s ) { |
1916 | 1916 | # Take the previous into account. |
1917 | 1917 | global $wgEditEncoding; |
1918 | | - if( $wgEditEncoding != '' ) { |
| 1918 | + if ( $wgEditEncoding != '' ) { |
1919 | 1919 | $enc = $wgEditEncoding; |
1920 | 1920 | } else { |
1921 | 1921 | $enc = 'UTF-8'; |
1922 | 1922 | } |
1923 | | - if( $enc == 'UTF-8' ) { |
| 1923 | + if ( $enc == 'UTF-8' ) { |
1924 | 1924 | return $s; |
1925 | 1925 | } else { |
1926 | 1926 | return $this->iconv( $enc, 'UTF-8', $s ); |
— | — | @@ -2058,7 +2058,7 @@ |
2059 | 2059 | } |
2060 | 2060 | } |
2061 | 2061 | |
2062 | | - if( !is_array( $rawEntry ) ) { |
| 2062 | + if ( !is_array( $rawEntry ) ) { |
2063 | 2063 | error_log( "\"$rawEntry\" is not a valid magic thingie for \"$mw->mId\"" ); |
2064 | 2064 | } else { |
2065 | 2065 | $mw->mCaseSensitive = $rawEntry[0]; |
— | — | @@ -2179,7 +2179,7 @@ |
2180 | 2180 | * @param $_ mixed |
2181 | 2181 | * @return string |
2182 | 2182 | */ |
2183 | | - function commafy($_) { |
| 2183 | + function commafy( $_ ) { |
2184 | 2184 | return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) ); |
2185 | 2185 | } |
2186 | 2186 | |
— | — | @@ -2202,13 +2202,13 @@ |
2203 | 2203 | function listToText( $l ) { |
2204 | 2204 | $s = ''; |
2205 | 2205 | $m = count( $l ) - 1; |
2206 | | - if( $m == 1 ) { |
| 2206 | + if ( $m == 1 ) { |
2207 | 2207 | return $l[0] . $this->getMessageFromDB( 'and' ) . $this->getMessageFromDB( 'word-separator' ) . $l[1]; |
2208 | 2208 | } else { |
2209 | 2209 | for ( $i = $m; $i >= 0; $i-- ) { |
2210 | 2210 | if ( $i == $m ) { |
2211 | 2211 | $s = $l[$i]; |
2212 | | - } else if( $i == $m - 1 ) { |
| 2212 | + } else if ( $i == $m - 1 ) { |
2213 | 2213 | $s = $l[$i] . $this->getMessageFromDB( 'and' ) . $this->getMessageFromDB( 'word-separator' ) . $s; |
2214 | 2214 | } else { |
2215 | 2215 | $s = $l[$i] . $this->getMessageFromDB( 'comma-separator' ) . $s; |
— | — | @@ -2381,8 +2381,8 @@ |
2382 | 2382 | $entityState = 0; // 0-not entity, 1-entity |
2383 | 2383 | $tag = $ret = $ch = ''; |
2384 | 2384 | $openTags = array(); |
2385 | | - $textLen = strlen($text); |
2386 | | - for( $pos = 0; $pos < $textLen; ++$pos ) { |
| 2385 | + $textLen = strlen( $text ); |
| 2386 | + for ( $pos = 0; $pos < $textLen; ++$pos ) { |
2387 | 2387 | $ch = $text[$pos]; |
2388 | 2388 | $lastCh = $pos ? $text[$pos - 1] : ''; |
2389 | 2389 | $ret .= $ch; // add to result string |
— | — | @@ -2460,7 +2460,7 @@ |
2461 | 2461 | // like strcspn() but adds the skipped chars to $ret |
2462 | 2462 | private function truncate_skip( &$ret, $text, $search, $start, $len = -1 ) { |
2463 | 2463 | $skipCount = 0; |
2464 | | - if( $start < strlen( $text ) ) { |
| 2464 | + if ( $start < strlen( $text ) ) { |
2465 | 2465 | $skipCount = strcspn( $text, $search, $start, $len ); |
2466 | 2466 | $ret .= substr( $text, $start, $skipCount ); |
2467 | 2467 | } |
— | — | @@ -2472,11 +2472,11 @@ |
2473 | 2473 | // (b) clear $tag value |
2474 | 2474 | private function truncate_endBracket( &$tag, $tagType, $lastCh, &$openTags ) { |
2475 | 2475 | $tag = ltrim( $tag ); |
2476 | | - if( $tag != '' ) { |
2477 | | - if( $tagType == 0 && $lastCh != '/' ) { |
| 2476 | + if ( $tag != '' ) { |
| 2477 | + if ( $tagType == 0 && $lastCh != '/' ) { |
2478 | 2478 | $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] ) { |
2481 | 2481 | array_pop( $openTags ); // tag closed |
2482 | 2482 | } |
2483 | 2483 | } |
— | — | @@ -2574,7 +2574,7 @@ |
2575 | 2575 | return $str; |
2576 | 2576 | } |
2577 | 2577 | |
2578 | | - foreach ( explode( ',', $scBlockExpiryOptions) as $option ) { |
| 2578 | + foreach ( explode( ',', $scBlockExpiryOptions ) as $option ) { |
2579 | 2579 | if ( strpos( $option, ':' ) === false ) { |
2580 | 2580 | continue; |
2581 | 2581 | } |
— | — | @@ -2905,13 +2905,13 @@ |
2906 | 2906 | function formatSize( $size ) { |
2907 | 2907 | // For small sizes no decimal places necessary |
2908 | 2908 | $round = 0; |
2909 | | - if( $size > 1024 ) { |
| 2909 | + if ( $size > 1024 ) { |
2910 | 2910 | $size = $size / 1024; |
2911 | | - if( $size > 1024 ) { |
| 2911 | + if ( $size > 1024 ) { |
2912 | 2912 | $size = $size / 1024; |
2913 | 2913 | // For MB and bigger two decimal places are smarter |
2914 | 2914 | $round = 2; |
2915 | | - if( $size > 1024 ) { |
| 2915 | + if ( $size > 1024 ) { |
2916 | 2916 | $size = $size / 1024; |
2917 | 2917 | $msg = 'size-gigabytes'; |
2918 | 2918 | } else { |
Index: trunk/phase3/languages/Names.php |
— | — | @@ -178,7 +178,7 @@ |
179 | 179 | 'kri' => 'Krio', # Krio |
180 | 180 | 'krj' => 'Kinaray-a', # Kinaray-a |
181 | 181 | 'ks' => 'कश्मीरी - (كشميري)', # Kashmiri |
182 | | - 'ksh' => 'Ripoarisch', # Ripuarian |
| 182 | + 'ksh' => 'Ripoarisch', # Ripuarian |
183 | 183 | 'ku' => 'Kurdî', # Kurdish |
184 | 184 | 'ku-latn' => "\xE2\x80\xAAKurdî (latînî)\xE2\x80\xAC", # Northern Kurdish Latin script |
185 | 185 | 'ku-arab' => "\xE2\x80\xABكوردي (عەرەبی)\xE2\x80\xAC", # Northern Kurdish Arabic script |
— | — | @@ -204,7 +204,7 @@ |
205 | 205 | 'lzh' => '文言', # Literary Chinese -- (bug 8217) lzh instead of zh-classical, http://www.sil.org/iso639-3/codes.asp?order=639_3&letter=l |
206 | 206 | 'lzz' => 'Lazuri', # Laz |
207 | 207 | 'mai' => 'मैथिली', # Maithili |
208 | | - 'map-bms' => 'Basa Banyumasan', # Banyumasan |
| 208 | + 'map-bms' => 'Basa Banyumasan', # Banyumasan |
209 | 209 | 'mdf' => 'Мокшень', # Moksha |
210 | 210 | 'mg' => 'Malagasy', # Malagasy |
211 | 211 | 'mh' => 'Ebon', # Marshallese |
— | — | @@ -278,7 +278,7 @@ |
279 | 279 | 'rue' => 'русиньскый язык', # Rusyn |
280 | 280 | 'ruq' => 'Vlăheşte', # Megleno-Romanian (falls back to ruq-latn) |
281 | 281 | 'ruq-cyrl' => 'Влахесте', # Megleno-Romanian (Cyrillic script) |
282 | | - #'ruq-grek' => 'Βλαεστε', # Megleno-Romanian (Greek script) |
| 282 | + # 'ruq-grek' => 'Βλαεστε', # Megleno-Romanian (Greek script) |
283 | 283 | 'ruq-latn' => 'Vlăheşte', # Megleno-Romanian (Latin script) |
284 | 284 | 'rw' => 'Kinyarwanda', # Kinyarwanda, should possibly be Kinyarwandi |
285 | 285 | 'sa' => 'संस्कृत', # Sanskrit |
Index: trunk/phase3/languages/classes/LanguageLn.php |
— | — | @@ -10,9 +10,9 @@ |
11 | 11 | |
12 | 12 | */ |
13 | 13 | function convertPlural( $count, $forms ) { |
14 | | - if ( !count($forms) ) { return ''; } |
| 14 | + if ( !count( $forms ) ) { return ''; } |
15 | 15 | $forms = $this->preConvertPlural( $forms, 2 ); |
16 | 16 | |
17 | | - return ($count <= 1) ? $forms[0] : $forms[1]; |
| 17 | + return ( $count <= 1 ) ? $forms[0] : $forms[1]; |
18 | 18 | } |
19 | 19 | } |
Index: trunk/phase3/languages/classes/LanguageHr.php |
— | — | @@ -7,15 +7,15 @@ |
8 | 8 | class LanguageHr extends Language { |
9 | 9 | |
10 | 10 | function convertPlural( $count, $forms ) { |
11 | | - if ( !count($forms) ) { return ''; } |
| 11 | + if ( !count( $forms ) ) { return ''; } |
12 | 12 | // FIXME: CLDR defines 4 plural forms instead of 3. Plural for for decimals is missing. |
13 | 13 | // http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html |
14 | 14 | $forms = $this->preConvertPlural( $forms, 3 ); |
15 | 15 | |
16 | | - if ($count > 10 && floor(($count % 100) / 10) == 1) { |
| 16 | + if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) { |
17 | 17 | return $forms[2]; |
18 | 18 | } else { |
19 | | - switch ($count % 10) { |
| 19 | + switch ( $count % 10 ) { |
20 | 20 | case 1: return $forms[0]; |
21 | 21 | case 2: |
22 | 22 | case 3: |
Index: trunk/phase3/languages/classes/LanguageTg.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -require_once( dirname(__FILE__).'/../LanguageConverter.php' ); |
| 4 | +require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' ); |
5 | 5 | |
6 | 6 | /** |
7 | 7 | * Converts Tajiki to latin orthography |
Index: trunk/phase3/languages/classes/LanguagePl.php |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | */ |
8 | 8 | class LanguagePl extends Language { |
9 | 9 | function convertPlural( $count, $forms ) { |
10 | | - if ( !count($forms) ) { return ''; } |
| 10 | + if ( !count( $forms ) ) { return ''; } |
11 | 11 | $forms = $this->preConvertPlural( $forms, 3 ); |
12 | 12 | $count = abs( $count ); |
13 | 13 | if ( $count == 1 ) |
— | — | @@ -22,9 +22,9 @@ |
23 | 23 | } |
24 | 24 | } |
25 | 25 | |
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( $_ ) ) ); |
29 | 29 | } else { |
30 | 30 | return $_; |
31 | 31 | } |
Index: trunk/phase3/languages/classes/LanguageZh.deps.php |
— | — | @@ -5,5 +5,5 @@ |
6 | 6 | // changed on a subsequent page view. |
7 | 7 | // see http://lists.wikimedia.org/pipermail/wikitech-l/2006-January/021311.html |
8 | 8 | |
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 @@ |
9 | 9 | * Use singular form for zero |
10 | 10 | */ |
11 | 11 | function convertPlural( $count, $forms ) { |
12 | | - if ( !count($forms) ) { return ''; } |
| 12 | + if ( !count( $forms ) ) { return ''; } |
13 | 13 | $forms = $this->preConvertPlural( $forms, 2 ); |
14 | 14 | |
15 | | - return ($count <= 1) ? $forms[0] : $forms[1]; |
| 15 | + return ( $count <= 1 ) ? $forms[0] : $forms[1]; |
16 | 16 | } |
17 | 17 | } |
Index: trunk/phase3/languages/classes/LanguageBat_smg.php |
— | — | @@ -8,15 +8,15 @@ |
9 | 9 | class LanguageBat_smg extends Language { |
10 | 10 | |
11 | 11 | function convertPlural( $count, $forms ) { |
12 | | - if ( !count($forms) ) { return ''; } |
| 12 | + if ( !count( $forms ) ) { return ''; } |
13 | 13 | $forms = $this->preConvertPlural( $forms, 4 ); |
14 | 14 | |
15 | 15 | $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 ) ) ) { |
17 | 17 | return $forms[2]; |
18 | | - } elseif ( $count%10 === 1 ) { |
| 18 | + } elseif ( $count % 10 === 1 ) { |
19 | 19 | return $forms[0]; |
20 | | - } elseif ( $count%10 === 2 ) { |
| 20 | + } elseif ( $count % 10 === 2 ) { |
21 | 21 | return $forms[1]; |
22 | 22 | } else { |
23 | 23 | return $forms[3]; |
Index: trunk/phase3/languages/classes/LanguageHu.php |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | class LanguageHu extends Language { |
9 | 9 | function convertGrammar( $word, $case ) { |
10 | 10 | global $wgGrammarForms; |
11 | | - if ( isset($wgGrammarForms[$this->getCode()][$case][$word]) ) { |
| 11 | + if ( isset( $wgGrammarForms[$this->getCode()][$case][$word] ) ) { |
12 | 12 | return $wgGrammarForms[$this->getCode()][$case][$word]; |
13 | 13 | } |
14 | 14 | |
Index: trunk/phase3/languages/classes/LanguageSr.deps.php |
— | — | @@ -5,5 +5,5 @@ |
6 | 6 | // changed on a subsequent page view. |
7 | 7 | // see http://lists.wikimedia.org/pipermail/wikitech-l/2006-January/021311.html |
8 | 8 | |
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 @@ |
12 | 12 | 3 - penkiolika (15) lapų |
13 | 13 | */ |
14 | 14 | function convertPlural( $count, $forms ) { |
15 | | - if ( !count($forms) ) { return ''; } |
| 15 | + if ( !count( $forms ) ) { return ''; } |
16 | 16 | |
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]; |
19 | 19 | |
20 | 20 | $forms = $this->preConvertPlural( $forms, 3 ); |
21 | 21 | |
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]; |
24 | 24 | return $forms[2]; |
25 | 25 | } |
26 | 26 | } |
Index: trunk/phase3/languages/classes/LanguageTl.php |
— | — | @@ -8,9 +8,9 @@ |
9 | 9 | * Use singular form for zero |
10 | 10 | */ |
11 | 11 | function convertPlural( $count, $forms ) { |
12 | | - if ( !count($forms) ) { return ''; } |
| 12 | + if ( !count( $forms ) ) { return ''; } |
13 | 13 | $forms = $this->preConvertPlural( $forms, 2 ); |
14 | 14 | |
15 | | - return ($count <= 1) ? $forms[0] : $forms[1]; |
| 15 | + return ( $count <= 1 ) ? $forms[0] : $forms[1]; |
16 | 16 | } |
17 | 17 | } |
Index: trunk/phase3/languages/classes/LanguageHy.php |
— | — | @@ -10,58 +10,58 @@ |
11 | 11 | # Invoked with {{grammar:case|word}} |
12 | 12 | function convertGrammar( $word, $case ) { |
13 | 13 | global $wgGrammarForms; |
14 | | - if ( isset($wgGrammarForms['hy'][$case][$word]) ) { |
| 14 | + if ( isset( $wgGrammarForms['hy'][$case][$word] ) ) { |
15 | 15 | return $wgGrammarForms['hy'][$case][$word]; |
16 | 16 | } |
17 | 17 | |
18 | 18 | # These rules are not perfect, but they are currently only used for site names so it doesn't |
19 | 19 | # matter if they are wrong sometimes. Just add a special case for your site name if necessary. |
20 | 20 | |
21 | | - #join and array_slice instead mb_substr |
| 21 | + # join and array_slice instead mb_substr |
22 | 22 | $ar = array(); |
23 | 23 | preg_match_all( '/./us', $word, $ar ); |
24 | | - if (!preg_match("/[a-zA-Z_]/us", $word)) |
| 24 | + if ( !preg_match( "/[a-zA-Z_]/us", $word ) ) |
25 | 25 | 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 ) ) . 'գրքի'; |
33 | 33 | else |
34 | | - $word.='ի'; |
| 34 | + $word .= 'ի'; |
35 | 35 | break; |
36 | | - case 'dative': #Տրական հոլով |
37 | | - #stub |
| 36 | + case 'dative': # Տրական հոլով |
| 37 | + # stub |
38 | 38 | break; |
39 | | - case 'accusative': #Հայցական հոլով |
40 | | - #stub |
| 39 | + case 'accusative': # Հայցական հոլով |
| 40 | + # stub |
41 | 41 | break; |
42 | 42 | case 'instrumental': # |
43 | | - #stub |
| 43 | + # stub |
44 | 44 | break; |
45 | 45 | case 'prepositional': # |
46 | | - #stub |
| 46 | + # stub |
47 | 47 | break; |
48 | 48 | } |
49 | 49 | return $word; |
50 | 50 | } |
51 | 51 | |
52 | 52 | function convertPlural( $count, $forms ) { |
53 | | - if ( !count($forms) ) { return ''; } |
| 53 | + if ( !count( $forms ) ) { return ''; } |
54 | 54 | $forms = $this->preConvertPlural( $forms, 2 ); |
55 | 55 | |
56 | | - return (abs($count) <= 1) ? $forms[0] : $forms[1]; |
| 56 | + return ( abs( $count ) <= 1 ) ? $forms[0] : $forms[1]; |
57 | 57 | } |
58 | 58 | |
59 | 59 | /* |
60 | 60 | * Armenian numeric format is "12 345,67" but "1234,56" |
61 | 61 | */ |
62 | 62 | |
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( $_ ) ) ); |
66 | 66 | } else { |
67 | 67 | return $_; |
68 | 68 | } |
Index: trunk/phase3/languages/classes/LanguageLv.php |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | * @return String |
22 | 22 | */ |
23 | 23 | function convertPlural( $count, $forms ) { |
24 | | - if ( !count($forms) ) { return ''; } |
| 24 | + if ( !count( $forms ) ) { return ''; } |
25 | 25 | |
26 | 26 | // FIXME: CLDR defines 3 plural forms instead of 2. Form for 0 is missing. |
27 | 27 | // 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 @@ |
17 | 17 | */ |
18 | 18 | function convertGrammar( $word, $case ) { |
19 | 19 | global $wgGrammarForms; |
20 | | - if ( isset($wgGrammarForms['tyv'][$case][$word]) ) { |
| 20 | + if ( isset( $wgGrammarForms['tyv'][$case][$word] ) ) { |
21 | 21 | return $wgGrammarForms['tyv'][$case][$word]; |
22 | 22 | } |
23 | 23 | |
24 | 24 | // 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" ); |
36 | 36 | |
37 | 37 | // $allSonants = array("л", "м", "н", "ң", "р", "й"); |
38 | 38 | // $allNasals = array("м", "н", "ң"); |
39 | 39 | |
40 | 40 | // Put the word in a form we can play with since we're using UTF-8 |
41 | 41 | 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* |
45 | 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* |
| 45 | + |
46 | 46 | // Find the last vowel in the word |
47 | 47 | $wordLastVowel = NULL; |
48 | 48 | foreach ( $wordReversed as $xvalue ) { |
49 | 49 | foreach ( $allVowels as $yvalue ) { |
50 | | - if ( strcmp($xvalue, $yvalue) == 0 ) { |
| 50 | + if ( strcmp( $xvalue, $yvalue ) == 0 ) { |
51 | 51 | $wordLastVowel = $xvalue; |
52 | 52 | break; |
53 | 53 | } else { |
— | — | @@ -63,157 +63,157 @@ |
64 | 64 | // Now convert the word |
65 | 65 | switch ( $case ) { |
66 | 66 | 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] ) . "тың"; |
76 | 76 | } else { |
77 | 77 | } |
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] ) . "дың"; |
87 | 87 | } else { |
88 | 88 | } |
89 | 89 | } 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] ) . "ның"; |
98 | 98 | } else { |
99 | 99 | } |
100 | 100 | } |
101 | 101 | break; |
102 | 102 | 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] ) . "ка"; |
108 | 108 | } else { |
109 | 109 | } |
110 | 110 | } 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] ) . "га"; |
115 | 115 | } else { |
116 | 116 | } |
117 | 117 | } |
118 | 118 | break; |
119 | 119 | 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] ) . "ты"; |
129 | 129 | } else { |
130 | 130 | } |
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] ) . "ды"; |
140 | 140 | } else { |
141 | 141 | } |
142 | 142 | } 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] ) . "ны"; |
151 | 151 | } else { |
152 | 152 | } |
153 | 153 | } |
154 | 154 | break; |
155 | 155 | 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] ) . "та"; |
161 | 161 | } else { |
162 | 162 | } |
163 | 163 | } 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] ) . "да"; |
168 | 168 | } else { |
169 | 169 | } |
170 | 170 | } |
171 | 171 | break; |
172 | 172 | 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] ) . "тан"; |
178 | 178 | } else { |
179 | 179 | } |
180 | 180 | } 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] ) . "дан"; |
185 | 185 | } else { |
186 | 186 | } |
187 | 187 | } |
188 | 188 | break; |
189 | 189 | 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] ) . "че"; |
194 | 194 | } else { |
195 | 195 | } |
196 | 196 | break; |
197 | 197 | 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] ) . "тыве"; |
207 | 207 | } else { |
208 | 208 | } |
209 | 209 | } 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] ) . "дыве"; |
218 | 218 | } else { |
219 | 219 | } |
220 | 220 | } |
Index: trunk/phase3/languages/classes/LanguageTr.php |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | */ |
9 | 9 | class LanguageTr extends Language { |
10 | 10 | function ucfirst ( $string ) { |
11 | | - if ( !empty($string) && $string[0] == 'i' ) { |
| 11 | + if ( !empty( $string ) && $string[0] == 'i' ) { |
12 | 12 | return 'İ' . substr( $string, 1 ); |
13 | 13 | } else { |
14 | 14 | return parent::ucfirst( $string ); |
Index: trunk/phase3/languages/classes/LanguageKaa.php |
— | — | @@ -51,7 +51,7 @@ |
52 | 52 | */ |
53 | 53 | function commafy( $_ ) { |
54 | 54 | 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( $_ ) ) ); |
56 | 56 | } else { |
57 | 57 | return $_; |
58 | 58 | } |
Index: trunk/phase3/languages/classes/LanguageAm.php |
— | — | @@ -8,9 +8,9 @@ |
9 | 9 | * Use singular form for zero |
10 | 10 | */ |
11 | 11 | function convertPlural( $count, $forms ) { |
12 | | - if ( !count($forms) ) { return ''; } |
| 12 | + if ( !count( $forms ) ) { return ''; } |
13 | 13 | $forms = $this->preConvertPlural( $forms, 2 ); |
14 | 14 | |
15 | | - return ($count <= 1) ? $forms[0] : $forms[1]; |
| 15 | + return ( $count <= 1 ) ? $forms[0] : $forms[1]; |
16 | 16 | } |
17 | 17 | } |
Index: trunk/phase3/languages/classes/LanguageSr_el.deps.php |
— | — | @@ -5,4 +5,4 @@ |
6 | 6 | // changed on a subsequent page view. |
7 | 7 | // see http://mail.wikipedia.org/pipermail/wikitech-l/2006-January/033660.html |
8 | 8 | |
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 @@ |
6 | 6 | // changed on a subsequent page view. |
7 | 7 | // see http://lists.wikimedia.org/pipermail/wikitech-l/2006-January/021311.html |
8 | 8 | |
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 @@ |
8 | 8 | */ |
9 | 9 | class LanguageAr extends Language { |
10 | 10 | function convertPlural( $count, $forms ) { |
11 | | - if ( !count($forms) ) { return ''; } |
| 11 | + if ( !count( $forms ) ) { return ''; } |
12 | 12 | $forms = $this->preConvertPlural( $forms, 6 ); |
13 | 13 | |
14 | 14 | if ( $count == 0 ) { |
15 | 15 | $index = 0; |
16 | 16 | } elseif ( $count == 1 ) { |
17 | 17 | $index = 1; |
18 | | - } elseif( $count == 2 ) { |
| 18 | + } elseif ( $count == 2 ) { |
19 | 19 | $index = 2; |
20 | | - } elseif( $count % 100 >= 3 && $count % 100 <= 10 ) { |
| 20 | + } elseif ( $count % 100 >= 3 && $count % 100 <= 10 ) { |
21 | 21 | $index = 3; |
22 | | - } elseif( $count % 100 >= 11 && $count % 100 <= 99 ) { |
| 22 | + } elseif ( $count % 100 >= 11 && $count % 100 <= 99 ) { |
23 | 23 | $index = 4; |
24 | 24 | } else { |
25 | 25 | $index = 5; |
— | — | @@ -27,10 +27,10 @@ |
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
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. |
33 | 33 | * |
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 |
35 | 35 | * performance impact of enabling it for all languages. |
36 | 36 | */ |
37 | 37 | function normalize( $s ) { |
Index: trunk/phase3/languages/classes/LanguageEo.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | function iconv( $in, $out, $string ) { |
10 | 10 | # Por multaj lingvoj, ĉi tiu nur voku la sisteman funkcion iconv() |
11 | 11 | # 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 ) { |
13 | 13 | $xu = array ( |
14 | 14 | 'xx' => 'x' , 'xX' => 'x' , |
15 | 15 | 'Xx' => 'X' , 'XX' => 'X' , |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | ) ; |
29 | 29 | return preg_replace ( '/([cghjsu]x?)((?:xx)*)(?!x)/ei', |
30 | 30 | '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 ) { |
32 | 32 | $ux = array ( |
33 | 33 | 'x' => 'xx' , 'X' => 'Xx' , |
34 | 34 | "\xc4\x88" => "Cx" , "\xc4\x89" => "cx" , |
— | — | @@ -38,7 +38,7 @@ |
39 | 39 | "\xc5\xac" => "Ux" , "\xc5\xad" => "ux" |
40 | 40 | ) ; |
41 | 41 | # 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]' . |
43 | 43 | '|\xc5[\x9c\x9d\xac\xad])x*)/ei', 'strtr( "$1", $ux )', $string ); |
44 | 44 | } |
45 | 45 | return parent::iconv( $in, $out, $string ); |
— | — | @@ -46,20 +46,20 @@ |
47 | 47 | |
48 | 48 | function checkTitleEncoding( $s ) { |
49 | 49 | # Check for X-system backwards-compatibility URLs |
50 | | - $ishigh = preg_match( '/[\x80-\xff]/', $s); |
| 50 | + $ishigh = preg_match( '/[\x80-\xff]/', $s ); |
51 | 51 | $isutf = preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' . |
52 | 52 | '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s ); |
53 | 53 | |
54 | | - if($ishigh and !$isutf) { |
| 54 | + if ( $ishigh and !$isutf ) { |
55 | 55 | # Assume Latin1 |
56 | 56 | $s = utf8_encode( $s ); |
57 | 57 | } 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]' . |
59 | 59 | '|\xc5[\x9c\x9d\xac\xad])/', $s ) ) |
60 | 60 | return $s; |
61 | 61 | } |
62 | 62 | |
63 | | - //if( preg_match( '/[cghjsu]x/i', $s ) ) |
| 63 | + // if( preg_match( '/[cghjsu]x/i', $s ) ) |
64 | 64 | // return $this->iconv( 'x', 'utf-8', $s ); |
65 | 65 | return $s; |
66 | 66 | } |
Index: trunk/phase3/languages/classes/LanguageMg.php |
— | — | @@ -8,9 +8,9 @@ |
9 | 9 | * Use singular form for zero |
10 | 10 | */ |
11 | 11 | function convertPlural( $count, $forms ) { |
12 | | - if ( !count($forms) ) { return ''; } |
| 12 | + if ( !count( $forms ) ) { return ''; } |
13 | 13 | $forms = $this->preConvertPlural( $forms, 2 ); |
14 | 14 | |
15 | | - return ($count <= 1) ? $forms[0] : $forms[1]; |
| 15 | + return ( $count <= 1 ) ? $forms[0] : $forms[1]; |
16 | 16 | } |
17 | 17 | } |
Index: trunk/phase3/languages/classes/LanguageGan.php |
— | — | @@ -1,35 +1,35 @@ |
2 | 2 | <?php |
3 | 3 | |
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' ); |
6 | 6 | |
7 | 7 | /** |
8 | 8 | * @ingroup Language |
9 | 9 | */ |
10 | 10 | class GanConverter extends LanguageConverter { |
11 | 11 | |
12 | | - function __construct($langobj, $maincode, |
13 | | - $variants=array(), |
14 | | - $variantfallbacks=array(), |
| 12 | + function __construct( $langobj, $maincode, |
| 13 | + $variants = array(), |
| 14 | + $variantfallbacks = array(), |
15 | 15 | $flags = array(), |
16 | 16 | $manualLevel = array() ) { |
17 | 17 | $this->mDescCodeSep = ':'; |
18 | 18 | $this->mDescVarSep = ';'; |
19 | | - parent::__construct($langobj, $maincode, |
| 19 | + parent::__construct( $langobj, $maincode, |
20 | 20 | $variants, |
21 | 21 | $variantfallbacks, |
22 | 22 | $flags, |
23 | | - $manualLevel); |
| 23 | + $manualLevel ); |
24 | 24 | $names = array( |
25 | 25 | 'gan' => '原文', |
26 | 26 | 'gan-hans' => '简体', |
27 | 27 | 'gan-hant' => '繁體', |
28 | 28 | ); |
29 | | - $this->mVariantNames = array_merge($this->mVariantNames,$names); |
| 29 | + $this->mVariantNames = array_merge( $this->mVariantNames, $names ); |
30 | 30 | } |
31 | 31 | |
32 | 32 | function loadDefaultTables() { |
33 | | - require( dirname(__FILE__)."/../../includes/ZhConversion.php" ); |
| 33 | + require( dirname( __FILE__ ) . "/../../includes/ZhConversion.php" ); |
34 | 34 | $this->mTables = array( |
35 | 35 | 'gan-hans' => new ReplacementArray( $zh2Hans ), |
36 | 36 | 'gan-hant' => new ReplacementArray( $zh2Hant ), |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | to mark anything. |
43 | 43 | $noParse is there for compatibility with LanguageConvert::markNoConversion |
44 | 44 | */ |
45 | | - function markNoConversion($text, $noParse = false) { |
| 45 | + function markNoConversion( $text, $noParse = false ) { |
46 | 46 | return $text; |
47 | 47 | } |
48 | 48 | |
— | — | @@ -62,20 +62,20 @@ |
63 | 63 | global $wgHooks; |
64 | 64 | parent::__construct(); |
65 | 65 | |
66 | | - $variants = array('gan','gan-hans','gan-hant'); |
| 66 | + $variants = array( 'gan', 'gan-hans', 'gan-hant' ); |
67 | 67 | $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' ), |
71 | 71 | ); |
72 | | - $ml=array( |
| 72 | + $ml = array( |
73 | 73 | 'gan' => 'disable', |
74 | 74 | ); |
75 | 75 | |
76 | 76 | $this->mConverter = new GanConverter( $this, 'gan', |
77 | 77 | $variants, $variantfallbacks, |
78 | 78 | array(), |
79 | | - $ml); |
| 79 | + $ml ); |
80 | 80 | |
81 | 81 | $wgHooks['ArticleSaveComplete'][] = $this->mConverter; |
82 | 82 | } |
— | — | @@ -84,13 +84,13 @@ |
85 | 85 | function segmentForDiff( $text ) { |
86 | 86 | return preg_replace( |
87 | 87 | "/([\\xc0-\\xff][\\x80-\\xbf]*)/e", |
88 | | - "' ' .\"$1\"", $text); |
| 88 | + "' ' .\"$1\"", $text ); |
89 | 89 | } |
90 | 90 | |
91 | 91 | function unsegmentForDiff( $text ) { |
92 | 92 | return preg_replace( |
93 | 93 | "/ ([\\xc0-\\xff][\\x80-\\xbf]*)/e", |
94 | | - "\"$1\"", $text); |
| 94 | + "\"$1\"", $text ); |
95 | 95 | } |
96 | 96 | |
97 | 97 | // word segmentation |
— | — | @@ -103,7 +103,7 @@ |
104 | 104 | $terms = implode( '|', $termsArray ); |
105 | 105 | $terms = self::convertDoubleWidth( $terms ); |
106 | 106 | $terms = implode( '|', $this->mConverter->autoConvertToAllVariants( $terms ) ); |
107 | | - $ret = array_unique( explode('|', $terms) ); |
| 107 | + $ret = array_unique( explode( '|', $terms ) ); |
108 | 108 | return $ret; |
109 | 109 | } |
110 | 110 | } |
Index: trunk/phase3/languages/classes/LanguageMk.php |
— | — | @@ -9,7 +9,7 @@ |
10 | 10 | * http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#mk |
11 | 11 | */ |
12 | 12 | function convertPlural( $count, $forms ) { |
13 | | - if ( !count($forms) ) { return ''; } |
| 13 | + if ( !count( $forms ) ) { return ''; } |
14 | 14 | $forms = $this->preConvertPlural( $forms, 2 ); |
15 | 15 | |
16 | 16 | if ( $count % 10 === 1 && $count % 100 !== 11 ) { |
Index: trunk/phase3/languages/classes/LanguageDsb.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | } |
29 | 29 | |
30 | 30 | function convertPlural( $count, $forms ) { |
31 | | - if ( !count($forms) ) { return ''; } |
| 31 | + if ( !count( $forms ) ) { return ''; } |
32 | 32 | $forms = $this->preConvertPlural( $forms, 4 ); |
33 | 33 | |
34 | 34 | switch ( abs( $count ) % 100 ) { |
Index: trunk/phase3/languages/classes/LanguageEt.php |
— | — | @@ -9,9 +9,9 @@ |
10 | 10 | /** |
11 | 11 | * Avoid grouping whole numbers between 0 to 9999 |
12 | 12 | */ |
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( $_ ) ) ); |
16 | 16 | } else { |
17 | 17 | return $_; |
18 | 18 | } |
Index: trunk/phase3/languages/classes/LanguageMl.php |
— | — | @@ -2,13 +2,13 @@ |
3 | 3 | |
4 | 4 | class LanguageMl extends Language { |
5 | 5 | /** |
6 | | - * Temporary hack for the issue described at |
| 6 | + * Temporary hack for the issue described at |
7 | 7 | * 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, |
10 | 10 | * 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 |
13 | 13 | * performance impact of enabling it for all languages. |
14 | 14 | */ |
15 | 15 | function normalize( $s ) { |
Index: trunk/phase3/languages/classes/LanguageMo.php |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | function convertPlural( $count, $forms ) { |
9 | 9 | // Plural rules per |
10 | 10 | // http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#mo |
11 | | - if ( !count($forms) ) { return ''; } |
| 11 | + if ( !count( $forms ) ) { return ''; } |
12 | 12 | |
13 | 13 | $forms = $this->preConvertPlural( $forms, 3 ); |
14 | 14 | |
Index: trunk/phase3/languages/classes/LanguageHsb.php |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | } |
30 | 30 | |
31 | 31 | function convertPlural( $count, $forms ) { |
32 | | - if ( !count($forms) ) { return ''; } |
| 32 | + if ( !count( $forms ) ) { return ''; } |
33 | 33 | $forms = $this->preConvertPlural( $forms, 4 ); |
34 | 34 | |
35 | 35 | switch ( abs( $count ) % 100 ) { |
Index: trunk/phase3/languages/classes/LanguageUk.php |
— | — | @@ -9,67 +9,67 @@ |
10 | 10 | # Invoked with {{grammar:case|word}} |
11 | 11 | function convertGrammar( $word, $case ) { |
12 | 12 | global $wgGrammarForms; |
13 | | - if ( isset($wgGrammarForms['uk'][$case][$word]) ) { |
| 13 | + if ( isset( $wgGrammarForms['uk'][$case][$word] ) ) { |
14 | 14 | return $wgGrammarForms['uk'][$case][$word]; |
15 | 15 | } |
16 | 16 | |
17 | 17 | # These rules are not perfect, but they are currently only used for site names so it doesn't |
18 | 18 | # matter if they are wrong sometimes. Just add a special case for your site name if necessary. |
19 | 19 | |
20 | | - #join and array_slice instead mb_substr |
| 20 | + # join and array_slice instead mb_substr |
21 | 21 | $ar = array(); |
22 | 22 | preg_match_all( '/./us', $word, $ar ); |
23 | | - if (!preg_match("/[a-zA-Z_]/us", $word)) |
| 23 | + if ( !preg_match( "/[a-zA-Z_]/us", $word ) ) |
24 | 24 | 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 ) ) . 'ника'; |
40 | 40 | break; |
41 | | - case 'dative': #давальний відмінок |
42 | | - #stub |
| 41 | + case 'dative': # давальний відмінок |
| 42 | + # stub |
43 | 43 | 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 ) ) . 'ію'; |
49 | 49 | break; |
50 | | - case 'instrumental': #орудний відмінок |
51 | | - #stub |
| 50 | + case 'instrumental': # орудний відмінок |
| 51 | + # stub |
52 | 52 | break; |
53 | | - case 'prepositional': #місцевий відмінок |
54 | | - #stub |
| 53 | + case 'prepositional': # місцевий відмінок |
| 54 | + # stub |
55 | 55 | break; |
56 | 56 | } |
57 | 57 | return $word; |
58 | 58 | } |
59 | 59 | |
60 | 60 | function convertPlural( $count, $forms ) { |
61 | | - if ( !count($forms) ) { return ''; } |
| 61 | + if ( !count( $forms ) ) { return ''; } |
62 | 62 | |
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]; |
65 | 65 | |
66 | 66 | // FIXME: CLDR defines 4 plural forms. Form for decimals is missing/ |
67 | 67 | // See http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#uk |
68 | 68 | $forms = $this->preConvertPlural( $forms, 3 ); |
69 | 69 | |
70 | | - if ($count > 10 && floor(($count % 100) / 10) == 1) { |
| 70 | + if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) { |
71 | 71 | return $forms[2]; |
72 | 72 | } else { |
73 | | - switch ($count % 10) { |
| 73 | + switch ( $count % 10 ) { |
74 | 74 | case 1: return $forms[0]; |
75 | 75 | case 2: |
76 | 76 | case 3: |
— | — | @@ -83,9 +83,9 @@ |
84 | 84 | * Ukrainian numeric format is "12 345,67" but "1234,56" |
85 | 85 | */ |
86 | 86 | |
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( $_ ) ) ); |
90 | 90 | } else { |
91 | 91 | return $_; |
92 | 92 | } |
Index: trunk/phase3/languages/classes/LanguageMt.php |
— | — | @@ -9,13 +9,13 @@ |
10 | 10 | |
11 | 11 | class LanguageMt extends Language { |
12 | 12 | function convertPlural( $count, $forms ) { |
13 | | - if ( !count($forms) ) { return ''; } |
| 13 | + if ( !count( $forms ) ) { return ''; } |
14 | 14 | |
15 | 15 | $forms = $this->preConvertPlural( $forms, 4 ); |
16 | 16 | |
17 | 17 | 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; |
20 | 20 | else $index = 3; |
21 | 21 | return $forms[$index]; |
22 | 22 | } |
Index: trunk/phase3/languages/classes/LanguageSma.php |
— | — | @@ -5,14 +5,14 @@ |
6 | 6 | */ |
7 | 7 | class LanguageSma extends Language { |
8 | 8 | function convertPlural( $count, $forms ) { |
9 | | - if ( !count($forms) ) { return ''; } |
| 9 | + if ( !count( $forms ) ) { return ''; } |
10 | 10 | |
11 | 11 | // plural forms per http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#sma |
12 | 12 | $forms = $this->preConvertPlural( $forms, 3 ); |
13 | 13 | |
14 | 14 | if ( $count == 1 ) { |
15 | 15 | $index = 1; |
16 | | - } elseif( $count == 2 ) { |
| 16 | + } elseif ( $count == 2 ) { |
17 | 17 | $index = 2; |
18 | 18 | } else { |
19 | 19 | $index = 3; |
Index: trunk/phase3/languages/classes/LanguageMy.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | */ |
10 | 10 | |
11 | 11 | class LanguageMy extends Language { |
12 | | - function commafy($_) { |
| 12 | + function commafy( $_ ) { |
13 | 13 | /* NO-op. Cannot use |
14 | 14 | * $separatorTransformTable = array( ',' => '' ) |
15 | 15 | * That would break when parsing and doing strstr '' => 'foo'; |
Index: trunk/phase3/languages/classes/LanguageBe.php |
— | — | @@ -15,15 +15,15 @@ |
16 | 16 | class LanguageBe extends Language { |
17 | 17 | |
18 | 18 | function convertPlural( $count, $forms ) { |
19 | | - if ( !count($forms) ) { return ''; } |
| 19 | + if ( !count( $forms ) ) { return ''; } |
20 | 20 | // FIXME: CLDR defines 4 plural forms instead of 3 |
21 | 21 | // http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html |
22 | 22 | $forms = $this->preConvertPlural( $forms, 3 ); |
23 | 23 | |
24 | | - if ($count > 10 && floor(($count % 100) / 10) == 1) { |
| 24 | + if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) { |
25 | 25 | return $forms[2]; |
26 | 26 | } else { |
27 | | - switch ($count % 10) { |
| 27 | + switch ( $count % 10 ) { |
28 | 28 | case 1: return $forms[0]; |
29 | 29 | case 2: |
30 | 30 | case 3: |
Index: trunk/phase3/languages/classes/LanguageBg.php |
— | — | @@ -9,9 +9,9 @@ |
10 | 10 | * ISO number formatting: 123 456 789,99. |
11 | 11 | * Avoid tripple grouping by numbers with whole part up to 4 digits. |
12 | 12 | */ |
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( $_ ) ) ); |
16 | 16 | } else { |
17 | 17 | return $_; |
18 | 18 | } |
Index: trunk/phase3/languages/classes/LanguageBh.php |
— | — | @@ -8,9 +8,9 @@ |
9 | 9 | * Use singular form for zero |
10 | 10 | */ |
11 | 11 | function convertPlural( $count, $forms ) { |
12 | | - if ( !count($forms) ) { return ''; } |
| 12 | + if ( !count( $forms ) ) { return ''; } |
13 | 13 | $forms = $this->preConvertPlural( $forms, 2 ); |
14 | 14 | |
15 | | - return ($count <= 1) ? $forms[0] : $forms[1]; |
| 15 | + return ( $count <= 1 ) ? $forms[0] : $forms[1]; |
16 | 16 | } |
17 | 17 | } |
Index: trunk/phase3/languages/classes/LanguageKk_cyrl.php |
— | — | @@ -27,10 +27,10 @@ |
28 | 28 | $allVowels = array( "е", "ө", "ү", "і", "ә", "э", "а", "о", "ұ", "ы", "я", "ё", "и" ); |
29 | 29 | // Preceding letters |
30 | 30 | $Nasals = array( "м", "н", "ң" ); |
31 | | - $Sonants = array( "и", "й", "л", "р", "у", "ю"); |
| 31 | + $Sonants = array( "и", "й", "л", "р", "у", "ю" ); |
32 | 32 | $Consonants = array( "п", "ф", "к", "қ", "т", "ш", "с", "х", "ц", "ч", "щ", "б", "в", "г", "д" ); |
33 | 33 | $Sibilants = array( "ж", "з" ); |
34 | | - $Sonorants = array( "и", "й", "л", "р", "у", "ю", "м", "н", "ң", "ж", "з"); |
| 34 | + $Sonorants = array( "и", "й", "л", "р", "у", "ю", "м", "н", "ң", "ж", "з" ); |
35 | 35 | |
36 | 36 | // Possessives |
37 | 37 | $firstPerson = array( "м", "ң" ); // 1st singular, 2nd unformal |
— | — | @@ -44,7 +44,7 @@ |
45 | 45 | // Now convert the word |
46 | 46 | switch ( $case ) { |
47 | 47 | case "dc1": |
48 | | - case "genitive": #ilik |
| 48 | + case "genitive": # ilik |
49 | 49 | if ( in_array( $wordEnding, $Consonants ) ) { |
50 | 50 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
51 | 51 | $word = $word . "тің"; |
— | — | @@ -57,7 +57,7 @@ |
58 | 58 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
59 | 59 | $word = $word . "ның"; |
60 | 60 | } |
61 | | - } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants )) { |
| 61 | + } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) { |
62 | 62 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
63 | 63 | $word = $word . "дің"; |
64 | 64 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
— | — | @@ -66,7 +66,7 @@ |
67 | 67 | } |
68 | 68 | break; |
69 | 69 | case "dc2": |
70 | | - case "dative": #barıs |
| 70 | + case "dative": # barıs |
71 | 71 | if ( in_array( $wordEnding, $Consonants ) ) { |
72 | 72 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
73 | 73 | $word = $word . "ке"; |
— | — | @@ -82,7 +82,7 @@ |
83 | 83 | } |
84 | 84 | break; |
85 | 85 | case "dc21": |
86 | | - case "possessive dative": #täweldık + barıs |
| 86 | + case "possessive dative": # täweldık + barıs |
87 | 87 | if ( in_array( $wordEnding, $firstPerson ) ) { |
88 | 88 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
89 | 89 | $word = $word . "е"; |
— | — | @@ -104,7 +104,7 @@ |
105 | 105 | } |
106 | 106 | break; |
107 | 107 | case "dc3": |
108 | | - case "accusative": #tabıs |
| 108 | + case "accusative": # tabıs |
109 | 109 | if ( in_array( $wordEnding, $Consonants ) ) { |
110 | 110 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
111 | 111 | $word = $word . "ті"; |
— | — | @@ -112,13 +112,13 @@ |
113 | 113 | $word = $word . "ты"; |
114 | 114 | } |
115 | 115 | } elseif ( in_array( $wordEnding, $allVowels ) ) { |
116 | | - if ( in_array($wordLastVowel, $frontVowels ) ) { |
| 116 | + if ( in_array( $wordLastVowel, $frontVowels ) ) { |
117 | 117 | $word = $word . "ні"; |
118 | 118 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
119 | 119 | $word = $word . "ны"; |
120 | 120 | } |
121 | | - } elseif ( in_array( $wordEnding, $Sonorants) ) { |
122 | | - if ( in_array( $wordLastVowel, $frontVowels) ) { |
| 121 | + } elseif ( in_array( $wordEnding, $Sonorants ) ) { |
| 122 | + if ( in_array( $wordLastVowel, $frontVowels ) ) { |
123 | 123 | $word = $word . "ді"; |
124 | 124 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
125 | 125 | $word = $word . "ды"; |
— | — | @@ -126,7 +126,7 @@ |
127 | 127 | } |
128 | 128 | break; |
129 | 129 | case "dc31": |
130 | | - case "possessive accusative": #täweldık + tabıs |
| 130 | + case "possessive accusative": # täweldık + tabıs |
131 | 131 | if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) { |
132 | 132 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
133 | 133 | $word = $word . "ді"; |
— | — | @@ -138,7 +138,7 @@ |
139 | 139 | } |
140 | 140 | break; |
141 | 141 | case "dc4": |
142 | | - case "locative": #jatıs |
| 142 | + case "locative": # jatıs |
143 | 143 | if ( in_array( $wordEnding, $Consonants ) ) { |
144 | 144 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
145 | 145 | $word = $word . "те"; |
— | — | @@ -146,7 +146,7 @@ |
147 | 147 | $word = $word . "та"; |
148 | 148 | } |
149 | 149 | } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) { |
150 | | - if ( in_array( $wordLastVowel, $frontVowels) ) { |
| 150 | + if ( in_array( $wordLastVowel, $frontVowels ) ) { |
151 | 151 | $word = $word . "де"; |
152 | 152 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
153 | 153 | $word = $word . "да"; |
— | — | @@ -154,7 +154,7 @@ |
155 | 155 | } |
156 | 156 | break; |
157 | 157 | case "dc41": |
158 | | - case "possessive locative": #täweldık + jatıs |
| 158 | + case "possessive locative": # täweldık + jatıs |
159 | 159 | if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) { |
160 | 160 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
161 | 161 | $word = $word . "де"; |
— | — | @@ -162,7 +162,7 @@ |
163 | 163 | $word = $word . "да"; |
164 | 164 | } |
165 | 165 | } elseif ( in_array( $wordEnding, $thirdPerson ) ) { |
166 | | - if ( in_array( $wordLastVowel, $frontVowels) ) { |
| 166 | + if ( in_array( $wordLastVowel, $frontVowels ) ) { |
167 | 167 | $word = $word . "нде"; |
168 | 168 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
169 | 169 | $word = $word . "нда"; |
— | — | @@ -170,20 +170,20 @@ |
171 | 171 | } |
172 | 172 | break; |
173 | 173 | case "dc5": |
174 | | - case "ablative": #şığıs |
| 174 | + case "ablative": # şığıs |
175 | 175 | if ( in_array( $wordEnding, $Consonants ) ) { |
176 | 176 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
177 | 177 | $word = $word . "тен"; |
178 | 178 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
179 | 179 | $word = $word . "тан"; |
180 | 180 | } |
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 ) ) { |
182 | 182 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
183 | 183 | $word = $word . "ден"; |
184 | 184 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
185 | 185 | $word = $word . "дан"; |
186 | 186 | } |
187 | | - } elseif ( in_array($wordEnding, $Nasals ) ) { |
| 187 | + } elseif ( in_array( $wordEnding, $Nasals ) ) { |
188 | 188 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
189 | 189 | $word = $word . "нен"; |
190 | 190 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
— | — | @@ -192,14 +192,14 @@ |
193 | 193 | } |
194 | 194 | break; |
195 | 195 | case "dc51": |
196 | | - case "possessive ablative": #täweldık + şığıs |
| 196 | + case "possessive ablative": # täweldık + şığıs |
197 | 197 | if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) { |
198 | 198 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
199 | 199 | $word = $word . "нен"; |
200 | 200 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
201 | 201 | $word = $word . "нан"; |
202 | 202 | } |
203 | | - } elseif ( in_array($wordEnding, $secondPerson ) ) { |
| 203 | + } elseif ( in_array( $wordEnding, $secondPerson ) ) { |
204 | 204 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
205 | 205 | $word = $word . "ден"; |
206 | 206 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
— | — | @@ -208,7 +208,7 @@ |
209 | 209 | } |
210 | 210 | break; |
211 | 211 | case "dc6": |
212 | | - case "comitative": #kömektes |
| 212 | + case "comitative": # kömektes |
213 | 213 | if ( in_array( $wordEnding, $Consonants ) ) { |
214 | 214 | $word = $word . "пен"; |
215 | 215 | } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) { |
— | — | @@ -218,7 +218,7 @@ |
219 | 219 | } |
220 | 220 | break; |
221 | 221 | case "dc61": |
222 | | - case "possessive comitative": #täweldık + kömektes |
| 222 | + case "possessive comitative": # täweldık + kömektes |
223 | 223 | if ( in_array( $wordEnding, $Consonants ) ) { |
224 | 224 | $word = $word . "пенен"; |
225 | 225 | } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) { |
— | — | @@ -227,7 +227,7 @@ |
228 | 228 | $word = $word . "бенен"; |
229 | 229 | } |
230 | 230 | break; |
231 | | - default: #dc0 #nominative #ataw |
| 231 | + default: # dc0 #nominative #ataw |
232 | 232 | } |
233 | 233 | return $word; |
234 | 234 | } |
— | — | @@ -247,10 +247,10 @@ |
248 | 248 | $allVowels = array( "e", "ö", "ü", "i", "ä", "é", "a", "o", "u", "ı" ); |
249 | 249 | // Preceding letters |
250 | 250 | $Nasals = array( "m", "n", "ñ" ); |
251 | | - $Sonants = array( "ï", "y", "ý", "l", "r", "w"); |
| 251 | + $Sonants = array( "ï", "y", "ý", "l", "r", "w" ); |
252 | 252 | $Consonants = array( "p", "f", "k", "q", "t", "ş", "s", "x", "c", "ç", "b", "v", "g", "d" ); |
253 | 253 | $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" ); |
255 | 255 | |
256 | 256 | // Possessives |
257 | 257 | $firstPerson = array( "m", "ñ" ); // 1st singular, 2nd unformal |
— | — | @@ -264,7 +264,7 @@ |
265 | 265 | // Now convert the word |
266 | 266 | switch ( $case ) { |
267 | 267 | case "dc1": |
268 | | - case "genitive": #ilik |
| 268 | + case "genitive": # ilik |
269 | 269 | if ( in_array( $wordEnding, $Consonants ) ) { |
270 | 270 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
271 | 271 | $word = $word . "tiñ"; |
— | — | @@ -277,7 +277,7 @@ |
278 | 278 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
279 | 279 | $word = $word . "nıñ"; |
280 | 280 | } |
281 | | - } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants )) { |
| 281 | + } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) { |
282 | 282 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
283 | 283 | $word = $word . "diñ"; |
284 | 284 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
— | — | @@ -286,7 +286,7 @@ |
287 | 287 | } |
288 | 288 | break; |
289 | 289 | case "dc2": |
290 | | - case "dative": #barıs |
| 290 | + case "dative": # barıs |
291 | 291 | if ( in_array( $wordEnding, $Consonants ) ) { |
292 | 292 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
293 | 293 | $word = $word . "ke"; |
— | — | @@ -302,7 +302,7 @@ |
303 | 303 | } |
304 | 304 | break; |
305 | 305 | case "dc21": |
306 | | - case "possessive dative": #täweldık + barıs |
| 306 | + case "possessive dative": # täweldık + barıs |
307 | 307 | if ( in_array( $wordEnding, $firstPerson ) ) { |
308 | 308 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
309 | 309 | $word = $word . "e"; |
— | — | @@ -324,7 +324,7 @@ |
325 | 325 | } |
326 | 326 | break; |
327 | 327 | case "dc3": |
328 | | - case "accusative": #tabıs |
| 328 | + case "accusative": # tabıs |
329 | 329 | if ( in_array( $wordEnding, $Consonants ) ) { |
330 | 330 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
331 | 331 | $word = $word . "ti"; |
— | — | @@ -332,13 +332,13 @@ |
333 | 333 | $word = $word . "tı"; |
334 | 334 | } |
335 | 335 | } elseif ( in_array( $wordEnding, $allVowels ) ) { |
336 | | - if ( in_array($wordLastVowel, $frontVowels ) ) { |
| 336 | + if ( in_array( $wordLastVowel, $frontVowels ) ) { |
337 | 337 | $word = $word . "ni"; |
338 | 338 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
339 | 339 | $word = $word . "nı"; |
340 | 340 | } |
341 | | - } elseif ( in_array( $wordEnding, $Sonorants) ) { |
342 | | - if ( in_array( $wordLastVowel, $frontVowels) ) { |
| 341 | + } elseif ( in_array( $wordEnding, $Sonorants ) ) { |
| 342 | + if ( in_array( $wordLastVowel, $frontVowels ) ) { |
343 | 343 | $word = $word . "di"; |
344 | 344 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
345 | 345 | $word = $word . "dı"; |
— | — | @@ -346,7 +346,7 @@ |
347 | 347 | } |
348 | 348 | break; |
349 | 349 | case "dc31": |
350 | | - case "possessive accusative": #täweldık + tabıs |
| 350 | + case "possessive accusative": # täweldık + tabıs |
351 | 351 | if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) { |
352 | 352 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
353 | 353 | $word = $word . "di"; |
— | — | @@ -358,7 +358,7 @@ |
359 | 359 | } |
360 | 360 | break; |
361 | 361 | case "dc4": |
362 | | - case "locative": #jatıs |
| 362 | + case "locative": # jatıs |
363 | 363 | if ( in_array( $wordEnding, $Consonants ) ) { |
364 | 364 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
365 | 365 | $word = $word . "te"; |
— | — | @@ -366,7 +366,7 @@ |
367 | 367 | $word = $word . "ta"; |
368 | 368 | } |
369 | 369 | } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) { |
370 | | - if ( in_array( $wordLastVowel, $frontVowels) ) { |
| 370 | + if ( in_array( $wordLastVowel, $frontVowels ) ) { |
371 | 371 | $word = $word . "de"; |
372 | 372 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
373 | 373 | $word = $word . "da"; |
— | — | @@ -374,7 +374,7 @@ |
375 | 375 | } |
376 | 376 | break; |
377 | 377 | case "dc41": |
378 | | - case "possessive locative": #täweldık + jatıs |
| 378 | + case "possessive locative": # täweldık + jatıs |
379 | 379 | if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) { |
380 | 380 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
381 | 381 | $word = $word . "de"; |
— | — | @@ -382,7 +382,7 @@ |
383 | 383 | $word = $word . "da"; |
384 | 384 | } |
385 | 385 | } elseif ( in_array( $wordEnding, $thirdPerson ) ) { |
386 | | - if ( in_array( $wordLastVowel, $frontVowels) ) { |
| 386 | + if ( in_array( $wordLastVowel, $frontVowels ) ) { |
387 | 387 | $word = $word . "nde"; |
388 | 388 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
389 | 389 | $word = $word . "nda"; |
— | — | @@ -390,20 +390,20 @@ |
391 | 391 | } |
392 | 392 | break; |
393 | 393 | case "dc5": |
394 | | - case "ablative": #şığıs |
| 394 | + case "ablative": # şığıs |
395 | 395 | if ( in_array( $wordEnding, $Consonants ) ) { |
396 | 396 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
397 | 397 | $word = $word . "ten"; |
398 | 398 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
399 | 399 | $word = $word . "tan"; |
400 | 400 | } |
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 ) ) { |
402 | 402 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
403 | 403 | $word = $word . "den"; |
404 | 404 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
405 | 405 | $word = $word . "dan"; |
406 | 406 | } |
407 | | - } elseif ( in_array($wordEnding, $Nasals ) ) { |
| 407 | + } elseif ( in_array( $wordEnding, $Nasals ) ) { |
408 | 408 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
409 | 409 | $word = $word . "nen"; |
410 | 410 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
— | — | @@ -412,14 +412,14 @@ |
413 | 413 | } |
414 | 414 | break; |
415 | 415 | case "dc51": |
416 | | - case "possessive ablative": #täweldık + şığıs |
| 416 | + case "possessive ablative": # täweldık + şığıs |
417 | 417 | if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) { |
418 | 418 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
419 | 419 | $word = $word . "nen"; |
420 | 420 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
421 | 421 | $word = $word . "nan"; |
422 | 422 | } |
423 | | - } elseif ( in_array($wordEnding, $secondPerson ) ) { |
| 423 | + } elseif ( in_array( $wordEnding, $secondPerson ) ) { |
424 | 424 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
425 | 425 | $word = $word . "den"; |
426 | 426 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
— | — | @@ -428,7 +428,7 @@ |
429 | 429 | } |
430 | 430 | break; |
431 | 431 | case "dc6": |
432 | | - case "comitative": #kömektes |
| 432 | + case "comitative": # kömektes |
433 | 433 | if ( in_array( $wordEnding, $Consonants ) ) { |
434 | 434 | $word = $word . "pen"; |
435 | 435 | } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) { |
— | — | @@ -438,7 +438,7 @@ |
439 | 439 | } |
440 | 440 | break; |
441 | 441 | case "dc61": |
442 | | - case "possessive comitative": #täweldık + kömektes |
| 442 | + case "possessive comitative": # täweldık + kömektes |
443 | 443 | if ( in_array( $wordEnding, $Consonants ) ) { |
444 | 444 | $word = $word . "penen"; |
445 | 445 | } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) { |
— | — | @@ -447,7 +447,7 @@ |
448 | 448 | $word = $word . "benen"; |
449 | 449 | } |
450 | 450 | break; |
451 | | - default: #dc0 #nominative #ataw |
| 451 | + default: # dc0 #nominative #ataw |
452 | 452 | } |
453 | 453 | return $word; |
454 | 454 | } |
— | — | @@ -467,10 +467,10 @@ |
468 | 468 | $allVowels = array( "ە", "ٶ", "ٷ", "ٸ", "ٵ", "ە", "ا", "و", "ۇ", "ى" ); |
469 | 469 | // Preceding letters |
470 | 470 | $Nasals = array( "م", "ن", "ڭ" ); |
471 | | - $Sonants = array( "ي", "ي", "ل", "ر", "ۋ"); |
| 471 | + $Sonants = array( "ي", "ي", "ل", "ر", "ۋ" ); |
472 | 472 | $Consonants = array( "پ", "ف", "ك", "ق", "ت", "ش", "س", "ح", "تس", "چ", "ب", "ۆ", "گ", "د" ); |
473 | 473 | $Sibilants = array( "ج", "ز" ); |
474 | | - $Sonorants = array( "ي", "ي", "ل", "ر", "ۋ", "م", "ن", "ڭ", "ج", "ز"); |
| 474 | + $Sonorants = array( "ي", "ي", "ل", "ر", "ۋ", "م", "ن", "ڭ", "ج", "ز" ); |
475 | 475 | |
476 | 476 | // Possessives |
477 | 477 | $firstPerson = array( "م", "ڭ" ); // 1st singular, 2nd unformal |
— | — | @@ -484,7 +484,7 @@ |
485 | 485 | // Now convert the word |
486 | 486 | switch ( $case ) { |
487 | 487 | case "dc1": |
488 | | - case "genitive": #ilik |
| 488 | + case "genitive": # ilik |
489 | 489 | if ( in_array( $wordEnding, $Consonants ) ) { |
490 | 490 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
491 | 491 | $word = $word . "تٸڭ"; |
— | — | @@ -497,7 +497,7 @@ |
498 | 498 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
499 | 499 | $word = $word . "نىڭ"; |
500 | 500 | } |
501 | | - } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants )) { |
| 501 | + } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) { |
502 | 502 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
503 | 503 | $word = $word . "دٸڭ"; |
504 | 504 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
— | — | @@ -506,7 +506,7 @@ |
507 | 507 | } |
508 | 508 | break; |
509 | 509 | case "dc2": |
510 | | - case "dative": #barıs |
| 510 | + case "dative": # barıs |
511 | 511 | if ( in_array( $wordEnding, $Consonants ) ) { |
512 | 512 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
513 | 513 | $word = $word . "كە"; |
— | — | @@ -522,7 +522,7 @@ |
523 | 523 | } |
524 | 524 | break; |
525 | 525 | case "dc21": |
526 | | - case "possessive dative": #täweldık + barıs |
| 526 | + case "possessive dative": # täweldık + barıs |
527 | 527 | if ( in_array( $wordEnding, $firstPerson ) ) { |
528 | 528 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
529 | 529 | $word = $word . "ە"; |
— | — | @@ -544,7 +544,7 @@ |
545 | 545 | } |
546 | 546 | break; |
547 | 547 | case "dc3": |
548 | | - case "accusative": #tabıs |
| 548 | + case "accusative": # tabıs |
549 | 549 | if ( in_array( $wordEnding, $Consonants ) ) { |
550 | 550 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
551 | 551 | $word = $word . "تٸ"; |
— | — | @@ -552,13 +552,13 @@ |
553 | 553 | $word = $word . "تى"; |
554 | 554 | } |
555 | 555 | } elseif ( in_array( $wordEnding, $allVowels ) ) { |
556 | | - if ( in_array($wordLastVowel, $frontVowels ) ) { |
| 556 | + if ( in_array( $wordLastVowel, $frontVowels ) ) { |
557 | 557 | $word = $word . "نٸ"; |
558 | 558 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
559 | 559 | $word = $word . "نى"; |
560 | 560 | } |
561 | | - } elseif ( in_array( $wordEnding, $Sonorants) ) { |
562 | | - if ( in_array( $wordLastVowel, $frontVowels) ) { |
| 561 | + } elseif ( in_array( $wordEnding, $Sonorants ) ) { |
| 562 | + if ( in_array( $wordLastVowel, $frontVowels ) ) { |
563 | 563 | $word = $word . "دٸ"; |
564 | 564 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
565 | 565 | $word = $word . "دى"; |
— | — | @@ -566,7 +566,7 @@ |
567 | 567 | } |
568 | 568 | break; |
569 | 569 | case "dc31": |
570 | | - case "possessive accusative": #täweldık + tabıs |
| 570 | + case "possessive accusative": # täweldık + tabıs |
571 | 571 | if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) { |
572 | 572 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
573 | 573 | $word = $word . "دٸ"; |
— | — | @@ -578,7 +578,7 @@ |
579 | 579 | } |
580 | 580 | break; |
581 | 581 | case "dc4": |
582 | | - case "locative": #jatıs |
| 582 | + case "locative": # jatıs |
583 | 583 | if ( in_array( $wordEnding, $Consonants ) ) { |
584 | 584 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
585 | 585 | $word = $word . "تە"; |
— | — | @@ -586,7 +586,7 @@ |
587 | 587 | $word = $word . "تا"; |
588 | 588 | } |
589 | 589 | } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) { |
590 | | - if ( in_array( $wordLastVowel, $frontVowels) ) { |
| 590 | + if ( in_array( $wordLastVowel, $frontVowels ) ) { |
591 | 591 | $word = $word . "دە"; |
592 | 592 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
593 | 593 | $word = $word . "دا"; |
— | — | @@ -594,7 +594,7 @@ |
595 | 595 | } |
596 | 596 | break; |
597 | 597 | case "dc41": |
598 | | - case "possessive locative": #täweldık + jatıs |
| 598 | + case "possessive locative": # täweldık + jatıs |
599 | 599 | if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) { |
600 | 600 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
601 | 601 | $word = $word . "دە"; |
— | — | @@ -602,7 +602,7 @@ |
603 | 603 | $word = $word . "دا"; |
604 | 604 | } |
605 | 605 | } elseif ( in_array( $wordEnding, $thirdPerson ) ) { |
606 | | - if ( in_array( $wordLastVowel, $frontVowels) ) { |
| 606 | + if ( in_array( $wordLastVowel, $frontVowels ) ) { |
607 | 607 | $word = $word . "ندە"; |
608 | 608 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
609 | 609 | $word = $word . "ندا"; |
— | — | @@ -610,20 +610,20 @@ |
611 | 611 | } |
612 | 612 | break; |
613 | 613 | case "dc5": |
614 | | - case "ablative": #şığıs |
| 614 | + case "ablative": # şığıs |
615 | 615 | if ( in_array( $wordEnding, $Consonants ) ) { |
616 | 616 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
617 | 617 | $word = $word . "تەن"; |
618 | 618 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
619 | 619 | $word = $word . "تان"; |
620 | 620 | } |
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 ) ) { |
622 | 622 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
623 | 623 | $word = $word . "دەن"; |
624 | 624 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
625 | 625 | $word = $word . "دان"; |
626 | 626 | } |
627 | | - } elseif ( in_array($wordEnding, $Nasals ) ) { |
| 627 | + } elseif ( in_array( $wordEnding, $Nasals ) ) { |
628 | 628 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
629 | 629 | $word = $word . "نەن"; |
630 | 630 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
— | — | @@ -632,14 +632,14 @@ |
633 | 633 | } |
634 | 634 | break; |
635 | 635 | case "dc51": |
636 | | - case "possessive ablative": #täweldık + şığıs |
| 636 | + case "possessive ablative": # täweldık + şığıs |
637 | 637 | if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) { |
638 | 638 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
639 | 639 | $word = $word . "نەن"; |
640 | 640 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
641 | 641 | $word = $word . "نان"; |
642 | 642 | } |
643 | | - } elseif ( in_array($wordEnding, $secondPerson ) ) { |
| 643 | + } elseif ( in_array( $wordEnding, $secondPerson ) ) { |
644 | 644 | if ( in_array( $wordLastVowel, $frontVowels ) ) { |
645 | 645 | $word = $word . "دەن"; |
646 | 646 | } elseif ( in_array( $wordLastVowel, $backVowels ) ) { |
— | — | @@ -648,7 +648,7 @@ |
649 | 649 | } |
650 | 650 | break; |
651 | 651 | case "dc6": |
652 | | - case "comitative": #kömektes |
| 652 | + case "comitative": # kömektes |
653 | 653 | if ( in_array( $wordEnding, $Consonants ) ) { |
654 | 654 | $word = $word . "پەن"; |
655 | 655 | } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) { |
— | — | @@ -658,7 +658,7 @@ |
659 | 659 | } |
660 | 660 | break; |
661 | 661 | case "dc61": |
662 | | - case "possessive comitative": #täweldık + kömektes |
| 662 | + case "possessive comitative": # täweldık + kömektes |
663 | 663 | if ( in_array( $wordEnding, $Consonants ) ) { |
664 | 664 | $word = $word . "پەنەن"; |
665 | 665 | } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) { |
— | — | @@ -667,7 +667,7 @@ |
668 | 668 | $word = $word . "بەنەن"; |
669 | 669 | } |
670 | 670 | break; |
671 | | - default: #dc0 #nominative #ataw |
| 671 | + default: # dc0 #nominative #ataw |
672 | 672 | } |
673 | 673 | return $word; |
674 | 674 | } |
— | — | @@ -677,7 +677,7 @@ |
678 | 678 | $ar = array(); |
679 | 679 | |
680 | 680 | // 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 ); |
682 | 682 | |
683 | 683 | // Here's an array with the order of the letters in the word reversed |
684 | 684 | // so we can find a match quicker *shrug* |
— | — | @@ -712,7 +712,7 @@ |
713 | 713 | */ |
714 | 714 | function commafy( $_ ) { |
715 | 715 | 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( $_ ) ) ); |
717 | 717 | } else { |
718 | 718 | return $_; |
719 | 719 | } |
Index: trunk/phase3/languages/classes/LanguageFi.php |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | # Invoked with {{GRAMMAR:case|word}} |
14 | 14 | function convertGrammar( $word, $case ) { |
15 | 15 | global $wgGrammarForms; |
16 | | - if ( isset($wgGrammarForms['fi'][$case][$word]) ) { |
| 16 | + if ( isset( $wgGrammarForms['fi'][$case][$word] ) ) { |
17 | 17 | return $wgGrammarForms['fi'][$case][$word]; |
18 | 18 | } |
19 | 19 | |
— | — | @@ -38,18 +38,18 @@ |
39 | 39 | $word .= 'n'; |
40 | 40 | break; |
41 | 41 | case 'elative': |
42 | | - $word .= ($aou ? 'sta' : 'stä'); |
| 42 | + $word .= ( $aou ? 'sta' : 'stä' ); |
43 | 43 | break; |
44 | 44 | case 'partitive': |
45 | | - $word .= ($aou ? 'a' : 'ä'); |
| 45 | + $word .= ( $aou ? 'a' : 'ä' ); |
46 | 46 | break; |
47 | 47 | case 'illative': |
48 | 48 | # Double the last letter and add 'n' |
49 | 49 | # 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'; |
51 | 51 | break; |
52 | 52 | case 'inessive': |
53 | | - $word .= ($aou ? 'ssa' : 'ssä'); |
| 53 | + $word .= ( $aou ? 'ssa' : 'ssä' ); |
54 | 54 | break; |
55 | 55 | } |
56 | 56 | return $word; |
— | — | @@ -113,15 +113,15 @@ |
114 | 114 | ); |
115 | 115 | |
116 | 116 | $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 ) { |
121 | 121 | list( $yyyy, $mm, $dd ) = explode( '-', $item ); |
122 | | - $final .= ' ' . $this->date( "{$yyyy}{$mm}{$dd}00000000"); |
| 122 | + $final .= ' ' . $this->date( "{$yyyy}{$mm}{$dd}00000000" ); |
123 | 123 | continue; |
124 | 124 | } |
125 | | - if( isset( $weekds[$item] ) ) { |
| 125 | + if ( isset( $weekds[$item] ) ) { |
126 | 126 | $final .= ' ' . $weekds[$item]; |
127 | 127 | continue; |
128 | 128 | } |
Index: trunk/phase3/languages/classes/LanguageNso.php |
— | — | @@ -8,9 +8,9 @@ |
9 | 9 | * Use singular form for zero |
10 | 10 | */ |
11 | 11 | function convertPlural( $count, $forms ) { |
12 | | - if ( !count($forms) ) { return ''; } |
| 12 | + if ( !count( $forms ) ) { return ''; } |
13 | 13 | $forms = $this->preConvertPlural( $forms, 2 ); |
14 | 14 | |
15 | | - return ($count <= 1) ? $forms[0] : $forms[1]; |
| 15 | + return ( $count <= 1 ) ? $forms[0] : $forms[1]; |
16 | 16 | } |
17 | 17 | } |
Index: trunk/phase3/languages/classes/LanguageYue.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | $s = self::insertSpace( $string, $reg ); |
19 | 19 | return $s; |
20 | 20 | } |
21 | | - |
| 21 | + |
22 | 22 | function normalizeForSearch( $string ) { |
23 | 23 | wfProfileIn( __METHOD__ ); |
24 | 24 | |
Index: trunk/phase3/languages/classes/LanguageBs.php |
— | — | @@ -7,15 +7,15 @@ |
8 | 8 | class LanguageBs extends Language { |
9 | 9 | |
10 | 10 | function convertPlural( $count, $forms ) { |
11 | | - if ( !count($forms) ) { return ''; } |
| 11 | + if ( !count( $forms ) ) { return ''; } |
12 | 12 | $forms = $this->preConvertPlural( $forms, 3 ); |
13 | 13 | |
14 | 14 | // FIXME: CLDR defines 4 plural forms instead of 3. Plural for decimals is missing. |
15 | 15 | // 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 ) { |
17 | 17 | return $forms[2]; |
18 | 18 | } else { |
19 | | - switch ($count % 10) { |
| 19 | + switch ( $count % 10 ) { |
20 | 20 | case 1: return $forms[0]; |
21 | 21 | case 2: |
22 | 22 | case 3: |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | */ |
34 | 34 | function convertGrammar( $word, $case ) { |
35 | 35 | global $wgGrammarForms; |
36 | | - if ( isset($wgGrammarForms['bs'][$case][$word]) ) { |
| 36 | + if ( isset( $wgGrammarForms['bs'][$case][$word] ) ) { |
37 | 37 | return $wgGrammarForms['bs'][$case][$word]; |
38 | 38 | } |
39 | 39 | switch ( $case ) { |
Index: trunk/phase3/languages/classes/LanguageFr.php |
— | — | @@ -9,9 +9,9 @@ |
10 | 10 | * Use singular form for zero (see bug 7309) |
11 | 11 | */ |
12 | 12 | function convertPlural( $count, $forms ) { |
13 | | - if ( !count($forms) ) { return ''; } |
| 13 | + if ( !count( $forms ) ) { return ''; } |
14 | 14 | $forms = $this->preConvertPlural( $forms, 2 ); |
15 | 15 | |
16 | | - return ($count <= 1) ? $forms[0] : $forms[1]; |
| 16 | + return ( $count <= 1 ) ? $forms[0] : $forms[1]; |
17 | 17 | } |
18 | 18 | } |
Index: trunk/phase3/languages/classes/LanguageRo.php |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | function convertPlural( $count, $forms ) { |
9 | 9 | // Plural rules per |
10 | 10 | // http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#ro |
11 | | - if ( !count($forms) ) { return ''; } |
| 11 | + if ( !count( $forms ) ) { return ''; } |
12 | 12 | |
13 | 13 | $forms = $this->preConvertPlural( $forms, 3 ); |
14 | 14 | |
Index: trunk/phase3/languages/classes/LanguageZh.php |
— | — | @@ -1,25 +1,25 @@ |
2 | 2 | <?php |
3 | 3 | |
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' ); |
6 | 6 | |
7 | 7 | /** |
8 | 8 | * @ingroup Language |
9 | 9 | */ |
10 | 10 | class ZhConverter extends LanguageConverter { |
11 | 11 | |
12 | | - function __construct($langobj, $maincode, |
13 | | - $variants=array(), |
14 | | - $variantfallbacks=array(), |
| 12 | + function __construct( $langobj, $maincode, |
| 13 | + $variants = array(), |
| 14 | + $variantfallbacks = array(), |
15 | 15 | $flags = array(), |
16 | 16 | $manualLevel = array() ) { |
17 | 17 | $this->mDescCodeSep = ':'; |
18 | 18 | $this->mDescVarSep = ';'; |
19 | | - parent::__construct($langobj, $maincode, |
| 19 | + parent::__construct( $langobj, $maincode, |
20 | 20 | $variants, |
21 | 21 | $variantfallbacks, |
22 | 22 | $flags, |
23 | | - $manualLevel); |
| 23 | + $manualLevel ); |
24 | 24 | $names = array( |
25 | 25 | 'zh' => '原文', |
26 | 26 | 'zh-hans' => '简体', |
— | — | @@ -31,20 +31,20 @@ |
32 | 32 | 'zh-sg' => '新加坡', |
33 | 33 | 'zh-my' => '大马', |
34 | 34 | ); |
35 | | - $this->mVariantNames = array_merge($this->mVariantNames,$names); |
| 35 | + $this->mVariantNames = array_merge( $this->mVariantNames, $names ); |
36 | 36 | } |
37 | 37 | |
38 | 38 | function loadDefaultTables() { |
39 | | - require( dirname(__FILE__)."/../../includes/ZhConversion.php" ); |
| 39 | + require( dirname( __FILE__ ) . "/../../includes/ZhConversion.php" ); |
40 | 40 | $this->mTables = array( |
41 | 41 | 'zh-hans' => new ReplacementArray( $zh2Hans ), |
42 | 42 | '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 ) ), |
49 | 49 | 'zh' => new ReplacementArray |
50 | 50 | ); |
51 | 51 | } |
— | — | @@ -62,7 +62,7 @@ |
63 | 63 | to mark anything. |
64 | 64 | $noParse is there for compatibility with LanguageConvert::markNoConversion |
65 | 65 | */ |
66 | | - function markNoConversion($text, $noParse = false) { |
| 66 | + function markNoConversion( $text, $noParse = false ) { |
67 | 67 | return $text; |
68 | 68 | } |
69 | 69 | |
— | — | @@ -83,20 +83,20 @@ |
84 | 84 | global $wgHooks; |
85 | 85 | parent::__construct(); |
86 | 86 | |
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 | + |
89 | 89 | $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' ), |
99 | 99 | ); |
100 | | - $ml=array( |
| 100 | + $ml = array( |
101 | 101 | 'zh' => 'disable', |
102 | 102 | 'zh-hans' => 'unidirectional', |
103 | 103 | 'zh-hant' => 'unidirectional', |
— | — | @@ -105,7 +105,7 @@ |
106 | 106 | $this->mConverter = new ZhConverter( $this, 'zh', |
107 | 107 | $variants, $variantfallbacks, |
108 | 108 | array(), |
109 | | - $ml); |
| 109 | + $ml ); |
110 | 110 | |
111 | 111 | $wgHooks['ArticleSaveComplete'][] = $this->mConverter; |
112 | 112 | } |
— | — | @@ -114,13 +114,13 @@ |
115 | 115 | function segmentForDiff( $text ) { |
116 | 116 | return preg_replace( |
117 | 117 | "/([\\xc0-\\xff][\\x80-\\xbf]*)/e", |
118 | | - "' ' .\"$1\"", $text); |
| 118 | + "' ' .\"$1\"", $text ); |
119 | 119 | } |
120 | 120 | |
121 | 121 | function unsegmentForDiff( $text ) { |
122 | 122 | return preg_replace( |
123 | 123 | "/ ([\\xc0-\\xff][\\x80-\\xbf]*)/e", |
124 | | - "\"$1\"", $text); |
| 124 | + "\"$1\"", $text ); |
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
— | — | @@ -149,7 +149,7 @@ |
150 | 150 | $terms = implode( '|', $termsArray ); |
151 | 151 | $terms = self::convertDoubleWidth( $terms ); |
152 | 152 | $terms = implode( '|', $this->mConverter->autoConvertToAllVariants( $terms ) ); |
153 | | - $ret = array_unique( explode('|', $terms) ); |
| 153 | + $ret = array_unique( explode( '|', $terms ) ); |
154 | 154 | return $ret; |
155 | 155 | } |
156 | 156 | } |
Index: trunk/phase3/languages/classes/LanguageRu.php |
— | — | @@ -11,45 +11,45 @@ |
12 | 12 | # Invoked with {{grammar:case|word}} |
13 | 13 | function convertGrammar( $word, $case ) { |
14 | 14 | global $wgGrammarForms; |
15 | | - if ( isset($wgGrammarForms['ru'][$case][$word]) ) { |
| 15 | + if ( isset( $wgGrammarForms['ru'][$case][$word] ) ) { |
16 | 16 | return $wgGrammarForms['ru'][$case][$word]; |
17 | 17 | } |
18 | 18 | |
19 | 19 | # These rules are not perfect, but they are currently only used for site names so it doesn't |
20 | 20 | # matter if they are wrong sometimes. Just add a special case for your site name if necessary. |
21 | 21 | |
22 | | - #join and array_slice instead mb_substr |
| 22 | + # join and array_slice instead mb_substr |
23 | 23 | $ar = array(); |
24 | 24 | preg_match_all( '/./us', $word, $ar ); |
25 | | - if (!preg_match("/[a-zA-Z_]/us", $word)) |
| 25 | + if ( !preg_match( "/[a-zA-Z_]/us", $word ) ) |
26 | 26 | 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 ) ) . 'ника'; |
42 | 42 | break; |
43 | | - case 'dative': #дательный падеж |
44 | | - #stub |
| 43 | + case 'dative': # дательный падеж |
| 44 | + # stub |
45 | 45 | break; |
46 | | - case 'accusative': #винительный падеж |
47 | | - #stub |
| 46 | + case 'accusative': # винительный падеж |
| 47 | + # stub |
48 | 48 | break; |
49 | | - case 'instrumental': #творительный падеж |
50 | | - #stub |
| 49 | + case 'instrumental': # творительный падеж |
| 50 | + # stub |
51 | 51 | break; |
52 | | - case 'prepositional': #предложный падеж |
53 | | - #stub |
| 52 | + case 'prepositional': # предложный падеж |
| 53 | + # stub |
54 | 54 | break; |
55 | 55 | } |
56 | 56 | return $word; |
— | — | @@ -71,19 +71,19 @@ |
72 | 72 | */ |
73 | 73 | |
74 | 74 | function convertPlural( $count, $forms ) { |
75 | | - if ( !count($forms) ) { return ''; } |
| 75 | + if ( !count( $forms ) ) { return ''; } |
76 | 76 | |
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]; |
79 | 79 | |
80 | 80 | // FIXME: CLDR defines 4 plural forms. Form with decimals missing. |
81 | 81 | // See http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#ru |
82 | 82 | $forms = $this->preConvertPlural( $forms, 3 ); |
83 | 83 | |
84 | | - if ($count > 10 && floor(($count % 100) / 10) == 1) { |
| 84 | + if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) { |
85 | 85 | return $forms[2]; |
86 | 86 | } else { |
87 | | - switch ($count % 10) { |
| 87 | + switch ( $count % 10 ) { |
88 | 88 | case 1: return $forms[0]; |
89 | 89 | case 2: |
90 | 90 | case 3: |
— | — | @@ -98,11 +98,11 @@ |
99 | 99 | * See manual of style at http://ru.wikipedia.org/wiki/Википедия:Оформление_статей |
100 | 100 | * So "1 234 567", "12 345" but "1234" |
101 | 101 | */ |
102 | | - function commafy($_) { |
103 | | - if (preg_match('/^-?\d{1,4}(\.\d*)?$/',$_)) { |
| 102 | + function commafy( $_ ) { |
| 103 | + if ( preg_match( '/^-?\d{1,4}(\.\d*)?$/', $_ ) ) { |
104 | 104 | return $_; |
105 | 105 | } 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( $_ ) ) ); |
107 | 107 | } |
108 | 108 | } |
109 | 109 | } |
Index: trunk/phase3/languages/classes/LanguageGa.php |
— | — | @@ -9,13 +9,13 @@ |
10 | 10 | # Invoked with {{GRAMMAR:transformation|word}} |
11 | 11 | function convertGrammar( $word, $case ) { |
12 | 12 | global $wgGrammarForms; |
13 | | - if ( isset($wgGrammarForms['ga'][$case][$word]) ) { |
| 13 | + if ( isset( $wgGrammarForms['ga'][$case][$word] ) ) { |
14 | 14 | return $wgGrammarForms['ga'][$case][$word]; |
15 | 15 | } |
16 | 16 | |
17 | 17 | switch ( $case ) { |
18 | 18 | case 'ainmlae': |
19 | | - switch ($word) { |
| 19 | + switch ( $word ) { |
20 | 20 | case 'an Domhnach': |
21 | 21 | $word = 'Dé Domhnaigh'; break; |
22 | 22 | case 'an Luan': |
— | — | @@ -36,14 +36,14 @@ |
37 | 37 | } |
38 | 38 | |
39 | 39 | function convertPlural( $count, $forms ) { |
40 | | - if ( !count($forms) ) { return ''; } |
| 40 | + if ( !count( $forms ) ) { return ''; } |
41 | 41 | |
42 | 42 | // plural forms per http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#ga |
43 | 43 | $forms = $this->preConvertPlural( $forms, 3 ); |
44 | 44 | |
45 | 45 | if ( $count == 1 ) { |
46 | 46 | $index = 0; |
47 | | - } elseif( $count == 2 ) { |
| 47 | + } elseif ( $count == 2 ) { |
48 | 48 | $index = 1; |
49 | 49 | } else { |
50 | 50 | $index = 2; |
Index: trunk/phase3/languages/classes/LanguageGd.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | * |
20 | 20 | */ |
21 | 21 | function convertPlural( $count, $forms ) { |
22 | | - if ( !count($forms) ) { return ''; } |
| 22 | + if ( !count( $forms ) ) { return ''; } |
23 | 23 | $forms = $this->preConvertPlural( $forms, 4 ); |
24 | 24 | |
25 | 25 | $count = abs( $count ); |
Index: trunk/phase3/languages/classes/LanguageKk.php |
— | — | @@ -1,15 +1,15 @@ |
2 | 2 | <?php |
3 | 3 | |
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' ); |
6 | 6 | |
7 | 7 | define( 'KK_C_UC', 'АӘБВГҒДЕЁЖЗИЙКҚЛМНҢОӨПРСТУҰҮФХҺЦЧШЩЪЫІЬЭЮЯ' ); # Kazakh Cyrillic uppercase |
8 | 8 | define( 'KK_C_LC', 'аәбвгғдеёжзийкқлмнңоөпрстуұүфхһцчшщъыіьэюя' ); # Kazakh Cyrillic lowercase |
9 | 9 | define( 'KK_L_UC', 'AÄBCÇDEÉFGĞHIİÏJKLMNÑOÖPQRSŞTUÜVWXYÝZ' ); # Kazakh Latin uppercase |
10 | 10 | 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 |
12 | 12 | 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 |
14 | 14 | |
15 | 15 | /** Kazakh (Қазақша) |
16 | 16 | * converter routines |
— | — | @@ -18,10 +18,10 @@ |
19 | 19 | */ |
20 | 20 | class KkConverter extends LanguageConverter { |
21 | 21 | |
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() ) { |
26 | 26 | parent::__construct( $langobj, $maincode, |
27 | 27 | $variants, $variantfallbacks, $flags ); |
28 | 28 | |
— | — | @@ -46,9 +46,9 @@ |
47 | 47 | 'kk-cyrl' => new ReplacementArray( $kk2Cyrl ), |
48 | 48 | 'kk-latn' => new ReplacementArray( $kk2Latn ), |
49 | 49 | '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 ) ), |
53 | 53 | 'kk' => new ReplacementArray() |
54 | 54 | ); |
55 | 55 | } |
— | — | @@ -62,24 +62,24 @@ |
63 | 63 | function loadRegs() { |
64 | 64 | |
65 | 65 | $this->mCyrl2Latn = array( |
66 | | - ## Punctuation |
| 66 | + # # Punctuation |
67 | 67 | '/№/u' => 'No.', |
68 | | - ## Е after vowels |
| 68 | + # # Е after vowels |
69 | 69 | '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])Е/u' => '$1YE', |
70 | 70 | '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])е/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 ЁЮЯ |
77 | 77 | '/Ё/u' => 'YO', '/ё/u' => 'yo', |
78 | 78 | '/Ю/u' => 'YU', '/ю/u' => 'yu', |
79 | 79 | '/Я/u' => 'YA', '/я/u' => 'ya', |
80 | 80 | '/Щ/u' => 'ŞÇ', '/щ/u' => 'şç', |
81 | | - ## soft and hard signs |
| 81 | + # # soft and hard signs |
82 | 82 | '/[ъЪ]/u' => 'ʺ', '/[ьЬ]/u' => 'ʹ', |
83 | | - ## other characters |
| 83 | + # # other characters |
84 | 84 | '/А/u' => 'A', '/а/u' => 'a', '/Ә/u' => 'Ä', '/ә/u' => 'ä', |
85 | 85 | '/Б/u' => 'B', '/б/u' => 'b', '/В/u' => 'V', '/в/u' => 'v', |
86 | 86 | '/Г/u' => 'G', '/г/u' => 'g', '/Ғ/u' => 'Ğ', '/ғ/u' => 'ğ', |
— | — | @@ -101,24 +101,24 @@ |
102 | 102 | ); |
103 | 103 | |
104 | 104 | $this->mLatn2Cyrl = array( |
105 | | - ## Punctuation |
| 105 | + # # Punctuation |
106 | 106 | '/#|No\./' => '№', |
107 | | - ## Şç |
108 | | - '/ŞÇʹ/u'=> 'ЩЬ', '/Şçʹ/u'=> 'Щь', '/Şçʹ/u'=> 'Щь', |
| 107 | + # # Şç |
| 108 | + '/ŞÇʹ/u' => 'ЩЬ', '/Şçʹ/u' => 'Щь', '/Şçʹ/u' => 'Щь', |
109 | 109 | '/Ş[Çç]/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', |
115 | 115 | '/ʺ/u' => 'ъ', |
116 | 116 | '/ʹ/u' => 'ь', |
117 | | - ## Ye Yo Yu Ya. |
| 117 | + # # Ye Yo Yu Ya. |
118 | 118 | '/Y[Ee]/u' => 'Е', '/ye/u' => 'е', |
119 | 119 | '/Y[Oo]/u' => 'Ё', '/yo/u' => 'ё', |
120 | 120 | '/Y[UWuw]/u' => 'Ю', '/y[uw]/u' => 'ю', |
121 | 121 | '/Y[Aa]/u' => 'Я', '/ya/u' => 'я', |
122 | | - ## other characters |
| 122 | + # # other characters |
123 | 123 | '/A/u' => 'А', '/a/u' => 'а', '/Ä/u' => 'Ә', '/ä/u' => 'ә', |
124 | 124 | '/B/u' => 'Б', '/b/u' => 'б', '/C/u' => 'Ц', '/c/u' => 'ц', |
125 | 125 | '/Ç/u' => 'Ч', '/ç/u' => 'ч', '/D/u' => 'Д', '/d/u' => 'д', |
— | — | @@ -140,14 +140,14 @@ |
141 | 141 | ); |
142 | 142 | |
143 | 143 | $this->mCyLa2Arab = array( |
144 | | - ## Punctuation -> Arabic |
| 144 | + # # Punctuation -> Arabic |
145 | 145 | '/#|№|No\./u' => '', # ؀ |
146 | 146 | '/\,/' => '،', # ، |
147 | 147 | '/;/' => '؛', # ؛ |
148 | 148 | '/\?/' => '؟', # ؟ |
149 | 149 | '/%/' => '٪', # ٪ |
150 | 150 | '/\*/' => '٭', # ٭ |
151 | | - ## Digits -> Arabic |
| 151 | + # # Digits -> Arabic |
152 | 152 | '/0/' => '۰', # ۰ |
153 | 153 | '/1/' => '۱', # ۱ |
154 | 154 | '/2/' => '۲', # ۲ |
— | — | @@ -158,7 +158,7 @@ |
159 | 159 | '/7/' => '۷', # ۷ |
160 | 160 | '/8/' => '۸', # ۸ |
161 | 161 | '/9/' => '۹', # ۹ |
162 | | - ## Cyrillic -> Arabic |
| 162 | + # # Cyrillic -> Arabic |
163 | 163 | '/Аллаһ/ui' => 'ﷲ', |
164 | 164 | '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])е/ui' => '$1يە', |
165 | 165 | '/[еэ]/ui' => 'ە', '/[ъь]/ui' => '', |
— | — | @@ -166,14 +166,14 @@ |
167 | 167 | '/[и]/ui' => 'ىي', '/ё/ui' => 'يو', '/ю/ui' => 'يۋ', '/я/ui' => 'يا', '/[й]/ui' => 'ي', |
168 | 168 | '/ц/ui' => 'تس', '/щ/ui' => 'شش', |
169 | 169 | '/һ/ui' => 'ح', '/ч/ui' => 'تش', |
170 | | - #'/һ/ui' => 'ھ', '/ч/ui' => 'چ', |
| 170 | + # '/һ/ui' => 'ھ', '/ч/ui' => 'چ', |
171 | 171 | '/б/ui' => 'ب', '/в/ui' => 'ۆ', '/г/ui' => 'گ', '/ғ/ui' => 'ع', |
172 | 172 | '/д/ui' => 'د', '/ж/ui' => 'ج', '/з/ui' => 'ز', '/к/ui' => 'ك', |
173 | 173 | '/қ/ui' => 'ق', '/л/ui' => 'ل', '/м/ui' => 'م', '/н/ui' => 'ن', |
174 | 174 | '/ң/ui' => 'ڭ', '/п/ui' => 'پ', '/р/ui' => 'ر', '/с/ui' => 'س', |
175 | 175 | '/т/ui' => 'ت', '/у/ui' => 'ۋ', '/ф/ui' => 'ف', '/х/ui' => 'ح', |
176 | 176 | '/ш/ui' => 'ش', |
177 | | - ## Latin -> Arabic // commented for now... |
| 177 | + # # Latin -> Arabic // commented for now... |
178 | 178 | /*'/Allah/ui' => 'ﷲ', |
179 | 179 | '/[eé]/ui' => 'ە', '/[yý]/ui' => 'ي', '/[ʺʹ]/ui' => '', |
180 | 180 | '/[aä]/ui' => 'ا', '/[oö]/ui' => 'و', '/[uü]/ui' => 'ۇ', |
— | — | @@ -195,13 +195,13 @@ |
196 | 196 | update: delete all rule parsing because it's not used |
197 | 197 | currently, and just produces a couple of bugs |
198 | 198 | */ |
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 ); |
202 | 202 | } |
203 | 203 | |
204 | 204 | // otherwise ignore all formatting |
205 | | - foreach($this->mVariants as $v) { |
| 205 | + foreach ( $this->mVariants as $v ) { |
206 | 206 | $carray[$v] = $rule; |
207 | 207 | } |
208 | 208 | |
— | — | @@ -216,35 +216,35 @@ |
217 | 217 | */ |
218 | 218 | function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) { |
219 | 219 | // check for user namespace |
220 | | - if(is_object($nt)){ |
| 220 | + if ( is_object( $nt ) ) { |
221 | 221 | $ns = $nt->getNamespace(); |
222 | | - if($ns==NS_USER || $ns==NS_USER_TALK) |
| 222 | + if ( $ns == NS_USER || $ns == NS_USER_TALK ) |
223 | 223 | return; |
224 | 224 | } |
225 | 225 | |
226 | | - $oldlink=$link; |
| 226 | + $oldlink = $link; |
227 | 227 | parent::findVariantLink( $link, $nt, $ignoreOtherCond ); |
228 | | - if( $this->getPreferredVariant()==$this->mMainLanguageCode ) |
229 | | - $link=$oldlink; |
| 228 | + if ( $this->getPreferredVariant() == $this->mMainLanguageCode ) |
| 229 | + $link = $oldlink; |
230 | 230 | } |
231 | 231 | |
232 | 232 | /* |
233 | 233 | * An ugly function wrapper for parsing Image titles |
234 | 234 | * (to prevent image name conversion) |
235 | 235 | */ |
236 | | - function autoConvert($text, $toVariant=false) { |
| 236 | + function autoConvert( $text, $toVariant = false ) { |
237 | 237 | global $wgTitle; |
238 | | - if(is_object($wgTitle) && $wgTitle->getNameSpace()==NS_FILE){ |
| 238 | + if ( is_object( $wgTitle ) && $wgTitle->getNameSpace() == NS_FILE ) { |
239 | 239 | $imagename = $wgTitle->getNsText(); |
240 | | - if(preg_match("/^$imagename:/",$text)) return $text; |
| 240 | + if ( preg_match( "/^$imagename:/", $text ) ) return $text; |
241 | 241 | } |
242 | | - return parent::autoConvert($text,$toVariant); |
| 242 | + return parent::autoConvert( $text, $toVariant ); |
243 | 243 | } |
244 | 244 | |
245 | 245 | /** |
246 | 246 | * It translates text into variant |
247 | 247 | */ |
248 | | - function translate( $text, $toVariant ){ |
| 248 | + function translate( $text, $toVariant ) { |
249 | 249 | global $wgContLanguageCode; |
250 | 250 | $text = parent::translate( $text, $toVariant ); |
251 | 251 | |
— | — | @@ -262,7 +262,7 @@ |
263 | 263 | break; |
264 | 264 | case 'kk-arab': |
265 | 265 | 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'; |
267 | 267 | $wgContLanguageCode = 'kk-Arab'; |
268 | 268 | break; |
269 | 269 | default: |
— | — | @@ -272,60 +272,60 @@ |
273 | 273 | // disable conversion variables like $1, $2... |
274 | 274 | $varsfix = '\$[0-9]'; |
275 | 275 | |
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 ); |
277 | 277 | $mstart = 0; |
278 | 278 | $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 ); |
281 | 281 | $ret .= $this->regsConverter( $m[0], $toVariant ); |
282 | | - $mstart = $m[1] + strlen($m[0]); |
| 282 | + $mstart = $m[1] + strlen( $m[0] ); |
283 | 283 | } |
284 | 284 | return $ret; |
285 | 285 | } |
286 | 286 | |
287 | 287 | function regsConverter( $text, $toVariant ) { |
288 | | - if ($text == '') return $text; |
| 288 | + if ( $text == '' ) return $text; |
289 | 289 | |
290 | 290 | $pat = array(); |
291 | 291 | $rep = array(); |
292 | 292 | switch( $toVariant ) { |
293 | 293 | case 'kk-arab': |
294 | 294 | 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*/; |
296 | 296 | $front = 'әөүіӘӨҮІ'/*.'äöüiÄÖÜİ'*/; |
297 | 297 | $excludes = 'еэгғкқЕЭГҒКҚ'/*.'eégğkqEÉGĞKQ'*/; |
298 | 298 | // 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 ); |
300 | 300 | $mstart = 0; |
301 | 301 | $ret = ''; |
302 | | - foreach( $matches as $m ) { |
| 302 | + foreach ( $matches as $m ) { |
303 | 303 | $ret .= substr( $text, $mstart, $m[1] - $mstart ); |
304 | 304 | // is matched the word to front vowels? |
305 | 305 | // exclude a words matched to е, э, г, к, к, қ, |
306 | 306 | // 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] ); |
309 | 309 | } else { |
310 | 310 | $ret .= $m[0]; |
311 | 311 | } |
312 | | - $mstart = $m[1] + strlen($m[0]); |
| 312 | + $mstart = $m[1] + strlen( $m[0] ); |
313 | 313 | } |
314 | 314 | $text =& $ret; |
315 | | - foreach( $this->mCyLa2Arab as $pat => $rep ) { |
| 315 | + foreach ( $this->mCyLa2Arab as $pat => $rep ) { |
316 | 316 | $text = preg_replace( $pat, $rep, $text ); |
317 | 317 | } |
318 | 318 | return $text; |
319 | 319 | break; |
320 | 320 | case 'kk-latn': |
321 | 321 | case 'kk-tr': |
322 | | - foreach( $this->mCyrl2Latn as $pat => $rep ) { |
| 322 | + foreach ( $this->mCyrl2Latn as $pat => $rep ) { |
323 | 323 | $text = preg_replace( $pat, $rep, $text ); |
324 | 324 | } |
325 | 325 | return $text; |
326 | 326 | break; |
327 | 327 | case 'kk-cyrl': |
328 | 328 | case 'kk-kz': |
329 | | - foreach( $this->mLatn2Cyrl as $pat => $rep ) { |
| 329 | + foreach ( $this->mLatn2Cyrl as $pat => $rep ) { |
330 | 330 | $text = preg_replace( $pat, $rep, $text ); |
331 | 331 | } |
332 | 332 | return $text; |
— | — | @@ -339,8 +339,8 @@ |
340 | 340 | * We want our external link captions to be converted in variants, |
341 | 341 | * so we return the original text instead -{$text}-, except for URLs |
342 | 342 | */ |
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 ) ) |
345 | 345 | return parent::markNoConversion( $text ); |
346 | 346 | return $text; |
347 | 347 | } |
— | — | @@ -399,7 +399,7 @@ |
400 | 400 | */ |
401 | 401 | function ucfirst ( $string ) { |
402 | 402 | $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' ) { |
404 | 404 | $string = 'İ' . substr( $string, 1 ); |
405 | 405 | } else { |
406 | 406 | $string = parent::ucfirst( $string ); |
— | — | @@ -413,7 +413,7 @@ |
414 | 414 | */ |
415 | 415 | function lcfirst ( $string ) { |
416 | 416 | $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' ) { |
418 | 418 | $string = 'ı' . substr( $string, 1 ); |
419 | 419 | } else { |
420 | 420 | $string = parent::lcfirst( $string ); |
Index: trunk/phase3/languages/classes/LanguageCs.php |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | # {{plural:count|form1|form0,2+}} for single form plurals |
14 | 14 | # in a message |
15 | 15 | function convertPlural( $count, $forms ) { |
16 | | - if ( !count($forms) ) { return ''; } |
| 16 | + if ( !count( $forms ) ) { return ''; } |
17 | 17 | $forms = $this->preConvertPlural( $forms, 3 ); |
18 | 18 | |
19 | 19 | switch ( $count ) { |
Index: trunk/phase3/languages/classes/LanguageWa.php |
— | — | @@ -13,17 +13,17 @@ |
14 | 14 | * Use singular form for zero |
15 | 15 | */ |
16 | 16 | function convertPlural( $count, $forms ) { |
17 | | - if ( !count($forms) ) { return ''; } |
| 17 | + if ( !count( $forms ) ) { return ''; } |
18 | 18 | $forms = $this->preConvertPlural( $forms, 2 ); |
19 | 19 | |
20 | | - return ($count <= 1) ? $forms[0] : $forms[1]; |
| 20 | + return ( $count <= 1 ) ? $forms[0] : $forms[1]; |
21 | 21 | } |
22 | 22 | |
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 | + ## # |
28 | 28 | function date( $ts, $adj = false, $format = true, $tc = false ) { |
29 | 29 | if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); } |
30 | 30 | $datePreference = $this->dateFormat( $format ); |
— | — | @@ -32,13 +32,13 @@ |
33 | 33 | # |
34 | 34 | # we also output this format for YMD (eg: 2001 January 15) |
35 | 35 | 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 ); |
37 | 37 | return $d; |
38 | 38 | } |
39 | 39 | |
40 | 40 | # dd/mm/YYYY format |
41 | 41 | 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 ); |
43 | 43 | return $d; |
44 | 44 | } |
45 | 45 | |
— | — | @@ -47,17 +47,17 @@ |
48 | 48 | # we output this in all other cases |
49 | 49 | $m = substr( $ts, 4, 2 ); |
50 | 50 | $n = substr( $ts, 6, 2 ); |
51 | | - if ($n == 1) { |
| 51 | + if ( $n == 1 ) { |
52 | 52 | $d = "1î d' " . $this->getMonthName( $m ) . |
53 | 53 | " " . 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 ) . |
56 | 56 | " " . 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 ) . |
59 | 59 | " " . substr( $ts, 0, 4 ); |
60 | 60 | } else { |
61 | | - $d = (0 + $n) . " di " . $this->getMonthName( $m ) . |
| 61 | + $d = ( 0 + $n ) . " di " . $this->getMonthName( $m ) . |
62 | 62 | " " . substr( $ts, 0, 4 ); |
63 | 63 | } |
64 | 64 | return $d; |
Index: trunk/phase3/languages/classes/LanguageCu.php |
— | — | @@ -9,36 +9,36 @@ |
10 | 10 | # Invoked with {{grammar:case|word}} |
11 | 11 | function convertGrammar( $word, $case ) { |
12 | 12 | global $wgGrammarForms; |
13 | | - if ( isset($wgGrammarForms['сu'][$case][$word]) ) { |
| 13 | + if ( isset( $wgGrammarForms['сu'][$case][$word] ) ) { |
14 | 14 | return $wgGrammarForms['сu'][$case][$word]; |
15 | 15 | } |
16 | 16 | |
17 | 17 | # These rules are not perfect, but they are currently only used for site names so it doesn't |
18 | 18 | # matter if they are wrong sometimes. Just add a special case for your site name if necessary. |
19 | 19 | |
20 | | - #join and array_slice instead mb_substr |
| 20 | + # join and array_slice instead mb_substr |
21 | 21 | $ar = array(); |
22 | 22 | preg_match_all( '/./us', $word, $ar ); |
23 | | - if (!preg_match("/[a-zA-Z_]/us", $word)) |
| 23 | + if ( !preg_match( "/[a-zA-Z_]/us", $word ) ) |
24 | 24 | 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 ) ) . 'їѩ'; |
30 | 30 | break; |
31 | | - case 'accusative': #винительный падеж |
32 | | - #stub |
| 31 | + case 'accusative': # винительный падеж |
| 32 | + # stub |
33 | 33 | break; |
34 | 34 | } |
35 | 35 | return $word; |
36 | 36 | } |
37 | 37 | |
38 | 38 | function convertPlural( $count, $forms ) { |
39 | | - if ( !count($forms) ) { return ''; } |
| 39 | + if ( !count( $forms ) ) { return ''; } |
40 | 40 | $forms = $this->preConvertPlural( $forms, 4 ); |
41 | 41 | |
42 | | - switch ($count % 10) { |
| 42 | + switch ( $count % 10 ) { |
43 | 43 | case 1: return $forms[0]; |
44 | 44 | case 2: return $forms[1]; |
45 | 45 | case 3: |
Index: trunk/phase3/languages/classes/LanguageKm.php |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | * @author Niklas Laxström |
8 | 8 | */ |
9 | 9 | class LanguageKm extends Language { |
10 | | - function commafy($_) { |
| 10 | + function commafy( $_ ) { |
11 | 11 | /* NO-op for Khmer. Cannot use |
12 | 12 | * $separatorTransformTable = array( ',' => '' ) |
13 | 13 | * That would break when parsing and doing strstr '' => 'foo'; |
Index: trunk/phase3/languages/classes/LanguageSe.php |
— | — | @@ -5,14 +5,14 @@ |
6 | 6 | */ |
7 | 7 | class LanguageSe extends Language { |
8 | 8 | function convertPlural( $count, $forms ) { |
9 | | - if ( !count($forms) ) { return ''; } |
| 9 | + if ( !count( $forms ) ) { return ''; } |
10 | 10 | |
11 | 11 | // plural forms per http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#se |
12 | 12 | $forms = $this->preConvertPlural( $forms, 3 ); |
13 | 13 | |
14 | 14 | if ( $count == 1 ) { |
15 | 15 | $index = 0; |
16 | | - } elseif( $count == 2 ) { |
| 16 | + } elseif ( $count == 2 ) { |
17 | 17 | $index = 1; |
18 | 18 | } else { |
19 | 19 | $index = 2; |
Index: trunk/phase3/languages/classes/LanguageKu.deps.php |
— | — | @@ -5,5 +5,5 @@ |
6 | 6 | // changed on a subsequent page view. |
7 | 7 | // see http://lists.wikimedia.org/pipermail/wikitech-l/2006-January/021311.html |
8 | 8 | |
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 @@ |
6 | 6 | */ |
7 | 7 | class LanguageSh extends Language { |
8 | 8 | function convertPlural( $count, $forms ) { |
9 | | - if ( !count($forms) ) { return ''; } |
| 9 | + if ( !count( $forms ) ) { return ''; } |
10 | 10 | |
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]; |
13 | 13 | |
14 | 14 | // FIXME: CLDR defines 4 plural forms. Form with decimals missing. |
15 | 15 | // See http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#sh |
16 | 16 | $forms = $this->preConvertPlural( $forms, 3 ); |
17 | 17 | |
18 | | - if ($count > 10 && floor(($count % 100) / 10) == 1) { |
| 18 | + if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) { |
19 | 19 | return $forms[2]; |
20 | 20 | } else { |
21 | | - switch ($count % 10) { |
| 21 | + switch ( $count % 10 ) { |
22 | 22 | case 1: return $forms[0]; |
23 | 23 | case 2: |
24 | 24 | case 3: |
Index: trunk/phase3/languages/classes/LanguageCy.php |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | */ |
9 | 9 | class LanguageCy extends Language { |
10 | 10 | function convertPlural( $count, $forms ) { |
11 | | - if ( !count($forms) ) { return ''; } |
| 11 | + if ( !count( $forms ) ) { return ''; } |
12 | 12 | |
13 | 13 | // FIXME: CLDR defines 4 plural forms; very different, actually. |
14 | 14 | // 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 @@ |
10 | 10 | class LanguageGv extends Language { |
11 | 11 | |
12 | 12 | function convertPlural( $count, $forms ) { |
13 | | - if ( !count($forms) ) { return ''; } |
| 13 | + if ( !count( $forms ) ) { return ''; } |
14 | 14 | |
15 | 15 | $forms = $this->preConvertPlural( $forms, 4 ); |
16 | 16 | |
17 | | - if ($count > 0 && ($count % 20) === 0 ) { |
| 17 | + if ( $count > 0 && ( $count % 20 ) === 0 ) { |
18 | 18 | return $forms[0]; |
19 | 19 | } else { |
20 | | - switch ($count % 10) { |
| 20 | + switch ( $count % 10 ) { |
21 | 21 | case 1: return $forms[1]; |
22 | 22 | case 2: return $forms[2]; |
23 | 23 | default: return $forms[3]; |
Index: trunk/phase3/languages/classes/LanguageSk.php |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | */ |
8 | 8 | class LanguageSk extends Language { |
9 | 9 | function convertPlural( $count, $forms ) { |
10 | | - if ( !count($forms) ) { return ''; } |
| 10 | + if ( !count( $forms ) ) { return ''; } |
11 | 11 | $forms = $this->preConvertPlural( $forms, 3 ); |
12 | 12 | |
13 | 13 | if ( $count == 1 ) { |
Index: trunk/phase3/languages/classes/LanguageKu_ku.php |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | function commafy( $_ ) { |
14 | 14 | |
15 | 15 | 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( $_ ) ) ); |
17 | 17 | } else { |
18 | 18 | return $_; |
19 | 19 | } |
Index: trunk/phase3/languages/classes/LanguageSl.php |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | */ |
14 | 14 | function convertGrammar( $word, $case ) { |
15 | 15 | global $wgGrammarForms; |
16 | | - if ( isset($wgGrammarForms['sl'][$case][$word]) ) { |
| 16 | + if ( isset( $wgGrammarForms['sl'][$case][$word] ) ) { |
17 | 17 | return $wgGrammarForms['sl'][$case][$word]; |
18 | 18 | } |
19 | 19 | |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | } |
29 | 29 | |
30 | 30 | function convertPlural( $count, $forms ) { |
31 | | - if ( !count($forms) ) { return ''; } |
| 31 | + if ( !count( $forms ) ) { return ''; } |
32 | 32 | $forms = $this->preConvertPlural( $forms, 5 ); |
33 | 33 | |
34 | 34 | if ( $count % 100 == 1 ) { |
Index: trunk/phase3/languages/classes/LanguageKu.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?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' ); |
5 | 5 | |
6 | 6 | /** Kurdish |
7 | 7 | * converter routines |
— | — | @@ -18,8 +18,8 @@ |
19 | 19 | // و ك=> ku -- ist auch richtig |
20 | 20 | |
21 | 21 | /* Doppel- und Halbvokale */ |
22 | | - 'ڵ' => 'll', #ll |
23 | | - 'ڕ' => 'rr', #rr |
| 22 | + 'ڵ' => 'll', # ll |
| 23 | + 'ڕ' => 'rr', # rr |
24 | 24 | 'ا' => 'a', |
25 | 25 | # 'ئێ' => 'ê', # initial e |
26 | 26 | 'ە' => 'e', |
— | — | @@ -69,7 +69,7 @@ |
70 | 70 | # 'rr' => 'ڕ', # selbiges für doppel-r |
71 | 71 | |
72 | 72 | /* Einzelne Großbuchstaben */ |
73 | | - //' C' => 'ج', |
| 73 | + // ' C' => 'ج', |
74 | 74 | |
75 | 75 | /* Vowels */ |
76 | 76 | 'a' => 'ا', |
— | — | @@ -140,25 +140,25 @@ |
141 | 141 | */ |
142 | 142 | function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) { |
143 | 143 | // check for user namespace |
144 | | - if(is_object($nt)){ |
| 144 | + if ( is_object( $nt ) ) { |
145 | 145 | $ns = $nt->getNamespace(); |
146 | | - if($ns==NS_USER || $ns==NS_USER_TALK) |
| 146 | + if ( $ns == NS_USER || $ns == NS_USER_TALK ) |
147 | 147 | return; |
148 | 148 | } |
149 | 149 | |
150 | | - $oldlink=$link; |
| 150 | + $oldlink = $link; |
151 | 151 | parent::findVariantLink( $link, $nt, $ignoreOtherCond ); |
152 | | - if( $this->getPreferredVariant() == $this->mMainLanguageCode ) |
153 | | - $link=$oldlink; |
| 152 | + if ( $this->getPreferredVariant() == $this->mMainLanguageCode ) |
| 153 | + $link = $oldlink; |
154 | 154 | } |
155 | 155 | |
156 | 156 | /* |
157 | 157 | * We want our external link captions to be converted in variants, |
158 | 158 | * so we return the original text instead -{$text}-, except for URLs |
159 | 159 | */ |
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 ); |
163 | 163 | return $text; |
164 | 164 | } |
165 | 165 | |
— | — | @@ -166,20 +166,20 @@ |
167 | 167 | * An ugly function wrapper for parsing Image titles |
168 | 168 | * (to prevent image name conversion) |
169 | 169 | */ |
170 | | - function autoConvert($text, $toVariant=false) { |
| 170 | + function autoConvert( $text, $toVariant = false ) { |
171 | 171 | global $wgTitle; |
172 | | - if(is_object($wgTitle) && $wgTitle->getNameSpace()==NS_FILE){ |
| 172 | + if ( is_object( $wgTitle ) && $wgTitle->getNameSpace() == NS_FILE ) { |
173 | 173 | $imagename = $wgTitle->getNsText(); |
174 | | - if(preg_match("/^$imagename:/",$text)) return $text; |
| 174 | + if ( preg_match( "/^$imagename:/", $text ) ) return $text; |
175 | 175 | } |
176 | | - return parent::autoConvert($text,$toVariant); |
| 176 | + return parent::autoConvert( $text, $toVariant ); |
177 | 177 | } |
178 | 178 | |
179 | 179 | /** |
180 | 180 | * It translates text into variant, specials: |
181 | 181 | * - ommiting roman numbers |
182 | 182 | */ |
183 | | - function translate($text, $toVariant){ |
| 183 | + function translate( $text, $toVariant ) { |
184 | 184 | $breaks = '[^\w\x80-\xff]'; |
185 | 185 | |
186 | 186 | /* From Kazakh interface, maybe we need it later |
— | — | @@ -207,7 +207,7 @@ |
208 | 208 | return $ret; |
209 | 209 | */ |
210 | 210 | |
211 | | - if( !isset( $this->mTables[$toVariant] ) ) { |
| 211 | + if ( !isset( $this->mTables[$toVariant] ) ) { |
212 | 212 | throw new MWException( "Broken variant table: " . implode( ',', array_keys( $this->mTables ) ) ); |
213 | 213 | } |
214 | 214 | |
Index: trunk/phase3/languages/classes/LanguageSr.php |
— | — | @@ -1,8 +1,8 @@ |
2 | 2 | <?php |
3 | 3 | |
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' ); |
7 | 7 | |
8 | 8 | /** |
9 | 9 | * There are two levels of conversion for Serbian: the script level |
— | — | @@ -45,15 +45,15 @@ |
46 | 46 | 'O' => 'О', 'P' => 'П', 'R' => 'Р', 'S' => 'С', 'Š' => 'Ш', |
47 | 47 | 'T' => 'Т', 'U' => 'У', 'V' => 'В', 'Z' => 'З', 'Ž' => 'Ж', |
48 | 48 | |
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' => 'НЈ' |
52 | 52 | ); |
53 | 53 | |
54 | 54 | function loadDefaultTables() { |
55 | 55 | $this->mTables = array( |
56 | 56 | 'sr-ec' => new ReplacementArray( $this->mToCyrillics ), |
57 | | - 'sr-el' => new ReplacementArray( $this->mToLatin), |
| 57 | + 'sr-el' => new ReplacementArray( $this->mToLatin ), |
58 | 58 | 'sr' => new ReplacementArray() |
59 | 59 | ); |
60 | 60 | } |
— | — | @@ -63,13 +63,13 @@ |
64 | 64 | update: delete all rule parsing because it's not used |
65 | 65 | currently, and just produces a couple of bugs |
66 | 66 | */ |
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 ); |
70 | 70 | } |
71 | 71 | |
72 | 72 | // otherwise ignore all formatting |
73 | | - foreach($this->mVariants as $v) { |
| 73 | + foreach ( $this->mVariants as $v ) { |
74 | 74 | $carray[$v] = $rule; |
75 | 75 | } |
76 | 76 | |
— | — | @@ -84,25 +84,25 @@ |
85 | 85 | */ |
86 | 86 | function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) { |
87 | 87 | // check for user namespace |
88 | | - if(is_object($nt)){ |
| 88 | + if ( is_object( $nt ) ) { |
89 | 89 | $ns = $nt->getNamespace(); |
90 | | - if($ns==NS_USER || $ns==NS_USER_TALK) |
| 90 | + if ( $ns == NS_USER || $ns == NS_USER_TALK ) |
91 | 91 | return; |
92 | 92 | } |
93 | 93 | |
94 | | - $oldlink=$link; |
| 94 | + $oldlink = $link; |
95 | 95 | parent::findVariantLink( $link, $nt, $ignoreOtherCond ); |
96 | | - if($this->getPreferredVariant()==$this->mMainLanguageCode) |
97 | | - $link=$oldlink; |
| 96 | + if ( $this->getPreferredVariant() == $this->mMainLanguageCode ) |
| 97 | + $link = $oldlink; |
98 | 98 | } |
99 | 99 | |
100 | 100 | /* |
101 | 101 | * We want our external link captions to be converted in variants, |
102 | 102 | * so we return the original text instead -{$text}-, except for URLs |
103 | 103 | */ |
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 ); |
107 | 107 | return $text; |
108 | 108 | } |
109 | 109 | |
— | — | @@ -110,39 +110,39 @@ |
111 | 111 | * An ugly function wrapper for parsing Image titles |
112 | 112 | * (to prevent image name conversion) |
113 | 113 | */ |
114 | | - function autoConvert($text, $toVariant=false) { |
| 114 | + function autoConvert( $text, $toVariant = false ) { |
115 | 115 | global $wgTitle; |
116 | | - if(is_object($wgTitle) && $wgTitle->getNameSpace()==NS_FILE){ |
| 116 | + if ( is_object( $wgTitle ) && $wgTitle->getNameSpace() == NS_FILE ) { |
117 | 117 | $imagename = $wgTitle->getNsText(); |
118 | | - if(preg_match("/^$imagename:/",$text)) return $text; |
| 118 | + if ( preg_match( "/^$imagename:/", $text ) ) return $text; |
119 | 119 | } |
120 | | - return parent::autoConvert($text,$toVariant); |
| 120 | + return parent::autoConvert( $text, $toVariant ); |
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
124 | 124 | * It translates text into variant, specials: |
125 | 125 | * - ommiting roman numbers |
126 | 126 | */ |
127 | | - function translate($text, $toVariant){ |
| 127 | + function translate( $text, $toVariant ) { |
128 | 128 | $breaks = '[^\w\x80-\xff]'; |
129 | 129 | |
130 | 130 | // regexp for roman numbers |
131 | 131 | $roman = 'M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})'; |
132 | 132 | |
133 | | - $reg = '/^'.$roman.'$|^'.$roman.$breaks.'|'.$breaks.$roman.'$|'.$breaks.$roman.$breaks.'/'; |
| 133 | + $reg = '/^' . $roman . '$|^' . $roman . $breaks . '|' . $breaks . $roman . '$|' . $breaks . $roman . $breaks . '/'; |
134 | 134 | |
135 | | - $matches = preg_split($reg, $text, -1, PREG_SPLIT_OFFSET_CAPTURE); |
| 135 | + $matches = preg_split( $reg, $text, -1, PREG_SPLIT_OFFSET_CAPTURE ); |
136 | 136 | |
137 | | - $m = array_shift($matches); |
138 | | - if( !isset( $this->mTables[$toVariant] ) ) { |
| 137 | + $m = array_shift( $matches ); |
| 138 | + if ( !isset( $this->mTables[$toVariant] ) ) { |
139 | 139 | throw new MWException( "Broken variant table: " . implode( ',', array_keys( $this->mTables ) ) ); |
140 | 140 | } |
141 | 141 | $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] ); |
147 | 147 | } |
148 | 148 | |
149 | 149 | return $ret; |
— | — | @@ -158,7 +158,7 @@ |
159 | 159 | |
160 | 160 | parent::__construct(); |
161 | 161 | |
162 | | - $variants = array('sr', 'sr-ec', 'sr-el'); |
| 162 | + $variants = array( 'sr', 'sr-ec', 'sr-el' ); |
163 | 163 | $variantfallbacks = array( |
164 | 164 | 'sr' => 'sr-ec', |
165 | 165 | 'sr-ec' => 'sr', |
— | — | @@ -169,24 +169,24 @@ |
170 | 170 | 'S' => 'S', 'писмо' => 'S', 'pismo' => 'S', |
171 | 171 | 'W' => 'W', 'реч' => 'W', 'reč' => 'W', 'ријеч' => 'W', 'riječ' => 'W' |
172 | 172 | ); |
173 | | - $this->mConverter = new SrConverter($this, 'sr', $variants, $variantfallbacks, $flags); |
| 173 | + $this->mConverter = new SrConverter( $this, 'sr', $variants, $variantfallbacks, $flags ); |
174 | 174 | $wgHooks['ArticleSaveComplete'][] = $this->mConverter; |
175 | 175 | } |
176 | 176 | |
177 | 177 | function convertPlural( $count, $forms ) { |
178 | | - if ( !count($forms) ) { return ''; } |
| 178 | + if ( !count( $forms ) ) { return ''; } |
179 | 179 | |
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]; |
182 | 182 | |
183 | 183 | // FIXME: CLDR defines 4 plural forms. Form with decimals missing. |
184 | 184 | // See http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#ru |
185 | 185 | $forms = $this->preConvertPlural( $forms, 3 ); |
186 | 186 | |
187 | | - if ($count > 10 && floor(($count % 100) / 10) == 1) { |
| 187 | + if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) { |
188 | 188 | return $forms[2]; |
189 | 189 | } else { |
190 | | - switch ($count % 10) { |
| 190 | + switch ( $count % 10 ) { |
191 | 191 | case 1: return $forms[0]; |
192 | 192 | case 2: |
193 | 193 | case 3: |
Index: trunk/phase3/languages/classes/LanguageKsh.php |
— | — | @@ -22,7 +22,7 @@ |
23 | 23 | * Handle cases of (1, other, 0) or (1, other) |
24 | 24 | */ |
25 | 25 | function convertPlural( $count, $forms ) { |
26 | | - if ( !count($forms) ) { return ''; } |
| 26 | + if ( !count( $forms ) ) { return ''; } |
27 | 27 | $forms = $this->preConvertPlural( $forms, 3 ); |
28 | 28 | |
29 | 29 | if ( $count == 1 ) { |
Index: trunk/phase3/languages/classes/LanguageSr_ec.php |
— | — | @@ -5,13 +5,13 @@ |
6 | 6 | */ |
7 | 7 | class LanguageSr_ec extends Language { |
8 | 8 | function convertPlural( $count, $forms ) { |
9 | | - if ( !count($forms) ) { return ''; } |
| 9 | + if ( !count( $forms ) ) { return ''; } |
10 | 10 | $forms = $this->preConvertPlural( $forms, 3 ); |
11 | 11 | |
12 | | - if ($count > 10 && floor(($count % 100) / 10) == 1) { |
| 12 | + if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) { |
13 | 13 | return $forms[2]; |
14 | 14 | } else { |
15 | | - switch ($count % 10) { |
| 15 | + switch ( $count % 10 ) { |
16 | 16 | case 1: return $forms[0]; |
17 | 17 | case 2: |
18 | 18 | case 3: |
Index: trunk/phase3/languages/classes/LanguageBe_tarask.php |
— | — | @@ -19,19 +19,19 @@ |
20 | 20 | */ |
21 | 21 | |
22 | 22 | function convertPlural( $count, $forms ) { |
23 | | - if ( !count($forms) ) { return ''; } |
| 23 | + if ( !count( $forms ) ) { return ''; } |
24 | 24 | |
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]; |
27 | 27 | |
28 | 28 | // FIXME: CLDR defines 4 plural forms instead of 3 |
29 | 29 | // http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html |
30 | 30 | $forms = $this->preConvertPlural( $forms, 3 ); |
31 | 31 | |
32 | | - if ($count > 10 && floor(($count % 100) / 10) == 1) { |
| 32 | + if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) { |
33 | 33 | return $forms[2]; |
34 | 34 | } else { |
35 | | - switch ($count % 10) { |
| 35 | + switch ( $count % 10 ) { |
36 | 36 | case 1: return $forms[0]; |
37 | 37 | case 2: |
38 | 38 | case 3: |
— | — | @@ -40,9 +40,9 @@ |
41 | 41 | } |
42 | 42 | } |
43 | 43 | } |
44 | | - |
| 44 | + |
45 | 45 | /* |
46 | | - * The Belarusian language uses apostrophe sign, |
| 46 | + * The Belarusian language uses apostrophe sign, |
47 | 47 | * but the characters used for this could be both U+0027 and U+2019. |
48 | 48 | * This function unifies apostrophe sign in search index values |
49 | 49 | * to enable seach using both apostrophe signs. |
— | — | @@ -61,16 +61,16 @@ |
62 | 62 | wfProfileOut( __METHOD__ ); |
63 | 63 | return $s; |
64 | 64 | } |
65 | | - |
| 65 | + |
66 | 66 | /* |
67 | 67 | * Four-digit number should be without group commas (spaces) |
68 | 68 | * So "1 234 567", "12 345" but "1234" |
69 | 69 | */ |
70 | | - function commafy($_) { |
71 | | - if (preg_match('/^-?\d{1,4}(\.\d*)?$/',$_)) { |
| 70 | + function commafy( $_ ) { |
| 71 | + if ( preg_match( '/^-?\d{1,4}(\.\d*)?$/', $_ ) ) { |
72 | 72 | return $_; |
73 | 73 | } 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( $_ ) ) ); |
75 | 75 | } |
76 | 76 | } |
77 | 77 | } |
Index: trunk/phase3/languages/classes/LanguageLa.php |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | */ |
17 | 17 | function convertGrammar( $word, $case ) { |
18 | 18 | global $wgGrammarForms; |
19 | | - if ( isset($wgGrammarForms['la'][$case][$word]) ) { |
| 19 | + if ( isset( $wgGrammarForms['la'][$case][$word] ) ) { |
20 | 20 | return $wgGrammarForms['la'][$case][$word]; |
21 | 21 | } |
22 | 22 | |
Index: trunk/phase3/languages/classes/LanguageHe.php |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | */ |
22 | 22 | public function convertGrammar( $word, $case ) { |
23 | 23 | global $wgGrammarForms; |
24 | | - if ( isset($wgGrammarForms['he'][$case][$word]) ) { |
| 24 | + if ( isset( $wgGrammarForms['he'][$case][$word] ) ) { |
25 | 25 | return $wgGrammarForms['he'][$case][$word]; |
26 | 26 | } |
27 | 27 | |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | case 'תחילית': |
31 | 31 | # Duplicate the "Waw" if prefixed |
32 | 32 | if ( substr( $word, 0, 2 ) == "ו" && substr( $word, 0, 4 ) != "וו" ) { |
33 | | - $word = "ו".$word; |
| 33 | + $word = "ו" . $word; |
34 | 34 | } |
35 | 35 | |
36 | 36 | # Remove the "He" if prefixed |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | |
41 | 41 | # Add a hyphen if non-Hebrew letters |
42 | 42 | if ( substr( $word, 0, 2 ) < "א" || substr( $word, 0, 2 ) > "ת" ) { |
43 | | - $word = "־".$word; |
| 43 | + $word = "־" . $word; |
44 | 44 | } |
45 | 45 | } |
46 | 46 | |
— | — | @@ -54,12 +54,12 @@ |
55 | 55 | * @return String: the suited form of word |
56 | 56 | */ |
57 | 57 | function convertPlural( $count, $forms ) { |
58 | | - if ( !count($forms) ) { return ''; } |
| 58 | + if ( !count( $forms ) ) { return ''; } |
59 | 59 | $forms = $this->preConvertPlural( $forms, 3 ); |
60 | 60 | |
61 | 61 | if ( $count == '1' ) { |
62 | 62 | return $forms[0]; |
63 | | - } elseif ( $count == '2' && isset($forms[2]) ) { |
| 63 | + } elseif ( $count == '2' && isset( $forms[2] ) ) { |
64 | 64 | return $forms[2]; |
65 | 65 | } else { |
66 | 66 | return $forms[1]; |
Index: trunk/phase3/languages/classes/LanguageHi.php |
— | — | @@ -8,9 +8,9 @@ |
9 | 9 | * Use singular form for zero |
10 | 10 | */ |
11 | 11 | function convertPlural( $count, $forms ) { |
12 | | - if ( !count($forms) ) { return ''; } |
| 12 | + if ( !count( $forms ) ) { return ''; } |
13 | 13 | $forms = $this->preConvertPlural( $forms, 2 ); |
14 | 14 | |
15 | | - return ($count <= 1) ? $forms[0] : $forms[1]; |
| 15 | + return ( $count <= 1 ) ? $forms[0] : $forms[1]; |
16 | 16 | } |
17 | 17 | } |
Index: trunk/phase3/languages/classes/LanguageSr_el.php |
— | — | @@ -5,13 +5,13 @@ |
6 | 6 | */ |
7 | 7 | class LanguageSr_el extends Language { |
8 | 8 | function convertPlural( $count, $forms ) { |
9 | | - if ( !count($forms) ) { return ''; } |
| 9 | + if ( !count( $forms ) ) { return ''; } |
10 | 10 | $forms = $this->preConvertPlural( $forms, 3 ); |
11 | 11 | |
12 | | - if ($count > 10 && floor(($count % 100) / 10) == 1) { |
| 12 | + if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) { |
13 | 13 | return $forms[2]; |
14 | 14 | } else { |
15 | | - switch ($count % 10) { |
| 15 | + switch ( $count % 10 ) { |
16 | 16 | case 1: return $forms[0]; |
17 | 17 | case 2: |
18 | 18 | case 3: |
Index: trunk/phase3/languages/LanguageConverter.php |
— | — | @@ -447,7 +447,7 @@ |
448 | 448 | |
449 | 449 | /** |
450 | 450 | * Apply manual conversion rules. |
451 | | - * |
| 451 | + * |
452 | 452 | * @param $convRule Object: Object of ConverterRule |
453 | 453 | */ |
454 | 454 | protected function applyManualConv( $convRule ) { |
— | — | @@ -456,7 +456,7 @@ |
457 | 457 | // Bug 24072: $mConvRuleTitle was overwritten by other manual |
458 | 458 | // rule(s) not for title, this breaks the title conversion. |
459 | 459 | $newConvRuleTitle = $convRule->getTitle(); |
460 | | - if( $newConvRuleTitle ) { |
| 460 | + if ( $newConvRuleTitle ) { |
461 | 461 | // So I add an empty check for getTitle() |
462 | 462 | $this->mConvRuleTitle = $newConvRuleTitle; |
463 | 463 | } |
— | — | @@ -532,7 +532,7 @@ |
533 | 533 | $variant = $this->getPreferredVariant(); |
534 | 534 | return $this->convertTo( $text, $variant ); |
535 | 535 | } |
536 | | - |
| 536 | + |
537 | 537 | /** |
538 | 538 | * Same as convert() except a extra parameter to custom variant. |
539 | 539 | * |
— | — | @@ -562,7 +562,7 @@ |
563 | 563 | while ( $startPos < $length ) { |
564 | 564 | $m = false; |
565 | 565 | $pos = strpos( $text, '-{', $startPos ); |
566 | | - |
| 566 | + |
567 | 567 | if ( $pos === false ) { |
568 | 568 | // No more markup, append final segment |
569 | 569 | $out .= $this->autoConvert( substr( $text, $startPos ), $variant ); |
— | — | @@ -595,7 +595,7 @@ |
596 | 596 | protected function recursiveConvertRule( $text, $variant, &$startPos, $depth = 0 ) { |
597 | 597 | // Quick sanity check (no function calls) |
598 | 598 | if ( $text[$startPos] !== '-' || $text[$startPos + 1] !== '{' ) { |
599 | | - throw new MWException( __METHOD__.': invalid input string' ); |
| 599 | + throw new MWException( __METHOD__ . ': invalid input string' ); |
600 | 600 | } |
601 | 601 | |
602 | 602 | $startPos += 2; |
— | — | @@ -628,7 +628,7 @@ |
629 | 629 | $inner .= '-{'; |
630 | 630 | if ( !$warningDone ) { |
631 | 631 | $inner .= '<span class="error">' . |
632 | | - wfMsgForContent( 'language-converter-depth-warning', |
| 632 | + wfMsgForContent( 'language-converter-depth-warning', |
633 | 633 | $this->mMaxDepth ) . |
634 | 634 | '</span>'; |
635 | 635 | $warningDone = true; |
— | — | @@ -647,7 +647,7 @@ |
648 | 648 | $this->applyManualConv( $rule ); |
649 | 649 | return $rule->getDisplay(); |
650 | 650 | default: |
651 | | - throw new MWException( __METHOD__.': invalid regex match' ); |
| 651 | + throw new MWException( __METHOD__ . ': invalid regex match' ); |
652 | 652 | } |
653 | 653 | } |
654 | 654 | |
— | — | @@ -841,7 +841,7 @@ |
842 | 842 | |
843 | 843 | if ( strpos( $code, '/' ) === false ) { |
844 | 844 | $txt = $wgMessageCache->get( 'Conversiontable', true, $code ); |
845 | | - if( $txt === false ){ |
| 845 | + if ( $txt === false ) { |
846 | 846 | # FIXME: this method doesn't seem to be expecting |
847 | 847 | # this possible outcome... |
848 | 848 | $txt = '<Conversiontable>'; |
— | — | @@ -1277,7 +1277,7 @@ |
1278 | 1278 | } |
1279 | 1279 | /*for unidirectional array fill to convert tables */ |
1280 | 1280 | if ( ( $manLevel[$v] == 'bidirectional' || $manLevel[$v] == 'unidirectional' ) |
1281 | | - && isset( $unidtable[$v] ) ) |
| 1281 | + && isset( $unidtable[$v] ) ) |
1282 | 1282 | { |
1283 | 1283 | if ( isset( $this->mConvTable[$v] ) ) { |
1284 | 1284 | $this->mConvTable[$v] = array_merge( $this->mConvTable[$v], $unidtable[$v] ); |