Index: trunk/extensions/Translate/tag/SpecialPageTranslation.php |
— | — | @@ -15,14 +15,13 @@ |
16 | 16 | } |
17 | 17 | |
18 | 18 | public function execute( $parameters ) { |
19 | | - wfLoadExtensionMessages( 'PageTranslation' ); |
20 | 19 | $this->setHeaders(); |
21 | 20 | |
22 | 21 | global $wgRequest, $wgOut, $wgUser; |
23 | 22 | $this->user = $wgUser; |
24 | 23 | |
25 | 24 | $target = $wgRequest->getText( 'target', $parameters ); |
26 | | - $revision = $wgRequest->getText( 'revision', 0 ); |
| 25 | + $revision = $wgRequest->getInt( 'revision', 0 ); |
27 | 26 | |
28 | 27 | // No specific page or invalid input |
29 | 28 | $title = Title::newFromText( $target ); |
— | — | @@ -42,24 +41,27 @@ |
43 | 42 | } |
44 | 43 | |
45 | 44 | // We are processing some specific page |
46 | | - if ( $revision === '0' ) { |
| 45 | + if ( !$title->exists() ) { |
| 46 | + $wgOut->addWikiMsg( 'tpt-nosuchpage', $title->getPrefixedText() ); |
| 47 | + return; |
| 48 | + } |
| 49 | + |
| 50 | + if ( $revision === 0 ) { |
47 | 51 | // Get the latest revision |
48 | 52 | $revision = $title->getLatestRevID(); |
49 | | - } elseif ( $revision !== $title->getLatestRevID() ) { |
50 | | - // We do want to notify the reviewer if the underlying page changes during review |
51 | | - $wgOut->addWikiMsg( 'tpt-oldrevision', $title->getPrefixedText(), $revision ); |
52 | | - $this->listPages(); |
53 | | - return; |
54 | 53 | } |
55 | | - |
56 | 54 | $page = TranslatablePage::newFromRevision( $title, $revision ); |
57 | | - |
58 | 55 | if ( !$page instanceof TranslatablePage ) { |
59 | 56 | $wgOut->addWikiMsg( 'tpt-notsuitable', $title->getPrefixedText(), $revision ); |
60 | | - $this->listPages(); |
61 | 57 | return; |
62 | 58 | } |
63 | 59 | |
| 60 | + if ( $revision !== $title->getLatestRevID() ) { |
| 61 | + // We do want to notify the reviewer if the underlying page changes during review |
| 62 | + $wgOut->addWikiMsg( 'tpt-oldrevision', $title->getPrefixedText(), $revision ); |
| 63 | + return; |
| 64 | + } |
| 65 | + |
64 | 66 | $lastrev = $page->getMarkedTag(); |
65 | 67 | if ( $lastrev !== false && $lastrev === $revision ) { |
66 | 68 | $wgOut->addWikiMsg( 'tpt-already-marked' ); |
Index: trunk/extensions/Translate/tag/TPParse.php |
— | — | @@ -89,7 +89,7 @@ |
90 | 90 | |
91 | 91 | $res = $db->select( $tables, $vars, $conds, __METHOD__ ); |
92 | 92 | foreach ( $res as $r ) { |
93 | | - $section = new TPsection; |
| 93 | + $section = new TPSection; |
94 | 94 | $section->id = $r->trs_key; |
95 | 95 | $section->text = $r->trs_text; |
96 | 96 | $section->type = 'db'; |
Index: trunk/extensions/Translate/PageTranslation.i18n.php |
— | — | @@ -31,6 +31,7 @@ |
32 | 32 | |
33 | 33 | # Specific page on the special page |
34 | 34 | 'tpt-badtitle' => 'Page name given ($1) is not a valid title', |
| 35 | + 'tpt-nosuchpage' => 'Page $1 does not exist', |
35 | 36 | 'tpt-oldrevision' => '$2 is not the latest version of the page [[$1]]. |
36 | 37 | Only latest versions can be marked for translation.', |
37 | 38 | 'tpt-notsuitable' => 'Page $1 is not suitable for translation. |
— | — | @@ -2458,9 +2459,6 @@ |
2459 | 2460 | 'tpt-install' => 'Запустите php-скрипт maintenance/update.php или веб-установку, чтобы включить возможность перевода страниц.', |
2460 | 2461 | 'tpt-render-summary' => 'Обновление для соответствия новой версии исходной страницы.', |
2461 | 2462 | 'tpt-download-page' => 'Экспортировать страницу с переводами', |
2462 | | - 'pt-shake-multiple' => 'Несколько маркеров раздела в одном разделе. |
2463 | | -Текст раздела: |
2464 | | -$1', |
2465 | 2463 | ); |
2466 | 2464 | |
2467 | 2465 | /** Rusyn (русиньскый язык) |