Index: trunk/extensions/Translate/Translate.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
13 | 13 | */ |
14 | 14 | |
15 | | -define( 'TRANSLATE_VERSION', '9 (2008-11-24:2)' ); |
| 15 | +define( 'TRANSLATE_VERSION', '9 (2008-12-07)' ); |
16 | 16 | |
17 | 17 | $wgExtensionCredits['specialpage'][] = array( |
18 | 18 | 'name' => 'Translate', |
Index: trunk/extensions/Translate/scripts/autoexport.php |
— | — | @@ -37,7 +37,11 @@ |
38 | 38 | } |
39 | 39 | |
40 | 40 | if ( isset( $options['hours'] ) ) { |
41 | | - $hours = $options['hours']; |
| 41 | + $hours = intval($options['hours']); |
| 42 | + if ( !$hours ) { |
| 43 | + STDERR( "Invalid duration given, defaulting to 24 hours" ); |
| 44 | + $hours = 24; |
| 45 | + } |
42 | 46 | } else { |
43 | 47 | showUsage(); |
44 | 48 | } |
Index: trunk/extensions/Translate/TranslateTasks.php |
— | — | @@ -294,6 +294,7 @@ |
295 | 295 | |
296 | 296 | public function output() { |
297 | 297 | $writer = $this->group->getWriter(); |
| 298 | + $this->collection->filter( 'translation', null ); |
298 | 299 | return $writer->webExport( $this->collection ); |
299 | 300 | } |
300 | 301 | } |
Index: trunk/extensions/Translate/MessageChecks.php |
— | — | @@ -20,6 +20,7 @@ |
21 | 21 | 'checkLinks', |
22 | 22 | 'checkXHTML', |
23 | 23 | 'checkPagename', |
| 24 | + 'miscMWChecks', |
24 | 25 | ), |
25 | 26 | 'freecol' => array( |
26 | 27 | 'checkFreeColMissingVars', |
— | — | @@ -303,6 +304,32 @@ |
304 | 305 | } |
305 | 306 | |
306 | 307 | /** |
| 308 | + * Checks for some micellangelous messages with special syntax. |
| 309 | + * |
| 310 | + * @param $message Instance of TMessage. |
| 311 | + * @return True if namespace has been tampered with. |
| 312 | + */ |
| 313 | + protected function miscMWChecks( TMessage $message, $code, &$desc = null ) { |
| 314 | + $timeList = array( 'Protect-expiry-options', 'Ipboptions' ); |
| 315 | + if ( in_array( $message->key, $timeList, true ) ) { |
| 316 | + $defArray = explode( ',', $message->definition ); |
| 317 | + $traArray = explode( ',', $message->translation ); |
| 318 | + if ( count($defArray) !== count($traArray) ) { |
| 319 | + $desc = array( 'translate-checks-format', 'Parameter count' ); |
| 320 | + return true; |
| 321 | + } |
| 322 | + for ( $i = 0; $i < count($defArray); $i++ ) { |
| 323 | + $defItems = array_map( 'trim', explode( ':', $defArray[$_] ) ); |
| 324 | + if ( !isset($traArray[$_]) ) return true; |
| 325 | + $traItems = array_map( 'trim', explode( ':', $traArray[$_] ) ); |
| 326 | + if ( count($traItems) !== 2 ) return true; |
| 327 | + if ( $traItems[1] !== $defItems[1] ) return true; |
| 328 | + } |
| 329 | + } |
| 330 | + return false; |
| 331 | + } |
| 332 | + |
| 333 | + /** |
307 | 334 | * Checks for translations not containing vars %xx% that are in the |
308 | 335 | * definition. |
309 | 336 | * |
Index: trunk/extensions/Translate/README |
— | — | @@ -33,6 +33,7 @@ |
34 | 34 | </code> |
35 | 35 | |
36 | 36 | == Changes in version 10 == |
| 37 | +* 2008-12-07 bug in export to file in web interface caused empty translations to be exported |
37 | 38 | * 2008-11-30:1 added Special:LanguageStats for real-time translation statistics |
38 | 39 | * 2008-11-24:2 fallback messages in the edit screen now have an edit link |
39 | 40 | * 2008-11-24:1 added Special:Translations to show all translations of a message |
Index: trunk/extensions/Translate/Translate.i18n.php |
— | — | @@ -121,6 +121,7 @@ |
122 | 122 | <strong><nowiki>$1</nowiki></strong>', |
123 | 123 | 'translate-checks-plural' => 'Definition uses <nowiki>{{PLURAL:}}</nowiki> but translation does not.', |
124 | 124 | 'translate-checks-pagename' => 'Namespace changed from the definition', |
| 125 | + 'translate-checks-format' => 'This translation does not follow the definition or has invalid syntax: $1', |
125 | 126 | |
126 | 127 | 'tog-translate-nonewsletter' => 'Do not send me e-mail newsletters (relevant only for users with a confirmed e-mail address)', |
127 | 128 | 'right-translate' => 'Edit using the translate interface', |