Index: trunk/extensions/Translate/scripts/groupStatistics.php |
— | — | @@ -3,8 +3,10 @@ |
4 | 4 | * Statistics about message groups. |
5 | 5 | * |
6 | 6 | * @author Niklas Laxstrom |
| 7 | + * @author Siebrand Mazeland |
7 | 8 | * |
8 | 9 | * @copyright Copyright © 2007-2008, Niklas Laxström |
| 10 | + * @copyright Copyright © 2009, Siebrand Mazeland |
9 | 11 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
10 | 12 | * @file |
11 | 13 | */ |
— | — | @@ -178,6 +180,13 @@ |
179 | 181 | } |
180 | 182 | } |
181 | 183 | |
| 184 | +// check if l10n should be done |
| 185 | +$l10n = false; |
| 186 | +if( ( $options['output'] == 'wiki' || $options['output'] == 'default' ) && |
| 187 | + !isset( $options['nol10n'] ) ) { |
| 188 | + $l10n = true; |
| 189 | +} |
| 190 | + |
182 | 191 | // Get groups from input |
183 | 192 | $groups = array(); |
184 | 193 | if( $reportScore ) { |
— | — | @@ -211,17 +220,17 @@ |
212 | 221 | |
213 | 222 | // Add header column for language size |
214 | 223 | if( isset( $options['most'] ) ) { |
215 | | - $out->element( 'Pos.', true ); |
| 224 | + $out->element( ( $l10n ? "{{int:translate-gs-pos" : 'Pos.' ), true ); |
216 | 225 | } |
217 | 226 | $out->element( 'Code', true ); |
218 | | -$out->element( 'Language', true ); |
| 227 | +$out->element( ( $l10n ? "{{int:translate-page-language}}" : 'Language' ), true ); |
219 | 228 | if( ( $options['output'] == 'wiki' || $options['output'] == 'default' ) && |
220 | 229 | isset( $options['continent'] ) ) { |
221 | | - $out->element( 'Continent', true ); |
| 230 | + $out->element( ( $l10n ? "{{int:translate-gs-continent}}" : 'Continent' ), true ); |
222 | 231 | } |
223 | 232 | |
224 | 233 | if( isset( $options['most'] ) && isset( $options['speakers'] ) ) { |
225 | | - $out->element( 'Speakers', true ); |
| 234 | + $out->element( ( $l10n ? "{{int:translate-gs-speakers}}" : 'Speakers' ), true ); |
226 | 235 | } |
227 | 236 | |
228 | 237 | $totalWeight = 0; |
— | — | @@ -229,7 +238,7 @@ |
230 | 239 | foreach( $localisedWeights[$options['most']] as $weight ) { |
231 | 240 | $totalWeight += $weight; |
232 | 241 | } |
233 | | - $out->element( 'Score (' . $totalWeight . ')', true ); |
| 242 | + $out->element( ( $l10n ? "{{int:translate-gs-score}}" : 'Score' ) . ' (' . $totalWeight . ')', true ); |
234 | 243 | } |
235 | 244 | |
236 | 245 | foreach ( $groups as $g ) { |
— | — | @@ -242,7 +251,7 @@ |
243 | 252 | } |
244 | 253 | $out->element( $heading, true ); |
245 | 254 | if ( !$reportScore && isset( $options['fuzzy'] ) ) { |
246 | | - $out->element( 'Fuzzy', true ); |
| 255 | + $out->element( ( $l10n ? "{{int:translate-percentage-fuzzy}}" : 'Fuzzy' ), true ); |
247 | 256 | } |
248 | 257 | } |
249 | 258 | |
— | — | @@ -299,7 +308,6 @@ |
300 | 309 | if ( isset( $options['fuzzy'] ) ) { |
301 | 310 | $rows[$code][] = array( true, $fuzzy, $total ); |
302 | 311 | } |
303 | | - |
304 | 312 | } |
305 | 313 | |
306 | 314 | $cache->commit(); // Do not keep open too long to avoid concurrent access |
— | — | @@ -346,9 +354,7 @@ |
347 | 355 | $out->element( $code ); |
348 | 356 | |
349 | 357 | // Fill language name field |
350 | | - if( ( $options['output'] == 'wiki' || $options['output'] == 'default' ) && |
351 | | - !isset( $options['nol10n'] ) && |
352 | | - function_exists( 'efI18nTagsInit' ) ) { |
| 358 | + if( $l10n && function_exists( 'efI18nTagsInit' ) ) { |
353 | 359 | $out->element( "{{#languagename:" . $code . "}}" ); |
354 | 360 | } else { |
355 | 361 | $out->element( $name ); |
— | — | @@ -358,9 +364,9 @@ |
359 | 365 | if( ( $options['output'] == 'wiki' || $options['output'] == 'default' ) && |
360 | 366 | isset( $options['continent'] ) ) { |
361 | 367 | if( $mostSpokenLanguages[$code][2] == 'multiple' ) { |
362 | | - $continent = ''; |
| 368 | + $continent = ( $l10n ? "{{int:translate-gs-multiple}}" : 'Multiple' ); |
363 | 369 | } else { |
364 | | - $continent = isset( $options['nol10n'] ) ? |
| 370 | + $continent = $l10n ? |
365 | 371 | ucfirst ( $mostSpokenLanguages[$code][2] ) : |
366 | 372 | "{{int:timezoneregion-" . $mostSpokenLanguages[$code][2] . "}}"; |
367 | 373 | } |
— | — | @@ -421,9 +427,9 @@ |
422 | 428 | |
423 | 429 | $out->blockstart(); |
424 | 430 | |
425 | | - $out->element( 'Continent', true ); |
426 | | - $out->element( 'Count', true ); |
427 | | - $out->element( 'Avg. score', true ); |
| 431 | + $out->element( $l10n ? "{{int:translate-gs-continent}}" : 'Continent', true ); |
| 432 | + $out->element( $l10n ? "{{int:translate-gs-count}}" : 'Count', true ); |
| 433 | + $out->element( $l10n ? "{{int:translate-gs-avgscore}}" : 'Avg. score', true ); |
428 | 434 | |
429 | 435 | $out->blockend(); |
430 | 436 | |
— | — | @@ -435,9 +441,9 @@ |
436 | 442 | $out->blockstart(); |
437 | 443 | |
438 | 444 | if( $key == 'multiple' ) { |
439 | | - $out->element( 'Multiple' ); |
| 445 | + $out->element( $l10n ? "{{int:translate-gs-multiple}}" : 'Multiple' ); |
440 | 446 | } else { |
441 | | - $out->element( "{{int:timezoneregion-" . $key . "}}" ); |
| 447 | + $out->element( $l10n ? "{{int:timezoneregion-" . $key . "}}" : ucfirst( $key ) ); |
442 | 448 | } |
443 | 449 | $out->element( $values[0] ); |
444 | 450 | $out->element( number_format( $values[1]/$values[0] ) ); |
— | — | @@ -449,7 +455,7 @@ |
450 | 456 | } |
451 | 457 | |
452 | 458 | $out->blockstart(); |
453 | | - $out->element( 'Total' ); |
| 459 | + $out->element( $l10n ? "{{int:translate-gs-total}}" : 'Total' ); |
454 | 460 | $out->element( $totals[0] ); |
455 | 461 | $out->element( number_format( $totals[1]/$totals[0] ) ); |
456 | 462 | $out->blockend(); |
Index: trunk/extensions/Translate/Translate.i18n.php |
— | — | @@ -308,6 +308,17 @@ |
309 | 309 | Details: $1', |
310 | 310 | |
311 | 311 | 'translate-js-fb' => 'Normal edit', |
| 312 | + |
| 313 | + // scripts/groupStatistics.php related messages |
| 314 | + 'translate-gs-pos' => 'Pos.', |
| 315 | + 'translate-gs-code' => 'Code', |
| 316 | + 'translate-gs-continent' => 'Continent', |
| 317 | + 'translate-gs-speakers' => 'Speakers', |
| 318 | + 'translate-gs-score' => 'Score', |
| 319 | + 'translate-gs-multiple' => 'Multiple', |
| 320 | + 'translate-gs-count' => 'Count', |
| 321 | + 'translate-gs-total' => 'Total', |
| 322 | + 'translate-gs-avgscore' => 'Avg. score', |
312 | 323 | ); |
313 | 324 | |
314 | 325 | /** Message documentation (Message documentation) |