Index: trunk/extensions/Translate/scripts/list-mwext-i18n-files.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | } |
20 | 20 | require_once( "$IP/maintenance/Maintenance.php" ); |
21 | 21 | |
22 | | -/// Script which lists required i18n files for mediawiki extensions. |
| 22 | +/// Script which lists required i18n files for MediaWiki extensions. |
23 | 23 | class MWExtFileList extends Maintenance { |
24 | 24 | public function __construct() { |
25 | 25 | parent::__construct(); |
— | — | @@ -34,9 +34,9 @@ |
35 | 35 | foreach ( $groups as $group ) { |
36 | 36 | if ( !$group instanceof ExtensionMessageGroup ) continue; |
37 | 37 | if ( $target && $group->getPath() !== $target ) continue; |
38 | | - $this->addPaths( $group->getMessageFile('en') ); |
39 | | - $this->addPaths( $group->getAliasFile('en') ); |
40 | | - $this->addPaths( $group->getMagicFile('en') ); |
| 38 | + $this->addPaths( $group->getMessageFile( 'en' ) ); |
| 39 | + $this->addPaths( $group->getAliasFile( 'en' ) ); |
| 40 | + $this->addPaths( $group->getMagicFile( 'en' ) ); |
41 | 41 | } |
42 | 42 | |
43 | 43 | $files = array_keys( $this->files ); |
Index: trunk/extensions/Translate/scripts/magic-export.php |
— | — | @@ -122,7 +122,7 @@ |
123 | 123 | // Seek first '*/'. |
124 | 124 | $end = strpos( $data, '*/' ) + 2; |
125 | 125 | |
126 | | - if( $end === false ) { |
| 126 | + if ( $end === false ) { |
127 | 127 | die( "No header found in '$file'.\n" ); |
128 | 128 | } |
129 | 129 | |
— | — | @@ -262,8 +262,8 @@ |
263 | 263 | */ |
264 | 264 | protected function writeFooters() { |
265 | 265 | $this->output( "Writing file footers...\n" ); |
266 | | - if( $this->type === 'special' ) { |
267 | | - foreach( $this->handles as $handle ) { |
| 266 | + if ( $this->type === 'special' ) { |
| 267 | + foreach ( $this->handles as $handle ) { |
268 | 268 | fwrite( $handle, <<<PHP |
269 | 269 | |
270 | 270 | |
Index: trunk/extensions/Translate/scripts/cldr-plural-to-yaml.php |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | $doc->load( 'plurals.xml' ); |
37 | 37 | |
38 | 38 | $rulesets = $doc->getElementsByTagName( "pluralRules" ); |
39 | | - foreach( $rulesets as $ruleset ) { |
| 39 | + foreach ( $rulesets as $ruleset ) { |
40 | 40 | $codes = $ruleset->getAttribute( 'locales' ); |
41 | 41 | $parsed = array(); |
42 | 42 | $rules = $ruleset->getElementsByTagName( "pluralRule" ); |
— | — | @@ -50,13 +50,13 @@ |
51 | 51 | $name = "Zero"; |
52 | 52 | } elseif ( $codes === 'ar' ) { |
53 | 53 | $name = "Arabic"; |
54 | | - } elseif( count( $parsed ) === 1 ) { |
| 54 | + } elseif ( count( $parsed ) === 1 ) { |
55 | 55 | if ( isset( $parsed['one'] ) && $parsed['one'] === 'n is 1' ) { |
56 | 56 | $name = "Default"; |
57 | | - } elseif( isset( $parsed['one'] ) && $parsed['one'] === 'n in 0..1' ) { |
| 57 | + } elseif ( isset( $parsed['one'] ) && $parsed['one'] === 'n in 0..1' ) { |
58 | 58 | $name = "One-zero"; |
59 | 59 | } |
60 | | - } elseif( count( $parsed ) === 2 ) { |
| 60 | + } elseif ( count( $parsed ) === 2 ) { |
61 | 61 | if ( isset( $parsed['one'] ) && isset( $parsed['two'] ) ) { |
62 | 62 | $name = "Has-dual"; |
63 | 63 | } |
Index: trunk/extensions/Translate/scripts/yaml-tests.php |
— | — | @@ -79,11 +79,11 @@ |
80 | 80 | return $groups; |
81 | 81 | } |
82 | 82 | |
83 | | - public static function sortNestedArrayAssoc(&$a) { |
84 | | - ksort($a); |
85 | | - foreach ($a as $key => &$value) { |
86 | | - if (is_array($value)) { |
87 | | - self::sortNestedArrayAssoc($value); |
| 83 | + public static function sortNestedArrayAssoc( &$a ) { |
| 84 | + ksort( $a ); |
| 85 | + foreach ( $a as $key => &$value ) { |
| 86 | + if ( is_array( $value ) ) { |
| 87 | + self::sortNestedArrayAssoc( $value ); |
88 | 88 | } |
89 | 89 | } |
90 | 90 | } |
Index: trunk/extensions/Translate/scripts/plural-comparison.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | sort( $allkeys ); |
35 | 35 | |
36 | 36 | $this->output( sprintf( "%12s %3s %3s %4s\n", 'Code', 'MW', 'Get', 'CLDR' ) ); |
37 | | - foreach( $allkeys as $index => $code ) { |
| 37 | + foreach ( $allkeys as $index => $code ) { |
38 | 38 | $mw = isset( $mwLanguages[$code] ) ? ( $mwLanguages[$code] === false ? '.' : '+' ) : ''; |
39 | 39 | $gt = isset( $gtLanguages[$code] ) ? ( $gtLanguages[$code] === '(n != 1);' ? '.' : '+' ) : ''; |
40 | 40 | $cl = isset( $clLanguages[$code] ) ? ( $clLanguages[$code][0] === 'Default' ? '.' : '+' ) : ''; |
— | — | @@ -72,7 +72,7 @@ |
73 | 73 | $cldrmap = array(); |
74 | 74 | $error = false; |
75 | 75 | |
76 | | - for( $i = 0; $i <= 200; $i++ ) { |
| 76 | + for ( $i = 0; $i <= 200; $i++ ) { |
77 | 77 | $mw = $obj ? $obj->convertPlural( $i, array( 0, 1, 2, 3, 4, 5 ) ) : '?'; |
78 | 78 | $gt = $gtExp ? eval( $gtExp ) : '?'; |
79 | 79 | $cldr = $cldrExp !== false ? $this->evalCLDRRule( $i, $cldrExp ) : '?'; |
— | — | @@ -116,7 +116,7 @@ |
117 | 117 | $ruleExps = array(); |
118 | 118 | foreach ( $data['rulesets'] as $name => $rules ) { |
119 | 119 | $ruleExps[$name] = array(); |
120 | | - foreach( $rules as $rulename => $rule ) { |
| 120 | + foreach ( $rules as $rulename => $rule ) { |
121 | 121 | $ruleExps[$name][$rulename] = $this->parseCLDRRule( $rule ); |
122 | 122 | } |
123 | 123 | } |
— | — | @@ -172,11 +172,11 @@ |
173 | 173 | $rule = preg_replace( '/([^ ]+) within (\d+)\.\.(\d+)/', 'self::within(\1,\2,\3)', $rule ); |
174 | 174 | // AND takes precedence over OR |
175 | 175 | $andrule = '/([^ ]+) and ([^ ]+)/i'; |
176 | | - while( preg_match( $andrule, $rule ) ) { |
| 176 | + while ( preg_match( $andrule, $rule ) ) { |
177 | 177 | $rule = preg_replace( $andrule, '(\1&&\2)', $rule ); |
178 | 178 | } |
179 | 179 | $orrule = '/([^ ]+) or ([^ ]+)/i'; |
180 | | - while( preg_match( $orrule, $rule ) ) { |
| 180 | + while ( preg_match( $orrule, $rule ) ) { |
181 | 181 | $rule = preg_replace( $orrule, '(\1||\2)', $rule ); |
182 | 182 | } |
183 | 183 | |
Index: trunk/extensions/Translate/scripts/export.php |
— | — | @@ -83,9 +83,9 @@ |
84 | 84 | |
85 | 85 | $groups = array(); |
86 | 86 | |
87 | | -if( isset( $options['group'] ) ) { |
| 87 | +if ( isset( $options['group'] ) ) { |
88 | 88 | $groups[$options['group']] = MessageGroups::getGroup( $options['group'] ); |
89 | | -} elseif( isset( $options['groups'] ) ) { |
| 89 | +} elseif ( isset( $options['groups'] ) ) { |
90 | 90 | // Explode parameter |
91 | 91 | $groupIds = explode( ',', trim( $options['groups'] ) ); |
92 | 92 | |
— | — | @@ -98,14 +98,14 @@ |
99 | 99 | $allGroups = MessageGroups::singleton()->getGroups(); |
100 | 100 | |
101 | 101 | // Add matching groups to groups array. |
102 | | - foreach( $allGroups as $groupId => $messageGroup ) { |
103 | | - if( strpos( $groupId, $options['grouptrail'] ) === 0 && !$messageGroup->isMeta() ) { |
| 102 | + foreach ( $allGroups as $groupId => $messageGroup ) { |
| 103 | + if ( strpos( $groupId, $options['grouptrail'] ) === 0 && !$messageGroup->isMeta() ) { |
104 | 104 | $groups[$groupId] = $messageGroup; |
105 | 105 | } |
106 | 106 | } |
107 | 107 | } |
108 | 108 | |
109 | | -foreach( $groups as $groupId => $group ) { |
| 109 | +foreach ( $groups as $groupId => $group ) { |
110 | 110 | if ( !$group instanceof MessageGroup ) { |
111 | 111 | STDERR( "Invalid group: " . $groupId ); |
112 | 112 | exit( 1 ); |
— | — | @@ -143,7 +143,7 @@ |
144 | 144 | |
145 | 145 | foreach ( $langs as $lang ) { |
146 | 146 | // Do not export if language code is to be skipped or is not a valid language. |
147 | | - if( in_array( $lang, $skip ) || !$group->isValidLanguage( $lang ) ) { |
| 147 | + if ( in_array( $lang, $skip ) || !$group->isValidLanguage( $lang ) ) { |
148 | 148 | continue; |
149 | 149 | } |
150 | 150 | |
Index: trunk/extensions/Translate/scripts/logfilter.php |
— | — | @@ -37,7 +37,7 @@ |
38 | 38 | if ( mb_strlen( $line ) > 400 ) { |
39 | 39 | $line = mb_substr( $line, 0, 400 ) . '...'; |
40 | 40 | } |
41 | | - echo trim( $prefix.$line ) . "\n"; |
| 41 | + echo trim( $prefix . $line ) . "\n"; |
42 | 42 | } |
43 | 43 | |
44 | 44 | sleep( 30 ); |
Index: trunk/extensions/Translate/MessageChecks.php |
— | — | @@ -376,8 +376,8 @@ |
377 | 377 | |
378 | 378 | libxml_use_internal_errors( true ); |
379 | 379 | libxml_clear_errors(); |
380 | | - $doc = simplexml_load_string( Xml::tags( 'root', null, $translation )); |
381 | | - if ($doc) continue; |
| 380 | + $doc = simplexml_load_string( Xml::tags( 'root', null, $translation ) ); |
| 381 | + if ( $doc ) continue; |
382 | 382 | |
383 | 383 | $errors = libxml_get_errors(); |
384 | 384 | $params = array(); |
Index: trunk/extensions/Translate/FFS.php |
— | — | @@ -725,7 +725,7 @@ |
726 | 726 | |
727 | 727 | $messages = $this->flatten( $messages ); |
728 | 728 | $messages = $this->group->getMangler()->mangle( $messages ); |
729 | | - foreach( $messages as $key => &$value ) { |
| 729 | + foreach ( $messages as $key => &$value ) { |
730 | 730 | $value = rtrim( $value, "\n" ); |
731 | 731 | } |
732 | 732 | |
— | — | @@ -1065,18 +1065,18 @@ |
1066 | 1066 | |
1067 | 1067 | public function read( $code ) { |
1068 | 1068 | // TODO: Improve this code to not use static variables. |
1069 | | - if( !isset( self::$data[$this->group->getId()] ) ) { |
| 1069 | + if ( !isset( self::$data[$this->group->getId()] ) ) { |
1070 | 1070 | $filename = $this->group->getSourceFilePath( $code ); |
1071 | 1071 | $json = shell_exec( "python -c'import simplejson as json; execfile(\"$filename\"); print json.dumps(msg)'" ); |
1072 | 1072 | self::$data[$this->group->getId()] = json_decode( $json, true ); |
1073 | 1073 | } |
1074 | | - if( !isset( self::$data[$this->group->getId()][$code] ) ) self::$data[$this->group->getId()][$code] = array(); |
| 1074 | + if ( !isset( self::$data[$this->group->getId()][$code] ) ) self::$data[$this->group->getId()][$code] = array(); |
1075 | 1075 | return array( 'MESSAGES' => self::$data[$this->group->getId()][$code] ); |
1076 | 1076 | } |
1077 | 1077 | |
1078 | 1078 | |
1079 | 1079 | public function write( MessageCollection $collection ) { |
1080 | | - if( $this->fw === null ) { |
| 1080 | + if ( $this->fw === null ) { |
1081 | 1081 | $outputFile = $this->writePath . '/' . $this->group->getTargetFilename( 'en' ); |
1082 | 1082 | wfMkdirParents( dirname( $outputFile ), null, __METHOD__ ); |
1083 | 1083 | $this->fw = fopen( $outputFile, 'w' ); |
— | — | @@ -1087,13 +1087,13 @@ |
1088 | 1088 | // Not sure why this is needed, only continue if there are translations. |
1089 | 1089 | $collection->loadTranslations(); |
1090 | 1090 | $ok = false; |
1091 | | - foreach( $collection as $messages ) { |
1092 | | - if( $messages->translation() != '' ) $ok = true; |
| 1091 | + foreach ( $collection as $messages ) { |
| 1092 | + if ( $messages->translation() != '' ) $ok = true; |
1093 | 1093 | } |
1094 | | - if( !$ok ) return; |
| 1094 | + if ( !$ok ) return; |
1095 | 1095 | |
1096 | | - $authors = $this->doAuthors($collection); |
1097 | | - if( $authors != '' ) fwrite( $this->fw, "$authors" ); |
| 1096 | + $authors = $this->doAuthors( $collection ); |
| 1097 | + if ( $authors != '' ) fwrite( $this->fw, "$authors" ); |
1098 | 1098 | fwrite( $this->fw, "\t'{$collection->code}': {\n" ); |
1099 | 1099 | fwrite( $this->fw, $this->writeBlock( $collection ) ); |
1100 | 1100 | fwrite( $this->fw, "\t},\n" ); |
— | — | @@ -1112,15 +1112,15 @@ |
1113 | 1113 | protected function writeBlock( MessageCollection $collection ) { |
1114 | 1114 | $block = ''; |
1115 | 1115 | $messages = array(); |
1116 | | - foreach( $collection as $message ) { |
1117 | | - if( $message->translation() == '' ) continue; |
| 1116 | + foreach ( $collection as $message ) { |
| 1117 | + if ( $message->translation() == '' ) continue; |
1118 | 1118 | $translation = str_replace( '\\', '\\\\', $message->translation() ); |
1119 | 1119 | $translation = str_replace( '\'', '\\\'', $translation ); |
1120 | 1120 | $translation = str_replace( "\n", '\n', $translation ); |
1121 | 1121 | $messages[$message->key()] = $translation; |
1122 | 1122 | } |
1123 | 1123 | ksort( $messages ); |
1124 | | - foreach( $messages as $key => $translation ) { |
| 1124 | + foreach ( $messages as $key => $translation ) { |
1125 | 1125 | $block .= "\t\t'{$key}': u'{$translation}',\n"; |
1126 | 1126 | } |
1127 | 1127 | return $block; |
— | — | @@ -1132,11 +1132,11 @@ |
1133 | 1133 | // Read authors. |
1134 | 1134 | $fr = fopen( $this->group->getSourceFilePath( $collection->code ), 'r' ); |
1135 | 1135 | $authors = array(); |
1136 | | - while( !feof( $fr ) ) { |
| 1136 | + while ( !feof( $fr ) ) { |
1137 | 1137 | $line = fgets( $fr ); |
1138 | | - if( strpos( $line, "\t# Author:" ) === 0 ) { |
| 1138 | + if ( strpos( $line, "\t# Author:" ) === 0 ) { |
1139 | 1139 | $authors[] = trim( substr( $line, strlen( "\t# Author: " ) ) ); |
1140 | | - } elseif( $line === "\t'{$collection->code}': {\n" ) { |
| 1140 | + } elseif ( $line === "\t'{$collection->code}': {\n" ) { |
1141 | 1141 | break; |
1142 | 1142 | } else { |
1143 | 1143 | $authors = array(); |
— | — | @@ -1154,7 +1154,7 @@ |
1155 | 1155 | } |
1156 | 1156 | |
1157 | 1157 | public function __destruct() { |
1158 | | - if( $this->fw !== null ) { |
| 1158 | + if ( $this->fw !== null ) { |
1159 | 1159 | fwrite( $this->fw, "}" ); |
1160 | 1160 | fclose( $this->fw ); |
1161 | 1161 | } |
Index: trunk/extensions/Translate/MessageGroups.php |
— | — | @@ -732,7 +732,7 @@ |
733 | 733 | $tables = 'translate_sections'; |
734 | 734 | $vars = array( 'trs_key', 'trs_text' ); |
735 | 735 | $conds = array( 'trs_page' => $this->getTitle()->getArticleId() ); |
736 | | - $options = array( 'ORDER BY' => 'trs_order'); |
| 736 | + $options = array( 'ORDER BY' => 'trs_order' ); |
737 | 737 | $res = $dbr->select( $tables, $vars, $conds, __METHOD__, $options ); |
738 | 738 | |
739 | 739 | $defs = array(); |
— | — | @@ -1082,4 +1082,4 @@ |
1083 | 1083 | |
1084 | 1084 | } |
1085 | 1085 | |
1086 | | -class SingleFileBasedMessageGroup extends FileBasedMessageGroup{} |
| 1086 | +class SingleFileBasedMessageGroup extends FileBasedMessageGroup {} |
Index: trunk/extensions/Translate/tag/TranslatablePage.php |
— | — | @@ -738,7 +738,7 @@ |
739 | 739 | $options = array( 'GROUP BY' => 'rt_page' ); |
740 | 740 | |
741 | 741 | $res = $dbr->select( $tables, $fields, $conds, __METHOD__, $options ); |
742 | | - $results = array(); |
| 742 | + $results = array(); |
743 | 743 | foreach ( $res as $row ) { |
744 | 744 | $results[] = $row->rt_page; |
745 | 745 | } |
Index: trunk/extensions/Translate/groups/MediaWiki/Checker.php |
— | — | @@ -292,7 +292,7 @@ |
293 | 293 | */ |
294 | 294 | protected static function getPrefMessages() { |
295 | 295 | // @todo: moar? |
296 | | - return array( |
| 296 | + return array( |
297 | 297 | array( |
298 | 298 | 'Mw_math_png', |
299 | 299 | 'Mw_math_simple', |
Index: trunk/extensions/Translate/groups/Toolserver/ToolserverTextdomains.php |
— | — | @@ -82,7 +82,7 @@ |
83 | 83 | |
84 | 84 | // All messages are prefixed with their groupname |
85 | 85 | $g['mangle'] = array( '*' ); |
86 | | - |
| 86 | + |
87 | 87 | // Prevent E_NOTICE undefined index. |
88 | 88 | // PremadeMediawikiExtensionGroups::factory should probably check this better instead |
89 | 89 | if ( !isset( $g['ignored'] ) ) $g['ignored'] = array(); |
Index: trunk/extensions/Translate/groups/MediaWikiExtensions.php |
— | — | @@ -211,7 +211,7 @@ |
212 | 212 | $postfix = 'Configure/load_txt_def/TxtDef.php'; |
213 | 213 | if ( file_exists( "$IP/extensions/$postfix" ) ) { |
214 | 214 | $prefix = "$IP/extensions"; |
215 | | - } elseif( file_exists( "$wgTranslateExtensionDirectory/$postfix" ) ) { |
| 215 | + } elseif ( file_exists( "$wgTranslateExtensionDirectory/$postfix" ) ) { |
216 | 216 | $prefix = $wgTranslateExtensionDirectory; |
217 | 217 | } else { |
218 | 218 | $prefix = false; |
Index: trunk/extensions/Translate/TranslateEditAddons.php |
— | — | @@ -54,11 +54,11 @@ |
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
58 | | - if ( isset( $keys[$index-1] ) ) { |
59 | | - $prev = $keys[$index-1]; |
| 58 | + if ( isset( $keys[$index -1] ) ) { |
| 59 | + $prev = $keys[$index -1]; |
60 | 60 | } |
61 | | - if ( isset( $keys[$index+1] ) ) { |
62 | | - $next = $keys[$index+1]; |
| 61 | + if ( isset( $keys[$index + 1] ) ) { |
| 62 | + $next = $keys[$index + 1]; |
63 | 63 | } |
64 | 64 | |
65 | 65 | $id = $group->getId(); |
— | — | @@ -449,7 +449,7 @@ |
450 | 450 | public static function disablePreSaveTransform( $article, $popts ) { |
451 | 451 | global $wgTranslateDocumentationLanguageCode; |
452 | 452 | $keycodegroup = self::getKeyCodeGroup( $article->getTitle() ); |
453 | | - if( self::isMessageNamespace( $article->getTitle() ) |
| 453 | + if ( self::isMessageNamespace( $article->getTitle() ) |
454 | 454 | && $keycodegroup[1] !== $wgTranslateDocumentationLanguageCode ) { |
455 | 455 | $popts->setPreSaveTransform( false ); |
456 | 456 | } |
— | — | @@ -471,7 +471,7 @@ |
472 | 472 | $th->setEditMode( false ); |
473 | 473 | $th->setTranslation( $de->mNewtext ); |
474 | 474 | TranslateUtils::injectCSS(); |
475 | | - |
| 475 | + |
476 | 476 | $boxes = array(); |
477 | 477 | $boxes[] = $th->getDocumentationBox(); |
478 | 478 | $boxes[] = $th->getDefinitionBox(); |
Index: trunk/extensions/Translate/Translate.php |
— | — | @@ -117,9 +117,9 @@ |
118 | 118 | $wgAvailableRights[] = 'translate-manage'; |
119 | 119 | |
120 | 120 | // Client-side resource modules |
121 | | -$wgResourceModules['translate-css'] = array( |
| 121 | +$wgResourceModules['translate-css'] = array( |
122 | 122 | 'styles' => 'Translate.css', |
123 | | - 'localBasePath' => dirname( __FILE__ ), |
| 123 | + 'localBasePath' => dirname( __FILE__ ), |
124 | 124 | 'remoteExtPath' => 'Translate' |
125 | 125 | ); |
126 | 126 | $wgResourceModules['ext.translate.langstats'] = array( |
— | — | @@ -169,7 +169,7 @@ |
170 | 170 | * Text that will be shown in translations if the translation is outdated. |
171 | 171 | * Must be something that does not conflict with actual content. |
172 | 172 | */ |
173 | | -if( !defined( 'TRANSLATE_FUZZY' ) ) { |
| 173 | +if ( !defined( 'TRANSLATE_FUZZY' ) ) { |
174 | 174 | define( 'TRANSLATE_FUZZY', '!!FUZZY!!' ); |
175 | 175 | } |
176 | 176 | |
Index: trunk/extensions/Translate/TranslateTasks.php |
— | — | @@ -417,7 +417,7 @@ |
418 | 418 | if ( $this->group instanceof FileBasedMessageGroup ) { |
419 | 419 | $ffs = $this->group->getFFS(); |
420 | 420 | } |
421 | | - |
| 421 | + |
422 | 422 | if ( !$ffs instanceof GettextFFS ) { |
423 | 423 | $group = FileBasedMessageGroup::newFromMessageGroup( $this->group ); |
424 | 424 | $ffs = new GettextFFS( $group ); |
Index: trunk/extensions/Translate/utils/MemoryCache.php |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
47 | | - * @copydoc ArrayMemoryCache::__construct() |
| 47 | + * @copydoc ArrayMemoryCache::__construct() |
48 | 48 | * Static factory function for the constructor. |
49 | 49 | */ |
50 | 50 | public static function factory( $table ) { |
Index: trunk/extensions/Translate/utils/MessageTable.php |
— | — | @@ -123,7 +123,7 @@ |
124 | 124 | $tableheader .= Xml::closeElement( 'tr' ); |
125 | 125 | } |
126 | 126 | |
127 | | - return $tableheader ."\n"; |
| 127 | + return $tableheader . "\n"; |
128 | 128 | } |
129 | 129 | |
130 | 130 | public function contents() { |
— | — | @@ -135,7 +135,7 @@ |
136 | 136 | |
137 | 137 | $mlang = Language::factory( $this->code ); |
138 | 138 | $mespa = array( 'dir' => $mlang->getDir(), 'lang' => $this->code ); |
139 | | - unset($mlang); |
| 139 | + unset( $mlang ); |
140 | 140 | |
141 | 141 | $batch = new LinkBatch(); |
142 | 142 | if ( method_exists( $batch, 'setCaller' ) ) { |
— | — | @@ -157,7 +157,7 @@ |
158 | 158 | $title = $this->keyToTitle( $key ); |
159 | 159 | |
160 | 160 | $original = $m->definition(); |
161 | | - #TODO: handle directionality of fallback language(s) |
| 161 | + # @todo Handle directionality of fallback language(s) |
162 | 162 | if ( $m->translation() ) { |
163 | 163 | $message = $m->translation(); |
164 | 164 | $rclasses = array_merge ( $mespa, array( 'class' => 'translated' ) ); |
Index: trunk/extensions/Translate/utils/TranslationEditPage.php |
— | — | @@ -199,7 +199,7 @@ |
200 | 200 | |
201 | 201 | $support = Html::element( |
202 | 202 | 'input', |
203 | | - array( |
| 203 | + array( |
204 | 204 | 'class' => 'mw-translate-support', |
205 | 205 | 'type' => 'button', |
206 | 206 | 'value' => wfMsg( 'translate-js-support' ), |
Index: trunk/extensions/Translate/utils/CompatibilityCode.php |
— | — | @@ -14,8 +14,8 @@ |
15 | 15 | class TranslateBC { |
16 | 16 | |
17 | 17 | /** |
18 | | - * Create a call to a JavaScript function. The supplied arguments will be |
19 | | - * encoded using Xml::encodeJsVar(). |
| 18 | + * Create a call to a JavaScript function. The supplied arguments will be |
| 19 | + * encoded using Xml::encodeJsVar(). |
20 | 20 | * |
21 | 21 | * @param $name The name of the function to call, or a JavaScript expression |
22 | 22 | * which evaluates to a function object which is called. |
Index: trunk/extensions/Translate/utils/TranslateYaml.php |
— | — | @@ -89,7 +89,7 @@ |
90 | 90 | if ( is_array( $value ) ) { |
91 | 91 | self::fixSpycSpaces( $value ); |
92 | 92 | } elseif ( is_string( $value ) && $key === 'header' ) { |
93 | | - $value = preg_replace( '~^\*~m', ' *', $value ). "\n"; |
| 93 | + $value = preg_replace( '~^\*~m', ' *', $value ) . "\n"; |
94 | 94 | } |
95 | 95 | } |
96 | 96 | return $yaml; |
Index: trunk/extensions/Translate/utils/TranslationHelpers.php |
— | — | @@ -204,7 +204,7 @@ |
205 | 205 | $all['translation-memory'] = array( $this, 'getLazySuggestionBox' ); |
206 | 206 | } elseif ( $suggestions === 'only' ) { |
207 | 207 | return (string) call_user_func( $all['translation-memory'], 'lazy' ); |
208 | | - } elseif( $suggestions === 'checks' ) { |
| 208 | + } elseif ( $suggestions === 'checks' ) { |
209 | 209 | global $wgRequest; |
210 | 210 | $this->translation = $wgRequest->getText( 'translation' ); |
211 | 211 | return (string) call_user_func( $all['check'] ); |
— | — | @@ -457,7 +457,7 @@ |
458 | 458 | $options = array(); |
459 | 459 | $options['timeout'] = $config['timeout']; |
460 | 460 | |
461 | | - $params = array( |
| 461 | + $params = array( |
462 | 462 | 'text' => $definition, |
463 | 463 | 'to' => $code, |
464 | 464 | ); |
— | — | @@ -498,7 +498,7 @@ |
499 | 499 | self::reportTranslationServiceFailure( $serviceName ); |
500 | 500 | return null; |
501 | 501 | } |
502 | | - |
| 502 | + |
503 | 503 | $ret = $req->getContent(); |
504 | 504 | $text = preg_replace( '~<string.*>(.*)</string>~', '\\1', $ret ); |
505 | 505 | $text = Sanitizer::decodeCharReferences( $text ); |
Index: trunk/extensions/Translate/utils/MessageGroupCache.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | * Caches messages of file based message group source file. Can also track |
13 | 13 | * that the cache is up to date. Parsing the source files can be slow, so |
14 | 14 | * constructing CDB cache makes accessing that data constant speed regardless |
15 | | - * of the actual format. |
| 15 | + * of the actual format. |
16 | 16 | */ |
17 | 17 | class MessageGroupCache { |
18 | 18 | /// \string |
— | — | @@ -112,7 +112,7 @@ |
113 | 113 | $group = $this->group; |
114 | 114 | $groupId = $group->getId(); |
115 | 115 | |
116 | | - if( $group instanceof SingleFileBasedMessageGroup ) { |
| 116 | + if ( $group instanceof SingleFileBasedMessageGroup ) { |
117 | 117 | $messages = $group->load( $this->code ); |
118 | 118 | |
119 | 119 | $cache = $this->exists(); |
— | — | @@ -228,7 +228,7 @@ |
229 | 229 | '#version' => '3', |
230 | 230 | ); |
231 | 231 | $conv['#msgcount'] = count( $conv['#keys'] ); |
232 | | - |
| 232 | + |
233 | 233 | $messages = array(); |
234 | 234 | foreach ( unserialize( $conv['#keys'] ) as $key ) { |
235 | 235 | $messages[$key] = $oldcache->get( $key ); |
Index: trunk/extensions/Translate/specials/SpecialManageGroups.php |
— | — | @@ -337,7 +337,7 @@ |
338 | 338 | if ( $this->user->isAllowed( 'translate-manage' ) ) { |
339 | 339 | $this->out->addHTML( Xml::submitButton( wfMsg( 'translate-manage-submit' ) ) ); |
340 | 340 | } |
341 | | - } elseif( $this->user->isAllowed( 'translate-manage' ) ) { |
| 341 | + } elseif ( $this->user->isAllowed( 'translate-manage' ) ) { |
342 | 342 | $cache->create(); // Update timestamp |
343 | 343 | $this->out->addWikiMsg( 'translate-manage-nochanges' ); |
344 | 344 | } |
Index: trunk/extensions/Translate/specials/SpecialTranslationStats.php |
— | — | @@ -442,9 +442,9 @@ |
443 | 443 | $group = MessageGroups::getGroup( $groupId ); |
444 | 444 | $group = $group ? $group->getLabel() : $groupId; |
445 | 445 | $label = "$group @ $code"; |
446 | | - } elseif( $code ) { |
| 446 | + } elseif ( $code ) { |
447 | 447 | $label = TranslateUtils::getLanguageName( $code, false, $wgLang->getCode() ) . " ($code)"; |
448 | | - } elseif( $groupId ) { |
| 448 | + } elseif ( $groupId ) { |
449 | 449 | $group = MessageGroups::getGroup( $groupId ); |
450 | 450 | $label = $group ? $group->getLabel() : $groupId; |
451 | 451 | } |
— | — | @@ -545,7 +545,7 @@ |
546 | 546 | * - roundToSignificant( 1234, 1 ) = 2000 |
547 | 547 | * - roundToSignificant( 1234, 2 ) = 1300 |
548 | 548 | * - roundToSignificant( 1234, 3 ) = 1240 |
549 | | - * |
| 549 | + * |
550 | 550 | * @param $number \int Number to round. |
551 | 551 | * @param $significant \int How many signficant numbers to keep. |
552 | 552 | * @return \int Rounded number. |
Index: trunk/extensions/Translate/specials/SpecialLanguageStats.php |
— | — | @@ -218,7 +218,7 @@ |
219 | 219 | $cache->commit(); |
220 | 220 | |
221 | 221 | if ( $out ) { |
222 | | - $out = $this->createHeader( $code ) ."\n" . $out; |
| 222 | + $out = $this->createHeader( $code ) . "\n" . $out; |
223 | 223 | $out .= Xml::closeElement( 'table' ); |
224 | 224 | } else { |
225 | 225 | $out = wfMsgExt( 'translate-nothing-to-do', 'parse' ); |
— | — | @@ -236,7 +236,7 @@ |
237 | 237 | $top = array_shift( $item ); |
238 | 238 | $out .= $this->makeGroupRow( $top, $cache, $parent === '' ? true : $parent ); |
239 | 239 | foreach ( $item as $subgroup ) { |
240 | | - $parents = trim( $parent . ' ' .$top->getId() ); |
| 240 | + $parents = trim( $parent . ' ' . $top->getId() ); |
241 | 241 | $out .= $this->makeGroupGroup( $subgroup, $cache, $parents ); |
242 | 242 | } |
243 | 243 | return $out; |
— | — | @@ -292,7 +292,7 @@ |
293 | 293 | $rowParams['data-groupid'] = $groupId; |
294 | 294 | if ( is_string( $parent ) ) { |
295 | 295 | $rowParams['data-parentgroups'] = $parent; |
296 | | - } elseif( $parent === true ) { |
| 296 | + } elseif ( $parent === true ) { |
297 | 297 | $rowParams['data-ismeta'] = '1'; |
298 | 298 | } |
299 | 299 | |
— | — | @@ -307,15 +307,15 @@ |
308 | 308 | array( 'data-sort-value' => $total - $translated ), |
309 | 309 | $wgLang->formatNum( $total - $translated ) ); |
310 | 310 | |
311 | | - $out .= "\n\t\t" .$this->element( $this->formatPercentage( $translated / $total ), |
| 311 | + $out .= "\n\t\t" . $this->element( $this->formatPercentage( $translated / $total ), |
312 | 312 | $this->getBackgroundColour( $translated, $total ), |
313 | 313 | sprintf( '%1.3f', $translated / $total ) ); |
314 | 314 | |
315 | | - $out .= "\n\t\t" .$this->element( $this->formatPercentage( $fuzzy / $total ), |
| 315 | + $out .= "\n\t\t" . $this->element( $this->formatPercentage( $fuzzy / $total ), |
316 | 316 | $this->getBackgroundColour( $fuzzy, $total, true ), |
317 | 317 | sprintf( '%1.3f', $fuzzy / $total ) ); |
318 | 318 | |
319 | | - $out .= "\n\t" . Xml::closeElement( 'tr' ) ."\n"; |
| 319 | + $out .= "\n\t" . Xml::closeElement( 'tr' ) . "\n"; |
320 | 320 | return $out; |
321 | 321 | } |
322 | 322 | |
— | — | @@ -333,7 +333,7 @@ |
334 | 334 | // Initialise messages. |
335 | 335 | $collection = $group->initCollection( $code ); |
336 | 336 | // Takes too much memory and only hides inconsistent import state |
337 | | - #$collection->setInFile( $group->load( $code ) ); |
| 337 | + # $collection->setInFile( $group->load( $code ) ); |
338 | 338 | $collection->filter( 'ignored' ); |
339 | 339 | $collection->filter( 'optional' ); |
340 | 340 | // Store the count of real messages for later calculation. |
Index: trunk/extensions/Translate/TranslateUtils.php |
— | — | @@ -416,7 +416,7 @@ |
417 | 417 | private $selected = false; |
418 | 418 | /// \array Extra html attributes. |
419 | 419 | private $attributes = array(); |
420 | | - |
| 420 | + |
421 | 421 | /** |
422 | 422 | * @param $name \string |
423 | 423 | * @param $id \string Default false. |
Index: trunk/extensions/Translate/Groups.php |
— | — | @@ -582,7 +582,7 @@ |
583 | 583 | protected function expandWildcards( $ids ) { |
584 | 584 | $hasWild = false; |
585 | 585 | foreach ( $ids as $id ) { |
586 | | - if ( strpos( $id, '*' ) !== false ) { |
| 586 | + if ( strpos( $id, '*' ) !== false ) { |
587 | 587 | $hasWild = true; |
588 | 588 | break; |
589 | 589 | } |
Index: trunk/extensions/Translate/ffs/Gettext.php |
— | — | @@ -182,7 +182,7 @@ |
183 | 183 | } |
184 | 184 | } |
185 | 185 | $item['flags'] = $flags; |
186 | | - |
| 186 | + |
187 | 187 | // Rest of the comments |
188 | 188 | $matches = array(); |
189 | 189 | if ( preg_match_all( '/^#(.?) (.*)$/m', $section, $matches, PREG_SET_ORDER ) ) { |
— | — | @@ -287,7 +287,7 @@ |
288 | 288 | error_log( __METHOD__ . ": $line" ); |
289 | 289 | } |
290 | 290 | list( $key, $value ) = explode( ':', $line, 2 ); |
291 | | - $tags[trim($key)] = trim($value); |
| 291 | + $tags[trim( $key )] = trim( $value ); |
292 | 292 | } |
293 | 293 | |
294 | 294 | return $tags; |
— | — | @@ -304,7 +304,7 @@ |
305 | 305 | $template['TEMPLATE'][$key] : array(); |
306 | 306 | $potTemplate = isset( $pot['TEMPLATE'][$key] ) ? |
307 | 307 | $pot['TEMPLATE'][$key] : array(); |
308 | | - |
| 308 | + |
309 | 309 | $output .= $this->formatMessageBlock( $key, $m, $transTemplate, $potTemplate, $pluralCount ); |
310 | 310 | } |
311 | 311 | |
— | — | @@ -333,7 +333,7 @@ |
334 | 334 | // Make sure there is no empty line before msgid |
335 | 335 | $output = trim( $output ) . "\n"; |
336 | 336 | |
337 | | - /// @todo twn specific |
| 337 | + // @todo twn specific |
338 | 338 | $portal = Title::makeTitle( NS_PORTAL, $code )->getFullUrl(); |
339 | 339 | |
340 | 340 | $specs = isset( $template['HEADERS'] ) ? $template['HEADERS'] : array(); |
— | — | @@ -361,7 +361,7 @@ |
362 | 362 | $plural = self::getPluralRule( $code ); |
363 | 363 | if ( $plural ) { |
364 | 364 | $specs['Plural-Forms'] = $plural; |
365 | | - } elseif( !isset( $specs['Plural-Forms'] ) ) { |
| 365 | + } elseif ( !isset( $specs['Plural-Forms'] ) ) { |
366 | 366 | $specs['Plural-Forms'] = 'nplurals=2; plural=(n != 1);'; |
367 | 367 | } |
368 | 368 | |