Index: trunk/extensions/Translate/scripts/sync-group.php |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | foreach ( $groupIds as $groupId ) { |
58 | 58 | $group = MessageGroups::getGroup( $groupId ); |
59 | 59 | |
60 | | - if( $group !== null ) { |
| 60 | + if ( $group !== null ) { |
61 | 61 | $groups[$groupId] = $group; |
62 | 62 | } else { |
63 | 63 | STDERR( "Invalid group $groupId" ); |
— | — | @@ -74,7 +74,7 @@ |
75 | 75 | } |
76 | 76 | } |
77 | 77 | |
78 | | -if( !count( $groups ) ) { |
| 78 | +if ( !count( $groups ) ) { |
79 | 79 | STDERR( "ESG2: No valid message groups identified." ); |
80 | 80 | exit( 1 ); |
81 | 81 | } |
Index: trunk/extensions/Translate/scripts/ttmserver-export.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | protected function statusLine( $text, $channel = null ) { |
35 | 35 | $pid = sprintf( "%5s", getmypid() ); |
36 | 36 | $prefix = sprintf( "%6.2f", microtime( true ) - $this->start ); |
37 | | - $mem = sprintf( "%5.1fM", ( memory_get_usage( true ) / (1024*1024) ) ); |
| 37 | + $mem = sprintf( "%5.1fM", ( memory_get_usage( true ) / ( 1024 * 1024 ) ) ); |
38 | 38 | $this->output( "$pid $prefix $mem $text", $channel ); |
39 | 39 | } |
40 | 40 | |
— | — | @@ -53,7 +53,7 @@ |
54 | 54 | $this->output( 'fulltext.. ', 1 ); |
55 | 55 | $dbw->delete( 'translate_tmf', '*', __METHOD__ ); |
56 | 56 | $table = $dbw->tableName( 'translate_tmf' ); |
57 | | - #$dbw->query( "DROP INDEX tmf_text ON $table" ); |
| 57 | + # $dbw->query( "DROP INDEX tmf_text ON $table" ); |
58 | 58 | $this->output( 'done!', 1 ); |
59 | 59 | |
60 | 60 | $this->statusLine( 'Loading groups... ', 2 ); |
— | — | @@ -187,7 +187,7 @@ |
188 | 188 | $this->output( '.', $targetLanguage ); |
189 | 189 | } |
190 | 190 | wfWaitForSlaves( 10 ); |
191 | | - } while( count( $inserts ) ); |
| 191 | + } while ( count( $inserts ) ); |
192 | 192 | } |
193 | 193 | |
194 | 194 | if ( $multi ) { |
Index: trunk/extensions/Translate/scripts/export.php |
— | — | @@ -99,7 +99,7 @@ |
100 | 100 | foreach ( $groupIds as $groupId ) { |
101 | 101 | $group = MessageGroups::getGroup( $groupId ); |
102 | 102 | |
103 | | - if( $group !== null ) { |
| 103 | + if ( $group !== null ) { |
104 | 104 | $groups[$groupId] = $group; |
105 | 105 | } else { |
106 | 106 | STDERR( "Invalid group $groupId" ); |
Index: trunk/extensions/Translate/utils/StatsTable.php |
— | — | @@ -32,6 +32,7 @@ |
33 | 33 | |
34 | 34 | public function __construct() { |
35 | 35 | global $wgLang; |
| 36 | + |
36 | 37 | $this->lang = $wgLang; |
37 | 38 | $this->translate = SpecialPage::getTitleFor( 'Translate' ); |
38 | 39 | } |
— | — | @@ -46,13 +47,18 @@ |
47 | 48 | */ |
48 | 49 | public function element( $in, $bgcolor = '', $sort = '' ) { |
49 | 50 | $attributes = array(); |
50 | | - if ( $sort ) $attributes['data-sort-value'] = $sort; |
| 51 | + |
| 52 | + if ( $sort ) { |
| 53 | + $attributes['data-sort-value'] = $sort; |
| 54 | + } |
| 55 | + |
51 | 56 | if ( $bgcolor ) { |
52 | 57 | $attributes['style'] = "background-color: #" . $bgcolor; |
53 | 58 | $attributes['class'] = 'hover-color'; |
54 | 59 | } |
55 | 60 | |
56 | 61 | $element = Html::element( 'td', $attributes, $in ); |
| 62 | + |
57 | 63 | return $element; |
58 | 64 | } |
59 | 65 | |
— | — | @@ -62,7 +68,11 @@ |
63 | 69 | if ( $fuzzy ) { |
64 | 70 | // Weigh fuzzy with factor 20. |
65 | 71 | $v = $v * 20; |
66 | | - if ( $v > 255 ) $v = 255; |
| 72 | + |
| 73 | + if ( $v > 255 ) { |
| 74 | + $v = 255; |
| 75 | + } |
| 76 | + |
67 | 77 | $v = 255 - $v; |
68 | 78 | } |
69 | 79 | |
— | — | @@ -134,10 +144,12 @@ |
135 | 145 | */ |
136 | 146 | public function makeTotalRow( Message $message, $numbers ) { |
137 | 147 | list( $total, $translated, $fuzzy ) = $numbers; |
| 148 | + |
138 | 149 | $out = "\t" . Html::openElement( 'tr' ); |
139 | 150 | $out .= "\n\t\t" . Html::element( 'td', array(), $message->text() ); |
140 | 151 | $out .= $this->makeNumberColumns( $fuzzy, $translated, $total ); |
141 | 152 | $out .= "\n\t" . Xml::closeElement( 'tr' ) . "\n"; |
| 153 | + |
142 | 154 | return $out; |
143 | 155 | } |
144 | 156 | |
— | — | @@ -153,6 +165,7 @@ |
154 | 166 | $na = "\n\t\t" . Html::element( 'td', array( 'data-sort-value' => -1 ), '...' ); |
155 | 167 | $nap = "\n\t\t" . $this->element( '...', 'AFAFAF', -1 ); |
156 | 168 | $out = $na . $na . $nap . $nap; |
| 169 | + |
157 | 170 | return $out; |
158 | 171 | } |
159 | 172 | |
— | — | @@ -181,6 +194,7 @@ |
182 | 195 | */ |
183 | 196 | public function formatPercentage( $num ) { |
184 | 197 | $fmt = $this->lang->formatNum( number_format( round( 100 * $num, 2 ), 2 ) ); |
| 198 | + |
185 | 199 | return wfMessage( 'percent', $fmt )->text(); |
186 | 200 | } |
187 | 201 | |
— | — | @@ -208,7 +222,6 @@ |
209 | 223 | * @return string Html |
210 | 224 | */ |
211 | 225 | public function makeGroupLink( MessageGroup $group, $code, $params ) { |
212 | | - |
213 | 226 | $queryParameters = $params + array( |
214 | 227 | 'group' => $group->getId(), |
215 | 228 | 'language' => $code |
— | — | @@ -238,19 +251,24 @@ |
239 | 252 | $cache = wfGetCache( CACHE_ANYTHING ); |
240 | 253 | $key = wfMemckey( "translate-groupdesc-$code-" . $group->getId() ); |
241 | 254 | $desc = $cache->get( $key ); |
| 255 | + |
242 | 256 | if ( is_string( $desc ) ) { |
243 | 257 | return $desc; |
244 | 258 | } |
245 | 259 | |
246 | 260 | $realFunction = array( 'MessageCache', 'singleton' ); |
| 261 | + |
247 | 262 | if ( is_callable( $realFunction ) ) { |
248 | 263 | $mc = MessageCache::singleton(); |
249 | 264 | } else { |
250 | 265 | global $wgMessageCache; |
| 266 | + |
251 | 267 | $mc = $wgMessageCache; |
252 | 268 | } |
| 269 | + |
253 | 270 | $desc = $mc->transform( $group->getDescription(), true, $this->lang ); |
254 | 271 | $cache->set( $key, $desc ); |
| 272 | + |
255 | 273 | return $desc; |
256 | 274 | } |
257 | 275 | |
Index: trunk/extensions/Translate/utils/TranslationHelpers.php |
— | — | @@ -1083,7 +1083,7 @@ |
1084 | 1084 | $text = wfMessage( 'translate-dynagroup-last', $user )->escaped(); |
1085 | 1085 | } |
1086 | 1086 | } |
1087 | | - |
| 1087 | + |
1088 | 1088 | return TranslateUtils::fieldset( $text, $diffText, array( 'class' => 'mw-sp-translate-latestchange' ) ); |
1089 | 1089 | } |
1090 | 1090 | |
Index: trunk/extensions/Translate/Translate.i18n.php |
— | — | @@ -13335,7 +13335,7 @@ |
13336 | 13336 | 'translate-edit-definition' => 'ಸಂದೇಶ ವ್ಯಾಖ್ಯೆ', |
13337 | 13337 | 'translate-edit-translation' => 'ಅನುವಾದ', |
13338 | 13338 | 'translate-edit-contribute' => 'ನೆರವಾಗು', |
13339 | | - 'translate-edit-no-information' => '"ಈ ಸಂದೇಶಕ್ಕೆ ಯಾವುದೇ ದಾಖಲೆಗಳಿಲ್ಲ." |
| 13339 | + 'translate-edit-no-information' => '"ಈ ಸಂದೇಶಕ್ಕೆ ಯಾವುದೇ ದಾಖಲೆಗಳಿಲ್ಲ." |
13340 | 13340 | "ನಿಮಗೆ ಈ ಸಂದೇಶ ಎಲ್ಲಿಯಾದರೂ ಅಥವಾ ಹೇಗಾದರೂ ಉಪಯೋಗದಲ್ಲಿರುವುದು ತಿಳಿದಿದ್ದರೆ,ನೀವು ಇದಕ್ಕೆ ತಕ್ಕ ದಾಖಲೆಗಳನ್ನು ಸೇರಿಸಿ ಬೇರಿ ಭಾಷಾಂತರಕಾರರಿಗೆ ಸಹಾಯ ಮಾಡಬಹುದು."', |
13341 | 13341 | 'translate-edit-information' => 'ಸಂದೇಶದ ಬಗ್ಗೆ ಮಾಹಿತಿ ($1)', |
13342 | 13342 | 'translate-edit-in-other-languages' => 'ಬೇರೆ ಭಾಷೆಗಳಲ್ಲಿ ಸಂದೇಶ', |
Index: trunk/extensions/Translate/specials/SpecialLanguageStats.php |
— | — | @@ -21,7 +21,6 @@ |
22 | 22 | * @ingroup SpecialPage TranslateSpecialPage Stats |
23 | 23 | */ |
24 | 24 | class SpecialLanguageStats extends IncludableSpecialPage { |
25 | | - |
26 | 25 | /** |
27 | 26 | * @var StatsTable |
28 | 27 | */ |
— | — | @@ -80,7 +79,9 @@ |
81 | 80 | |
82 | 81 | public function __construct() { |
83 | 82 | parent::__construct( 'LanguageStats' ); |
| 83 | + |
84 | 84 | global $wgLang; |
| 85 | + |
85 | 86 | $this->target = $wgLang->getCode(); |
86 | 87 | } |
87 | 88 | |
— | — | @@ -99,12 +100,15 @@ |
100 | 101 | $wgOut->addModules( 'ext.translate.messagetable' ); |
101 | 102 | |
102 | 103 | $params = explode( '/', $par ); |
| 104 | + |
103 | 105 | if ( isset( $params[0] ) && trim( $params[0] ) ) { |
104 | 106 | $this->target = $params[0]; |
105 | 107 | } |
| 108 | + |
106 | 109 | if ( isset( $params[1] ) ) { |
107 | 110 | $this->noComplete = (bool)$params[1]; |
108 | 111 | } |
| 112 | + |
109 | 113 | if ( isset( $params[2] ) ) { |
110 | 114 | $this->noEmpty = (bool)$params[2]; |
111 | 115 | } |
— | — | @@ -146,12 +150,14 @@ |
147 | 151 | */ |
148 | 152 | protected function isValidValue( $value ) { |
149 | 153 | $langs = Language::getLanguageNames( false ); |
| 154 | + |
150 | 155 | return isset( $langs[$value] ); |
151 | 156 | } |
152 | 157 | |
153 | 158 | /// Called when the target is unknown. |
154 | 159 | protected function invalidTarget() { |
155 | 160 | global $wgOut; |
| 161 | + |
156 | 162 | $wgOut->wrapWikiMsg( "<div class='error'>$1</div>", 'translate-page-no-such-language' ); |
157 | 163 | } |
158 | 164 | |
— | — | @@ -233,6 +239,7 @@ |
234 | 240 | */ |
235 | 241 | function addWorkflowStatesColumn() { |
236 | 242 | global $wgTranslateWorkflowStates; |
| 243 | + |
237 | 244 | if ( $wgTranslateWorkflowStates ) { |
238 | 245 | $this->states = self::getWorkflowStates(); |
239 | 246 | $this->statemap = array_flip( array_keys( $wgTranslateWorkflowStates ) ); |
— | — | @@ -249,11 +256,13 @@ |
250 | 257 | */ |
251 | 258 | function getWorkflowStateCell( $target ) { |
252 | 259 | global $wgTranslateWorkflowStates; |
| 260 | + |
253 | 261 | if ( $wgTranslateWorkflowStates ) { |
254 | 262 | $state = isset( $this->states[$target] ) ? $this->states[$target] : ''; |
255 | 263 | $sort = isset( $this->statemap[$state] ) ? $this->statemap[$state] + 1 : -1; |
256 | 264 | $stateMessage = wfMessage( "translate-workflow-state-$state" ); |
257 | 265 | $stateText = $stateMessage->isBlank() ? $state : $stateMessage->text(); |
| 266 | + |
258 | 267 | return "\n\t\t" . $this->table->element( |
259 | 268 | $stateText, |
260 | 269 | isset( $wgTranslateWorkflowStates[$state] ) ? $wgTranslateWorkflowStates[$state] : '', |
— | — | @@ -296,14 +305,16 @@ |
297 | 306 | $out .= Html::closeElement( 'tfoot' ); |
298 | 307 | |
299 | 308 | $out .= Html::closeElement( 'table' ); |
| 309 | + |
300 | 310 | return $out; |
301 | 311 | } else { |
302 | 312 | $this->nothing = true; |
| 313 | + |
303 | 314 | return ''; |
304 | 315 | } |
305 | 316 | |
306 | | - /// @todo: Allow extra message here, once total translated volume goes |
307 | | - /// over a certain percentage? (former live hack at translatewiki) |
| 317 | + /// @todo Allow extra message here, once total translated volume goes |
| 318 | + /// over a certain percentage? (former live hack at translatewiki) |
308 | 319 | /// if ( $this->totals['2'] && ( $this->totals['1'] / $this->totals['2'] ) > 0.95 ) { |
309 | 320 | /// $out .= wfMessage( 'translate-somekey' ); |
310 | 321 | /// } |
— | — | @@ -323,10 +334,12 @@ |
324 | 335 | $out = ''; |
325 | 336 | $top = array_shift( $item ); |
326 | 337 | $out .= $this->makeGroupRow( $top, $cache, $parent === '' ? true : $parent ); |
| 338 | + |
327 | 339 | foreach ( $item as $subgroup ) { |
328 | 340 | $parents = trim( $parent . ' ' . $top->getId() ); |
329 | 341 | $out .= $this->makeGroupGroup( $subgroup, $cache, $parents ); |
330 | 342 | } |
| 343 | + |
331 | 344 | return $out; |
332 | 345 | } |
333 | 346 | |
— | — | @@ -377,6 +390,7 @@ |
378 | 391 | |
379 | 392 | $rowParams = array(); |
380 | 393 | $rowParams['data-groupid'] = $groupId; |
| 394 | + |
381 | 395 | if ( is_string( $parent ) ) { |
382 | 396 | $rowParams['data-parentgroups'] = $parent; |
383 | 397 | } elseif ( $parent === true ) { |
— | — | @@ -390,6 +404,7 @@ |
391 | 405 | $out .= $this->getWorkflowStateCell( $groupId ); |
392 | 406 | |
393 | 407 | $out .= "\n\t" . Html::closeElement( 'tr' ) . "\n"; |
| 408 | + |
394 | 409 | return $out; |
395 | 410 | } |
396 | 411 | |
— | — | @@ -413,10 +428,13 @@ |
414 | 429 | array( $targetCol => $this->target ), |
415 | 430 | __METHOD__ |
416 | 431 | ); |
| 432 | + |
417 | 433 | $states = array(); |
| 434 | + |
418 | 435 | foreach ( $res as $row ) { |
419 | 436 | $states[$row->$selectKey] = $row->tgr_state; |
420 | 437 | } |
| 438 | + |
421 | 439 | return $states; |
422 | 440 | } |
423 | 441 | } |
Index: trunk/extensions/Translate/TranslateUtils.php |
— | — | @@ -319,7 +319,7 @@ |
320 | 320 | $out->addModules( 'ext.translate.helplink' ); |
321 | 321 | $text = wfMessage( 'translate-gethelp' )->escaped(); |
322 | 322 | |
323 | | - if( $overrideBaseUrl ) { |
| 323 | + if ( $overrideBaseUrl ) { |
324 | 324 | $helpUrl = $to; |
325 | 325 | } else { |
326 | 326 | $helpUrl = "//www.mediawiki.org/wiki/Special:MyLanguage/$to"; |
Index: trunk/extensions/Translate/Groups.php |
— | — | @@ -686,8 +686,8 @@ |
687 | 687 | } |
688 | 688 | return $messages; |
689 | 689 | } |
690 | | - |
691 | 690 | |
| 691 | + |
692 | 692 | public function initCollection( $code ) { |
693 | 693 | $messages = $this->loadMessagesFromCache( $this->getGroups() ); |
694 | 694 | $namespace = $this->getNamespace(); |
Index: trunk/extensions/Translate/api/ApiTTMServer.php |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | |
41 | 41 | protected function getAvailableTranslationServices() { |
42 | 42 | global $wgTranslateTranslationServices; |
43 | | - |
| 43 | + |
44 | 44 | $good = array(); |
45 | 45 | foreach ( $wgTranslateTranslationServices as $id => $config ) { |
46 | 46 | if ( $config['type'] === 'ttmserver' && $config['public'] === true ) { |
Index: trunk/extensions/Translate/resources/ext.translate.quickedit.js |
— | — | @@ -129,7 +129,7 @@ |
130 | 130 | var height = $( window ).height() * 0.7; |
131 | 131 | dialogwidth = $( window ).width() * 0.8; |
132 | 132 | mw.util.addCSS( "/* Inserted by ext.translate.quickedit */\n" + |
133 | | - ".mw-sp-translate-edit-fields {\n" + |
| 133 | + ".mw-sp-translate-edit-fields {\n" + |
134 | 134 | "\tmax-height: " + height + "px;\n" + |
135 | 135 | "\toverflow: auto\n}\n" |
136 | 136 | ); |