Index: trunk/extensions/Translate/tag/RenderJob.php |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | function run() { |
36 | 36 | // Initialization |
37 | 37 | $title = $this->title; |
38 | | - list( $key, $code ) = TranslateUtils::figureMessage( $title->getPrefixedText() ); |
| 38 | + list( , $code ) = TranslateUtils::figureMessage( $title->getPrefixedText() ); |
39 | 39 | |
40 | 40 | // Return the actual translation page... |
41 | 41 | $page = TranslatablePage::isTranslationPage( $title ); |
— | — | @@ -44,7 +44,7 @@ |
45 | 45 | throw new MWException( "Oops, this should not happen!" ); |
46 | 46 | } |
47 | 47 | |
48 | | - $group = MessageGroups::getGroup( "page|$key" ); |
| 48 | + $group = $page->getMessageGroup(); |
49 | 49 | $collection = $group->initCollection( $code ); |
50 | 50 | |
51 | 51 | $text = $page->getParse()->getTranslationPageText( $collection ); |
— | — | @@ -59,19 +59,10 @@ |
60 | 60 | // @todo Fuzzybot hack |
61 | 61 | PageTranslationHooks::$allowTargetEdit = true; |
62 | 62 | |
63 | | - // User hack |
64 | | - global $wgUser; |
65 | | - |
66 | | - $oldUser = $wgUser; |
67 | | - $wgUser = $user; |
68 | | - |
69 | 63 | // Do the edit |
70 | | - $status = $article->doEdit( $text, $summary, $flags ); |
| 64 | + $status = $article->doEdit( $text, $summary, $flags, false, $user ); |
71 | 65 | SpecialPageTranslation::superDebug( __METHOD__, 'edit', $user, $title, $flags, $status ); |
72 | 66 | |
73 | | - // User hack |
74 | | - $wgUser = $oldUser; |
75 | | - |
76 | 67 | PageTranslationHooks::$allowTargetEdit = false; |
77 | 68 | |
78 | 69 | // purge cache |
Index: trunk/extensions/Translate/tag/SpecialPageTranslation.php |
— | — | @@ -131,7 +131,7 @@ |
132 | 132 | $titleText = $page->getTitle()->getPrefixedText(); |
133 | 133 | $num = $wgLang->formatNum( $page->getParse()->countSections() ); |
134 | 134 | $link = SpecialPage::getTitleFor( 'Translate' )->getFullUrl( |
135 | | - array( 'group' => 'page|' . $page->getTitle()->getPrefixedText() ) ); |
| 135 | + array( 'group' => $page->getMessageGroupId() ) ); |
136 | 136 | |
137 | 137 | $wgOut->addWikiMsg( 'tpt-saveok', $titleText, $num, $link ); |
138 | 138 | } |
— | — | @@ -301,7 +301,7 @@ |
302 | 302 | SpecialPage::getTitleFor( 'Translate' ), |
303 | 303 | wfMsgHtml( 'tpt-translate-this' ), |
304 | 304 | array(), |
305 | | - array( 'group' => 'page|' . $title->getPrefixedText() ) |
| 305 | + array( 'group' => TranslatablePage::getMessageGroupIdFromTitle( $title ) |
306 | 306 | ); |
307 | 307 | } |
308 | 308 | |
— | — | @@ -527,7 +527,7 @@ |
528 | 528 | |
529 | 529 | // Re-generate caches |
530 | 530 | $page->getTranslationPercentages( /*re-generate*/ true ); |
531 | | - ArrayMemoryCache::factory( 'groupstats' )->clearGroup( 'page|' . $page->getTitle()->getPrefixedText() ); |
| 531 | + ArrayMemoryCache::factory( 'groupstats' )->clearGroup( $page->getMessageGroupId() ); |
532 | 532 | MessageIndexRebuilder::execute(); |
533 | 533 | return false; |
534 | 534 | } |