r50664 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50663‎ | r50664 | r50665 >
Date:17:15, 16 May 2009
Author:nikerabbit
Status:ok
Tags:
Comment:
* section -> translation unit
* split outdated legend to different message
* exists() method for message groups
* fixed bugs when subpages are not enabled
* template diffs
* better stylable mark page
Modified paths:
  • /trunk/extensions/Translate/MessageGroups.php (modified) (history)
  • /trunk/extensions/Translate/PageTranslation.i18n.php (modified) (history)
  • /trunk/extensions/Translate/Translate.css (modified) (history)
  • /trunk/extensions/Translate/Translate.php (modified) (history)
  • /trunk/extensions/Translate/TranslateEditAddons.php (modified) (history)
  • /trunk/extensions/Translate/TranslatePage.php (modified) (history)
  • /trunk/extensions/Translate/TranslateTasks.php (modified) (history)
  • /trunk/extensions/Translate/TranslateUtils.php (modified) (history)
  • /trunk/extensions/Translate/groups/MediaWikiExtensions.php (modified) (history)
  • /trunk/extensions/Translate/tag/PageTranslationHooks.php (modified) (history)
  • /trunk/extensions/Translate/tag/SpecialPageTranslation.php (modified) (history)
  • /trunk/extensions/Translate/tag/TPParse.php (modified) (history)
  • /trunk/extensions/Translate/tag/TranslatablePage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/TranslatePage.php
@@ -221,7 +221,9 @@
222222 $groups = MessageGroups::singleton()->getGroups();
223223 $selector = new HTMLSelector( 'group', 'group', $this->options['group'] );
224224 foreach ( $groups as $id => $class ) {
225 - $selector->addOption( $class->getLabel(), $id );
 225+ if ( MessageGroups::getGroup( $id )->exists() ) {
 226+ $selector->addOption( $class->getLabel(), $id );
 227+ }
226228 }
227229 wfMemOut( __METHOD__ );
228230 return $selector->getHTML();
@@ -350,6 +352,7 @@
351353 $structure = array();
352354
353355 foreach ( $groups as $id => $o ) {
 356+ if ( !MessageGroups::getGroup( $id )->exists() ) continue;
354357 foreach ( $wgTranslateGroupStructure as $pattern => $hypergroup ) {
355358 if ( preg_match( $pattern, $id ) ) {
356359 // Emulate deepArraySet, because AFAIK php doesn't have one
@@ -395,7 +398,6 @@
396399 public function formatGroupInformation( $blocks, $level = 2 ) {
397400 global $wgUser;
398401
399 -
400402 if ( is_array( $blocks ) ) {
401403 $block = array_shift( $blocks );
402404 } else {
Index: trunk/extensions/Translate/Translate.css
@@ -108,4 +108,20 @@
109109
110110 .mw-pt-languages-list {
111111 padding: 0.5em;
112 -}
\ No newline at end of file
 112+}
 113+
 114+.mw-tpt-sp-legend {
 115+ font-weight: bold;
 116+}
 117+
 118+.mw-tpt-sp-content {
 119+ font-size: small;
 120+ padding-left: 2em;
 121+ padding-right: 2em;
 122+ padding-bottom: 1ex;
 123+}
 124+
 125+.mw-tpt-sp-markform .diff-lineno, .mw-sp-translate-edit-fields .diff-lineno {
 126+ /* Ideally there should be no line numbers in the first place */
 127+ display:none;
 128+}
Index: trunk/extensions/Translate/MessageGroups.php
@@ -233,6 +233,11 @@
234234 public static function factory( $label, $id ) {
235235 return null;
236236 }
 237+
 238+ // Can be overwritten to retun false if something is wrong
 239+ public function exists() {
 240+ return true;
 241+ }
237242 }
238243
239244 class CoreMessageGroup extends MessageGroup {
@@ -395,6 +400,10 @@
396401 $writer->variableName = $this->getVariableName();
397402 return $writer;
398403 }
 404+
 405+ public function exists() {
 406+ return is_readable( $this->getMessageFileWithPath( 'en' ) );
 407+ }
399408 }
400409
401410 class AliasMessageGroup extends ExtensionMessageGroup {
@@ -614,7 +623,6 @@
615624 ksort( $defs );
616625 $new_defs = array();
617626 foreach ( $defs as $k => $v ) $new_defs[$prefix.$k] = $v;
618 -
619627 return $new_defs;
620628 }
621629
Index: trunk/extensions/Translate/tag/TranslatablePage.php
@@ -301,8 +301,9 @@
302302 $temp[$collection->code] = sprintf( '%.2f', $percent );
303303
304304 }
305 - // English is always up-to-date
306 - $temp['en'] = 1.00;
 305+ // Content language is always up-to-date
 306+ global $wgContLang;
 307+ $temp[$wgContLang->getCode()] = 1.00;
307308
308309 $wgMemc->set( $memcKey, $temp, 60*60*12 );
309310 return $temp;
@@ -361,23 +362,33 @@
362363 }
363364
364365 protected function getTagId( $tag ) {
 366+ $validTags = array( 'tp:mark', 'tp:tag', 'tp:transver' );
 367+ if ( !in_array( $tag, $validTags ) ) {
 368+ throw new MWException( "Invalid tag $tag requested");
 369+ }
 370+
 371+ // Simple static cache
365372 static $tagcache = array();
366 - if ( !isset($tagcache[$tag]) ) {
 373+
 374+ if ( !count($tagcache) ) {
367375 $db = wfGetDB( DB_SLAVE );
368 - $tagcache[$tag] = $db->selectField(
 376+ $res = $db->select(
369377 'revtag_type', // Table
370 - 'rtt_id', // Field
371 - array( 'rtt_name' => $tag ), // Conds
 378+ array( 'rtt_name', 'rtt_id' ),
 379+ array( 'rtt_name' => $validTags ),
372380 __METHOD__
373381 );
 382+ foreach ( $res as $r ) {
 383+ $tagcache[$r->rtt_name] = $r->rtt_id;
 384+ }
374385 }
375386 return $tagcache[$tag];
376387 }
377388
378389 public static function isTranslationPage( Title $title ) {
379 - if ( $title->getText() === $title->getBaseText() ) return false;
380 -
381 - $newtitle = self::changeTitleText( $title, $title->getBaseText() );
 390+ list( $key, $code ) = TranslateUtils::figureMessage( $title->getText() );
 391+ if ( $key === '' || $code === '' ) return false;
 392+ $newtitle = self::changeTitleText( $title, $key );
382393 if ( !$newtitle ) return false;
383394 $page = TranslatablePage::newFromTitle( $newtitle );
384395
Index: trunk/extensions/Translate/tag/SpecialPageTranslation.php
@@ -11,10 +11,6 @@
1212 SpecialPage::SpecialPage( 'PageTranslation' );
1313 }
1414
15 - /**
16 - * Access point for this special page.
17 - * GLOBALS: $wgHooks, $wgOut.
18 - */
1915 public function execute( $parameters ) {
2016 wfLoadExtensionMessages( 'PageTranslation' );
2117 $this->setHeaders();
@@ -89,7 +85,7 @@
9086 $num = $wgLang->formatNum( $page->getParse()->countSections() );
9187 $link = SpecialPage::getTitleFor( 'Translate' )->getFullUrl(
9288 array( 'group' => 'page|' . $page->getTitle()->getPrefixedText() ) );
93 - $wgOut->addHTML( wfMsgExt( 'tpt-saveok', array('parse'), $titleText, $num, $link ) );
 89+ $wgOut->addWikiMsg( 'tpt-saveok',$titleText, $num, $link );
9490 }
9591
9692 public function loadPagesFromDB() {
@@ -239,23 +235,34 @@
240236 }
241237
242238 public function showPage( TranslatablePage $page, $sections ) {
243 - global $wgOut, $wgScript;
 239+ global $wgOut, $wgScript, $wgLang;
244240
 241+ $wgOut->setSubtitle( $this->user->getSkin()->link( $page->getTitle() ) );
 242+ TranslateUtils::injectCSS();
245243
246244 $wgOut->addWikiMsg( 'tpt-showpage-intro' );
247245
 246+ $formParams = array(
 247+ 'method' => 'post',
 248+ 'action' => $this->getTitle()->getFullURL(),
 249+ 'class' => 'mw-tpt-sp-markform'
 250+ );
 251+
248252 $wgOut->addHTML(
249 - Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getFullURL() ) ) .
 253+ Xml::openElement( 'form', $formParams ) .
250254 Xml::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
251255 Xml::hidden( 'revision', $page->getRevision() ) .
252256 Xml::hidden( 'target', $page->getTitle()->getPrefixedtext() )
253257 );
254258
 259+ $wgOut->wrapWikiMsg( '==$1==', 'tpt-sections-oldnew' );
 260+
255261 foreach ( $sections as $s ) {
256262 if ( $s->type === 'new' ) {
257 - $name = wfMsgHtml('tpt-section-new') . ' ' . Xml::input( 'tpt-sect-' . $s->id, 10, $s->name );
 263+ $input = Xml::input( 'tpt-sect-' . $s->id, 10, $s->name );
 264+ $name = wfMsgHtml( 'tpt-section-new', $input );
258265 } else {
259 - $name = wfMsgHtml('tpt-section') . ' ' . htmlspecialchars( $s->name );
 266+ $name = wfMsgHtml( 'tpt-section', htmlspecialchars($s->name) );
260267 }
261268
262269 if ( $s->type === 'changed' ) {
@@ -267,33 +274,61 @@
268275 $text = TranslateUtils::convertWhiteSpaceToHTML( $s->getText() );
269276 }
270277
271 - $wgOut->addHTML(
272 - Xml::openElement( 'fieldset' ) .
273 - Xml::tags( 'legend', null, $name ) .
274 - $text .
275 - Xml::closeElement( 'fieldset' )
276 - );
 278+ $this->makeSectionElement( $name, $s->type, $text );
277279 }
278280
279281 $deletedSections = $page->getParse()->getDeletedSections();
280 - if ( $num = count($deletedSections) ) {
281 - $wgOut->addiHTML( wfMsgExt( 'tpt-deletedsections', array('parse'), $num ) );
 282+ if ( count($deletedSections) ) {
 283+ $wgOut->wrapWikiMsg( '==$1==', 'tpt-sections-deleted' );
282284 foreach ( $deletedSections as $s ) {
283 - $name = htmlspecialchars( $s->id );
284 - $wgOut->addHTML(
285 - Xml::openElement( 'fieldset' ) .
286 - Xml::tags( 'legend', null, wfMsgHtml('tpt-section') . ' ' . $name ) .
287 - TranslateUtils::convertWhiteSpaceToHTML( $s->getText() ) .
288 - Xml::closeElement( 'fieldset' )
289 - );
 285+ $name = wfMsgHtml( 'tpt-section-deleted', htmlspecialchars($s->id) );
 286+ $text = TranslateUtils::convertWhiteSpaceToHTML( $s->getText() );
 287+ $this->makeSectionElement( $name, $s->type, $text );
290288 }
291289 }
 290+
 291+ // Display template changes if applicable
 292+ if ( $page->getMarkedTag() !== false ) {
 293+
 294+ $newTemplate = $page->getParse()->getTemplatePretty();
 295+ $oldPage = TranslatablePage::newFromRevision( $page->getTitle(), $page->getMarkedTag() );
 296+ $oldTemplate = $oldPage->getParse()->getTemplatePretty();
 297+
 298+ if ( $oldTemplate !== $newTemplate ) {
 299+ $wgOut->wrapWikiMsg( '==$1==', 'tpt-sections-template' );
 300+
 301+ $diff = new DifferenceEngine;
 302+ $diff->setText( $oldTemplate, $newTemplate );
 303+ $text = $diff->getDiff( wfMsgHtml('tpt-diff-old'), wfMsgHtml('tpt-diff-new') );
 304+ $diff->showDiffStyle();
 305+
 306+ $contentParams = array( 'class' => 'mw-tpt-sp-content' );
 307+ $wgOut->addHTML( Xml::tags( 'div', $contentParams, $text ) );
 308+ }
 309+ }
 310+
292311 $wgOut->addHTML(
293312 Xml::submitButton( wfMsg( 'tpt-submit' ) ) .
294313 Xml::closeElement( 'form' )
295314 );
296315 }
297316
 317+ protected function makeSectionElement( $legend, $type, $content ) {
 318+ global $wgOut;
 319+
 320+ $containerParams = array( 'class' => "mw-tpt-sp-section mw-tpt-sp-section-type-{$type}" );
 321+ $legendParams = array( 'class' => 'mw-tpt-sp-legend' );
 322+ $contentParams = array( 'class' => 'mw-tpt-sp-content' );
 323+
 324+ $wgOut->addHTML(
 325+ Xml::tags( 'div', $containerParams,
 326+ Xml::tags( 'div', $legendParams, $legend ) .
 327+ Xml::tags( 'div', $contentParams, $content )
 328+ )
 329+ );
 330+ }
 331+
 332+
298333 public function markForTranslation( TranslatablePage $page, $sections ) {
299334 $text = $page->getParse()->getSourcePageText();
300335
Index: trunk/extensions/Translate/tag/TPParse.php
@@ -26,6 +26,16 @@
2727 return $this->template;
2828 }
2929
 30+ public function getTemplatePretty() {
 31+ $text = $this->template;
 32+ $sections = $this->getSectionsForSave();
 33+ foreach ( $sections as $ph => $s ) {
 34+ $text = str_replace( $ph, "<!--T:{$s->id}-->", $text );
 35+ }
 36+ return $text;
 37+
 38+ }
 39+
3040 public function getSectionsForSave() {
3141 $this->loadFromDatabase();
3242
Index: trunk/extensions/Translate/tag/PageTranslationHooks.php
@@ -142,10 +142,9 @@
143143 // Check if this is a source page or a translation page
144144 $page = TranslatablePage::newFromTitle( $title );
145145 if ( $page->getMarkedTag() === false ) {
146 - $title = Title::makeTitle( $title->getNamespace(), $title->getBaseText() );
147 - $page = TranslatablePage::newFromTitle( $title );
 146+ $page = TranslatablePage::isTranslationPage( $title );
148147 }
149 - if ( $page->getMarkedTag() === false ) return '';
 148+ if ( $page === false || $page->getMarkedTag() === false ) return '';
150149
151150
152151 $status = $page->getTranslationPercentages();
@@ -248,7 +247,6 @@
249248
250249 // Here we disable editing of some existing or unknown pages
251250 public static function translationsCheck( $title, $user, $action, &$result ) {
252 -
253251 // Case 1: Unknown section translations
254252 if ( $title->getNamespace() == NS_TRANSLATIONS && $action === 'edit' ) {
255253 $group = MessageIndex::titleToGroup( $title );
@@ -260,13 +258,13 @@
261259 return false;
262260 }
263261
264 - // Case 2: Target pages
265 - } elseif( $title->getBaseText() != $title->getText() ) {
266 - $newtitle = Title::makeTitle( $title->getNamespace(), $title->getBaseText() );
 262+ return true;
 263+ }
267264
268 - // Base page does not exists, cannot be translatable page
269 - if ( !$newtitle || !$newtitle->exists() ) return true;
270265
 266+ // Case 2: Target pages
 267+ $page = TranslatablePage::isTranslationPage( $title );
 268+ if ( $page !== false ) {
271269 // Local override of fuzzybot is allowed
272270 global $wgTranslateFuzzyBotName;
273271 if ( self::$allowTargetEdit ||
@@ -346,13 +344,23 @@
347345 $actions[] = $sk->link( $translate, $linkDesc, array(), $par);
348346 }
349347
350 - if ( $canmark && $wgUser->isAllowed('pagetranslation') ) {
351 - $par = array(
352 - 'target' => $title->getPrefixedText()
353 - );
 348+ if ( $canmark ) {
 349+ $diffUrl = $title->getFullUrl( array( 'diff' => $ready ) );
 350+ $par = array( 'target' => $title->getPrefixedText() );
354351 $translate = SpecialPage::getTitleFor( 'PageTranslation' );
355 - $linkDesc = wfMsgHtml( 'translate-tag-markthis' );
356 - $actions[] = $sk->link( $translate, $linkDesc, array(), $par);
 352+
 353+ if ( $wgUser->isAllowed('pagetranslation') ) {
 354+ // This page has never been marked
 355+ if ( $marked === false ) {
 356+ $linkDesc = wfMsgHtml( 'translate-tag-markthis' );
 357+ $actions[] = $sk->link( $translate, $linkDesc, array(), $par);
 358+ } else {
 359+ $markUrl = $translate->getFullUrl( $par );
 360+ $actions[] = wfMsgExt( 'translate-tag-markthisagain', 'parseinline', $diffUrl, $markUrl );
 361+ }
 362+ } else {
 363+ $actions[] = wfMsgExt( 'translate-tag-hasnew', 'parseinline', $diffUrl );
 364+ }
357365 }
358366
359367 if ( !count($actions) ) return;
@@ -377,18 +385,27 @@
378386 $page = TranslatablePage::isTranslationPage( $title );
379387 if ( $page === false ) return;
380388
 389+ list( , $code ) = TranslateUtils::figureMessage( $title->getText() );
 390+
381391 // Get the translation percentage
382392 $pers = $page->getTranslationPercentages();
383 - $per = @$pers[$title->getSubpageText()];
 393+ $per = @$pers[$code];
384394 $per = ($per === null) ? 0 : $per * 100;
385395 $titleText = $page->getTitle()->getPrefixedText();
386 - $url = $page->getTranslationUrl( $title->getSubpageText() );
 396+ $url = $page->getTranslationUrl( $code );
387397
388398 // Output
389399 wfLoadExtensionMessages( 'PageTranslation' );
390 - $wrap = '<div style="font-size: x-small; text-align: center">$1</div><hr />';
391 - $wgOut->wrapWikiMsg( $wrap, array( 'tpt-translation-intro', $url, $titleText, $per) );
 400+ $wrap = '<div style="font-size: x-small; text-align: center">$1</div>';
 401+
 402+ $wgOut->wrapWikiMsg( $wrap, array( 'tpt-translation-intro', $url, $titleText, $per) );
392403
 404+ if ( ((int) $per) < 100 ) {
 405+ $wrap = '<div style="font-size: x-small; text-align: center" class="mw-translate-fuzzy">$1</div>';
 406+ $wgOut->wrapWikiMsg( $wrap, array( 'tpt-translation-intro-fuzzy' ) );
 407+ }
 408+ $wgOut->addHTML( '<hr />' );
 409+
393410 }
394411
395412 }
\ No newline at end of file
Index: trunk/extensions/Translate/groups/MediaWikiExtensions.php
@@ -176,7 +176,7 @@
177177 }
178178 }
179179
180 -class AllMediawikiExtensionsGroup extends ExtensionMessageGroup {
 180+class AllMediawikiExtensionsGroup extends MessageGroup {
181181 protected $label = 'MediaWiki extensions';
182182 protected $id = 'ext-0-all';
183183 protected $meta = true;
@@ -201,7 +201,7 @@
202202 if ( $this->classes === null ) {
203203 $this->classes = MessageGroups::singleton()->getGroups();
204204 foreach ( $this->classes as $index => $class ) {
205 - if ( ( strpos( $class->getId(), 'ext-' ) !== 0 ) || $class->isMeta() ) {
 205+ if ( ( strpos( $class->getId(), 'ext-' ) !== 0 ) || $class->isMeta() || !$class->exists() ) {
206206 unset( $this->classes[$index] );
207207 }
208208 }
@@ -250,6 +250,14 @@
251251 }
252252 return $bools;
253253 }
 254+
 255+ public function exists() {
 256+ $this->init();
 257+ foreach ( $this->classes as $class ) {
 258+ if ( $class->exists() ) return true;
 259+ }
 260+ return false;
 261+ }
254262 }
255263
256264 class AllWikiaExtensionsGroup extends AllMediawikiExtensionsGroup {
Index: trunk/extensions/Translate/TranslateEditAddons.php
@@ -399,4 +399,25 @@
400400 TranslateUtils::injectCSS();
401401 return Xml::tags( 'div', array( 'class' => 'mw-sp-translate-edit-fields' ), implode( "\n\n", $boxes ) );
402402 }
 403+
 404+ public static function tabs( $skin, &$tabs ) {
 405+ global $wgTranslateMessageNamespaces;
 406+ $ns = $skin->mTitle->getNamespace();
 407+
 408+ if ( !in_array( $ns, $wgTranslateMessageNamespaces) ) return true;
 409+
 410+ unset( $tabs['protect'] );
 411+
 412+ return true;
 413+ }
 414+
 415+ public static function keepFields( $edit, $out ) {
 416+ global $wgRequest;
 417+ $out->addHTML( "\n" .
 418+ Xml::hidden( 'loadgroup', $wgRequest->getText( 'loadgroup' ) ) .
 419+ Xml::hidden( 'loadtask', $wgRequest->getText( 'loadtask' ) ) .
 420+ "\n"
 421+ );
 422+ return true;
 423+ }
403424 }
Index: trunk/extensions/Translate/Translate.php
@@ -50,6 +50,8 @@
5151 $wgHooks['OutputPageBeforeHTML'][] = 'TranslateEditAddons::addNavigation';
5252 $wgHooks['AlternateEdit'][] = 'TranslateEditAddons::intro';
5353 $wgHooks['EditPageBeforeEditButtons'][] = 'TranslateEditAddons::buttonHack';
 54+$wgHooks['EditPage::showEditForm:fields'][] = 'TranslateEditAddons::keepFields';
 55+$wgHooks['SkinTemplateTabs'][] = 'TranslateEditAddons::tabs';
5456
5557 $wgDefaultUserOptions['translate'] = 0;
5658 $wgHooks['GetPreferences'][] = 'TranslatePreferences::onGetPreferences';
@@ -58,6 +60,7 @@
5961 $wgHooks['SpecialRecentChangesPanel'][] = 'TranslateRcFilter::translationFilterForm';
6062 $wgHooks['SkinTemplateToolboxEnd'][] = 'TranslateToolbox::toolboxAllTranslations';
6163
 64+
6265 $wgEnablePageTranslation = false;
6366 $wgPageTranslationNamespace = 1198;
6467
@@ -256,7 +259,7 @@
257260 function efTranslateCheckPT() {
258261 global $wgHooks, $wgMemc;
259262
260 - $version = 2;
 263+ $version = "2"; // Must be a string
261264 global $wgMemc;
262265 $memcKey = wfMemcKey( 'pt' );
263266 $ok = $wgMemc->get( $memcKey );
Index: trunk/extensions/Translate/TranslateTasks.php
@@ -133,7 +133,8 @@
134134 $this->collection,
135135 $this->group->getId(),
136136 false,
137 - $this->group->namespaces
 137+ $this->group->namespaces,
 138+ $this->getId()
138139 ) .
139140 $tablefooter;
140141 }
@@ -258,7 +259,8 @@
259260 $this->collection,
260261 $this->group->getId(),
261262 true, /* Review mode */
262 - $this->group->namespaces
 263+ $this->group->namespaces,
 264+ $this->getId()
263265 ) .
264266 $tablefooter;
265267 }
Index: trunk/extensions/Translate/PageTranslation.i18n.php
@@ -14,12 +14,19 @@
1515 'pagetranslation' => 'Page translation',
1616 'right-pagetranslation' => 'Mark versions of pages for translation',
1717 'tpt-desc' => 'Extension for translating content pages',
18 - 'tpt-section' => 'Section:',
19 - 'tpt-section-new' => 'New section:',
 18+ 'tpt-section' => 'Translation unit $1',
 19+ 'tpt-section-new' => 'New translation unit. Name: $1',
 20+ 'tpt-section-deleted' => 'Translation unit $1',
 21+ 'tpt-template' => 'Page template',
 22+ 'tpt-templatediff' => 'The page template has changed.',
2023
2124 'tpt-diff-old' => 'Previous text',
2225 'tpt-diff-new' => 'New text',
2326 'tpt-submit' => 'Mark this version for translation',
 27+
 28+ 'tpt-sections-oldnew' => 'New and existing translation units',
 29+ 'tpt-sections-deleted' => 'Deleted translation units',
 30+ 'tpt-sections-template' => 'Translation page template',
2431
2532 # Specific page on the special page
2633 'tpt-badtitle' => 'Page name given ($1) is not a valid title',
@@ -27,10 +34,9 @@
2835 Only latest versions can be marked for translation.',
2936 'tpt-notsuitable' => 'Page $1 is not suitable for translation.
3037 Make sure it has <nowiki><translate></nowiki> tags and has a valid syntax.',
31 - 'tpt-saveok' => 'The page "$1" has been marked up for translation with $2 translatable {{PLURAL:$2|section|sections}}.
 38+ 'tpt-saveok' => 'The page [[$1]] has been marked up for translation with $2 {{PLURAL:$2|translation unit|translation units}}.
3239 The page can now be <span class="plainlinks">[$3 translated]</span>.',
33 - 'tpt-badsect' => '"$1" is not a valid name for section $2.',
34 - 'tpt-deletedsections' => 'The following {{PLURAL:$1|section|sections}} will no longer be used:',
 40+ 'tpt-badsect' => '"$1" is not a valid name for a translation unit $2.',
3541 'tpt-showpage-intro' => 'Below new, existing and deleted sections are listed.
3642 Before marking this version for translation, check that the changes to sections are minimised to avoid unnecessary work for translators.',
3743 'tpt-mark-summary' => 'Marked this version for translation',
@@ -42,15 +48,17 @@
4349 'tpt-old-pages' => 'Some version of {{PLURAL:$1|this page has|these pages have}} been marked for translation.',
4450 'tpt-new-pages' => '{{PLURAL:$1|This page contains|These pages contain}} text with translation tags, but no version of {{PLURAL:$1|this page is|these pages are}} currently marked for translation.',
4551 'tpt-rev-latest' => 'latest version',
46 - 'tpt-rev-old' => 'version $1',
 52+ 'tpt-rev-old' => 'difference to previous marked version',
4753 'tpt-rev-mark-new' => 'mark this version for translation',
4854 'tpt-translate-this' => 'translate this page',
4955
5056 # Source and translation page headers
5157 'translate-tag-translate-link-desc' => 'Translate this page',
5258 'translate-tag-markthis' => 'Mark this page for translation',
53 - 'tpt-translation-intro' => 'This page is a <span class="plainlinks">[$1 translated version]</span> of a page [[$2]] and the translation is $3% complete and up to date.
54 -<span class="mw-translate-fuzzy">Outdated translations are marked like this.</span>',
 59+ 'translate-tag-markthisagain' => 'This page has <span class="plainlinks">[$1 changes]</span> since it was last <span class="plainlinks">[$2 marked for translation]</span>.',
 60+ 'translate-tag-hasnew' => 'This page contains <span class="plainlinks">[$1 changes]</span> which are not marked for translation.',
 61+ 'tpt-translation-intro' => 'This page is a <span class="plainlinks">[$1 translated version]</span> of a page [[$2]] and the translation is $3% complete and up to date.',
 62+ 'tpt-translation-intro-fuzzy' => 'Outdated translations are marked like this.',
5563
5664 'tpt-languages-legend' => 'Other languages:',
5765
@@ -71,7 +79,6 @@
7280 'tpt-saveok' => '$1 is a page title,
7381 $2 is a count of sections which can be used with PLURAL,
7482 $3 is an URL.',
75 - 'tpt-deletedsections' => '$1 is a count of sections.',
7683 'tpt-old-pages' => 'The words "some version" refer to "one version of the page", or "a single version of each of the pages", respectively. Each page can have either one or none of its versions marked for translaton.',
7784 'tpt-rev-old' => '{{Identical|Version}}',
7885 );
Index: trunk/extensions/Translate/TranslateUtils.php
@@ -159,8 +159,9 @@
160160 return $tableheader;
161161 }
162162
 163+ // Todo: extract to own class
163164 public static function makeListing( MessageCollection $messages, $group,
164 - $review = false, array $namespaces ) {
 165+ $review = false, array $namespaces, $task = '' ) {
165166
166167 global $wgUser;
167168 $sk = $wgUser->getSkin();
@@ -196,7 +197,8 @@
197198 array(),
198199 array(
199200 'action' => 'edit',
200 - 'loadgroup' => $group
 201+ 'loadgroup' => $group,
 202+ 'loadtask' => $task
201203 ),
202204 'known'
203205 );

Follow-up revisions

RevisionCommit summaryAuthorDate
r50665* Bugfix for r50664.nikerabbit17:27, 16 May 2009

Status & tagging log