MediaWiki r31185 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r31184‎ | r31185 (on ViewVC)‎ | r31186 >
Date:12:42, 22 February 2008
Author:jojo
Status:old
Tags:
Comment:
use wfLoadExtensionMessages(). prefix message IDs with coll-.
Modified paths:

Diff [purge]

Index: trunk/extensions/Collection/Collection.i18n.php
@@ -21,85 +21,82 @@
2222 * http://www.gnu.org/copyleft/gpl.html
2323 */
2424
25 -$allMessages = array(
26 - 'en' => array(
27 - 'collection' => 'Collection',
28 - 'collections' => 'Collections',
29 -
30 - 'portlet_title' => 'My Collection',
31 - 'add_article' => 'Add article',
32 - 'remove_article' => 'Remove article',
33 - 'add_category' => 'Add category',
34 - 'load_collection' => 'Load collection',
35 - 'show_collection' => 'Show collection',
36 - 'help_collections' => 'Collections help',
37 - 'empty' => 'empty',
38 - 'article' => 'article',
39 - 'articles' => 'articles',
40 - 'download_as_pdf' => 'Download as PDF',
41 - 'noscript_text' => '<noscript><h1>JavaScript is Required!</h1><strong>Your browser does not support JavaScript or JavaScript has been turned off. This page will not work correctly, unless JavaScript is enabled.</strong></noscript>',
42 - 'intro_text' => "You can collect articles, generate and download a PDF file from article collections and save article collections for later use or to share them.\n\nSee [[Help:Collections]] for more information about collections.",
43 -
44 - 'pdftoobigcat' => 'The category contains more than %PARAM% articles, only the first %PARAM% articles can be added to your collection. Do you want to add them?',
45 - 'my_collection' => 'My Collection',
46 - 'download_title' => 'Download Collection as PDF',
47 - 'download_text' => 'To download an automatically generated PDF file of your article collection, click the button.',
48 - 'download_pdf' => 'Download PDF',
49 - 'remove' => 'Remove',
50 - 'move_to_top' => 'Move to top',
51 - 'move_up' => 'Move up',
52 - 'move_down' => 'Move down',
53 - 'move_to_bottom' => 'Move to bottom',
54 - 'title' => 'Title:',
55 - 'subtitle' => 'Subtitle:',
56 - 'contents' => 'Contents',
57 - 'create_chapter' => 'Create new chapter',
58 - 'sort_alphabetically' => 'Sort articles alphabetically',
59 - 'clear_collection' => 'Clear collection',
60 - 'clear_confirm' => 'Do you really want to clear your collection?',
61 - 'rename' => 'Rename',
62 - 'new_chapter' => 'Enter name for new chapter',
63 - 'rename_chapter' => 'Enter new name for chapter',
64 - 'no_such_category' => 'No such category',
65 - 'mwpdf_error_title' => 'Could not generate PDF',
66 - 'mwpdf_error_msg' => 'An error occured during PDF generation.',
67 - 'mwzip_error_title' => 'Could not generate article collection',
68 - 'mwzip_error_msg' => 'An error occured during generation of article collection.',
69 - 'notitle_title' => 'Could not get article title',
70 - 'notitle_title' => 'The title of the article could not be determined.',
71 - 'post_failed_title' => 'POST request failed',
72 - 'post_failed_msg' => 'The POST request failed.',
73 - 'enter_title' => 'Enter title for collection:',
74 - 'error_reponse' => 'Error response from server',
75 - 'empty_collection' => 'Empty collection',
76 - 'revision' => 'Revision: %PARAM%',
 25+$messages = array();
7726
78 - 'save_collection_title' => 'Save Collection',
79 - 'save_collection_text' => 'To save this collection for later use, choose a collection type and enter a page title:',
80 - 'login_to_save' => 'If you want to save collections for later use, please <a href="$href">log in or create an account</a>.',
81 - 'personal_collection_label' => 'Personal collection:',
82 - 'community_collection_label' => 'Community collection:',
83 - 'save_collection' => 'Save Collection',
84 - 'overwrite_title' => 'Page exists. Overwrite?',
85 - 'overwrite_text' => 'A page with the name $title already exists. Do you want it to be replaced with your collection?',
86 - 'yes' => 'Yes',
87 - 'no' => 'No',
88 - 'load_overwrite_text' => 'You already have some articles in your collection. Do want to overwrite your current collection, append the new content or cancel?',
89 - 'overwrite' => 'Overwrite',
90 - 'append' => 'Append',
91 - 'cancel' => 'Cancel',
92 - 'limit_exceeded_title' => 'Collection Too Big',
93 - 'limit_exceeded_text' => 'Your article collection is too big. No more articles can be added.',
94 - 'generating_pdf_title' => 'Generating PDF',
95 - 'generating_pdf_text' => "'''Please wait while the PDF file is being generated.''' This page should automatically refresh every few seconds, if this does not work, please press refresh button of your browser.",
96 - 'pdf_finished_title' => 'PDF Generation Complete',
97 - 'pdf_finished_text' => "The PDF file has been generated. Click on the link below to download it to your computer.",
98 - 'nopdf_error_title' => 'No PDF file found',
99 - 'nopdf_error_text' => 'Could not find PDF file. Please re-generate the PDF file.',
100 - 'notfound_title' => 'Collection Not Found',
101 - 'notfound_text' => 'Could not find collection page.',
102 - 'return_to_collection' => '<p>Return to <a href="$referrer_link">$referrer_name</a></p>',
103 - 'articles_removed' => 'The following articles could not be rendered and were removed from the PDF file:',
104 - )
 27+$messages['en'] = array(
 28+ 'coll-collection' => 'Collection',
 29+ 'coll-collections' => 'Collections',
 30+ 'coll-portlet_title' => 'My Collection',
 31+ 'coll-add_article' => 'Add article',
 32+ 'coll-remove_article' => 'Remove article',
 33+ 'coll-add_category' => 'Add category',
 34+ 'coll-load_collection' => 'Load collection',
 35+ 'coll-show_collection' => 'Show collection',
 36+ 'coll-help_collections' => 'Collections help',
 37+ 'coll-empty' => 'empty',
 38+ 'coll-article' => 'article',
 39+ 'coll-articles' => 'articles',
 40+ 'coll-download_as_pdf' => 'Download as PDF',
 41+ 'coll-noscript_text' => '<noscript><h1>JavaScript is Required!</h1><strong>Your browser does not support JavaScript or JavaScript has been turned off. This page will not work correctly, unless JavaScript is enabled.</strong></noscript>',
 42+ 'coll-intro_text' => "You can collect articles, generate and download a PDF file from article collections and save article collections for later use or to share them.\n\nSee [[Help:Collections]] for more information about collections.",
 43+ 'coll-pdftoobigcat' => 'The category contains more than %PARAM% articles, only the first %PARAM% articles can be added to your collection. Do you want to add them?',
 44+ 'coll-my_collection' => 'My Collection',
 45+ 'coll-download_title' => 'Download Collection as PDF',
 46+ 'coll-download_text' => 'To download an automatically generated PDF file of your article collection, click the button.',
 47+ 'coll-download_pdf' => 'Download PDF',
 48+ 'coll-remove' => 'Remove',
 49+ 'coll-move_to_top' => 'Move to top',
 50+ 'coll-move_up' => 'Move up',
 51+ 'coll-move_down' => 'Move down',
 52+ 'coll-move_to_bottom' => 'Move to bottom',
 53+ 'coll-title' => 'Title:',
 54+ 'coll-subtitle' => 'Subtitle:',
 55+ 'coll-contents' => 'Contents',
 56+ 'coll-create_chapter' => 'Create new chapter',
 57+ 'coll-sort_alphabetically' => 'Sort articles alphabetically',
 58+ 'coll-clear_collection' => 'Clear collection',
 59+ 'coll-clear_confirm' => 'Do you really want to clear your collection?',
 60+ 'coll-rename' => 'Rename',
 61+ 'coll-new_chapter' => 'Enter name for new chapter',
 62+ 'coll-rename_chapter' => 'Enter new name for chapter',
 63+ 'coll-no_such_category' => 'No such category',
 64+ 'coll-mwpdf_error_title' => 'Could not generate PDF',
 65+ 'coll-mwpdf_error_msg' => 'An error occured during PDF generation.',
 66+ 'coll-mwzip_error_title' => 'Could not generate article collection',
 67+ 'coll-mwzip_error_msg' => 'An error occured during generation of article collection.',
 68+ 'coll-notitle_title' => 'Could not get article title',
 69+ 'coll-notitle_title' => 'The title of the article could not be determined.',
 70+ 'coll-post_failed_title' => 'POST request failed',
 71+ 'coll-post_failed_msg' => 'The POST request failed.',
 72+ 'coll-enter_title' => 'Enter title for collection:',
 73+ 'coll-error_reponse' => 'Error response from server',
 74+ 'coll-empty_collection' => 'Empty collection',
 75+ 'coll-revision' => 'Revision: %PARAM%',
 76+ 'coll-save_collection_title' => 'Save Collection',
 77+ 'coll-save_collection_text' => 'To save this collection for later use, choose a collection type and enter a page title:',
 78+ 'coll-login_to_save' => 'If you want to save collections for later use, please <a href="$href">log in or create an account</a>.',
 79+ 'coll-personal_collection_label' => 'Personal collection:',
 80+ 'coll-community_collection_label' => 'Community collection:',
 81+ 'coll-save_collection' => 'Save Collection',
 82+ 'coll-overwrite_title' => 'Page exists. Overwrite?',
 83+ 'coll-overwrite_text' => 'A page with the name $title already exists. Do you want it to be replaced with your collection?',
 84+ 'coll-yes' => 'Yes',
 85+ 'coll-no' => 'No',
 86+ 'coll-load_overwrite_text' => 'You already have some articles in your collection. Do want to overwrite your current collection, append the new content or cancel?',
 87+ 'coll-overwrite' => 'Overwrite',
 88+ 'coll-append' => 'Append',
 89+ 'coll-cancel' => 'Cancel',
 90+ 'coll-limit_exceeded_title' => 'Collection Too Big',
 91+ 'coll-limit_exceeded_text' => 'Your article collection is too big. No more articles can be added.',
 92+ 'coll-generating_pdf_title' => 'Generating PDF',
 93+ 'coll-generating_pdf_text' => "'''Please wait while the PDF file is being generated.''' This page should automatically refresh every few seconds, if this does not work, please press refresh button of your browser.",
 94+ 'coll-pdf_finished_title' => 'PDF Generation Complete',
 95+ 'coll-pdf_finished_text' => "The PDF file has been generated. Click on the link below to download it to your computer.",
 96+ 'coll-nopdf_error_title' => 'No PDF file found',
 97+ 'coll-nopdf_error_text' => 'Could not find PDF file. Please re-generate the PDF file.',
 98+ 'coll-notfound_title' => 'Collection Not Found',
 99+ 'coll-notfound_text' => 'Could not find collection page.',
 100+ 'coll-return_to_collection' => '<p>Return to <a href="$referrer_link">$referrer_name</a></p>',
 101+ 'coll-articles_removed' => 'The following articles could not be rendered and were removed from the PDF file:',
105102 );
106103 ?>
Index: trunk/extensions/Collection/Collection.php
@@ -64,9 +64,10 @@
6565
6666 # register Special:Collection:
6767
68 -$wgAutoloadClasses['Collection'] = dirname( __FILE__ ) . '/Collection.body.php';
 68+$dir = dirname(__FILE__) . '/';
 69+$wgAutoloadClasses['Collection'] = $dir . 'Collection.body.php';
 70+$wgExtensionMessagesFiles['Collection'] = $dir . 'Collection.i18n.php';
6971 $wgSpecialPages['Collection'] = 'Collection';
70 -$wgHooks['LoadAllMessages'][] = 'Collection::loadMessages';
7172 $wgHooks['LanguageGetSpecialPageAliases'][] = 'collectionLocalizedPageName';
7273
7374 $wgHooks['SkinTemplateBuildNavUrlsNav_urlsAfterPermalink'][] = 'Collection::createNavURLs';
@@ -74,9 +75,9 @@
7576
7677
7778 function collectionLocalizedPageName(&$specialPageArray, $code) {
78 - Collection::loadMessages();
79 - $text = wfMsg('collection');
80 - $title = Title::newFromText($text);
 79+ wfLoadExtensionMessages( 'Collection' );
 80+ $text = wfMsg( 'coll-collection' );
 81+ $title = Title::newFromText( $text );
8182 $specialPageArray['Collection'][] = $title->getDBKey();
8283 return true;
8384 }
Index: trunk/extensions/Collection/Collection.body.php
@@ -26,11 +26,14 @@
2727
2828 class Collection extends SpecialPage
2929 {
30 - function Collection() {
 30+ public function __construct() {
3131 SpecialPage::SpecialPage( "Collection" );
32 - self::loadMessages();
3332 }
34 -
 33+
 34+ function getDescription() {
 35+ return wfMsg( 'coll-collection' );
 36+ }
 37+
3538 function execute( $par ) {
3639 global $wgOut;
3740 global $wgRequest;
@@ -42,6 +45,8 @@
4346 global $wgCollectionMaxArticles;
4447 global $wgCollectionVersion;
4548
 49+ wfLoadExtensionMessages( 'Collection' );
 50+
4651 if ( $par == 'add_article/' ) {
4752 if ( self::countArticles() >= $wgCollectionMaxArticles ) {
4853 $this->limitExceeded();
@@ -126,14 +131,14 @@
127132 $userPageTitle = $wgUser->getUserPage()->getPrefixedText();
128133 $name = $wgRequest->getVal( 'pcollname', '' );
129134 if ( !empty( $name ) ) {
130 - $title = Title::newFromText( $userPageTitle . '/' . wfMsg( 'collections' ) . '/' . $name );
 135+ $title = Title::newFromText( $userPageTitle . '/' . wfMsg( 'coll-collections' ) . '/' . $name );
131136 $saveCalled = true;
132137 $saved = $this->saveCollection( $title, $overwrite );
133138 }
134139 } else if ( $collType == 'community' ) {
135140 $name = $wgRequest->getVal( 'ccollname', '' );
136141 if ( !empty( $name ) ) {
137 - $title = Title::makeTitle( $wgCommunityCollectionNamespace, wfMsg( 'collections' ) . '/' . $name );
 142+ $title = Title::makeTitle( $wgCommunityCollectionNamespace, wfMsg( 'coll-collections' ) . '/' . $name );
138143 $saveCalled = true;
139144 $saved = $this->saveCollection( $title, $overwrite );
140145 }
@@ -180,22 +185,6 @@
181186 $this->outputArticleList();
182187 }
183188
184 - function loadMessages() {
185 - static $messagesLoaded = false;
186 - global $wgMessageCache;
187 -
188 - if ( $messagesLoaded ) {
189 - return true;
190 - }
191 - $messagesLoaded = true;
192 -
193 - require( dirname( __FILE__ ) . '/Collection.i18n.php' );
194 - foreach ( $allMessages as $lang => $langMessages ) {
195 - $wgMessageCache->addMessages( $langMessages, $lang );
196 - }
197 - return true;
198 - }
199 -
200189 static function countArticles() {
201190 if ( isset( $_SESSION['wsCollection'] ) ) {
202191 $collection = $_SESSION['wsCollection'];
@@ -438,7 +427,7 @@
439428 }
440429 }
441430 }
442 - $catTitle = Title::makeTitle( NS_CATEGORY, wfMsg( 'collections' ) );
 431+ $catTitle = Title::makeTitle( NS_CATEGORY, wfMsg( 'coll-collections' ) );
443432 if ( !is_null( $catTitle ) ) {
444433 $articleText .= "\n[[" . $catTitle->getPrefixedText() . "]]\n";
445434 }
@@ -538,9 +527,9 @@
539528 for ( $i = 0; $i < 16; $i++ ) {
540529 $downloadLink .= $alpha[rand( 0, 61 )];
541530 }
542 - $downloadText = wfMsgHtml( 'download_pdf' );
543 - $wgOut->setPageTitle( wfMsg( 'pdf_finished_title' ) );
544 - $text = wfMsgHtml( 'pdf_finished_text' );
 531+ $downloadText = wfMsgHtml( 'coll-download_pdf' );
 532+ $wgOut->setPageTitle( wfMsg( 'coll-pdf_finished_title' ) );
 533+ $text = wfMsgHtml( 'coll-pdf_finished_text' );
545534 $dllink = "<a href=\"$downloadLink\">$downloadText</a>";
546535 $wgOut->addHTML( <<<EOS
547536 <table class="toccolours" width="100%">
@@ -553,12 +542,12 @@
554543 </table>
555544 EOS
556545 );
557 - $wgOut->addHTML( wfMsg( 'return_to_collection', array(
 546+ $wgOut->addHTML( wfMsg( 'coll-return_to_collection', array(
558547 'referrer_link' => htmlspecialchars( $pdfInfo['referrer_link'] ),
559548 'referrer_name' => htmlspecialchars( $pdfInfo['referrer_name'] )
560549 ) ) );
561550 if ( file_exists( $pdfInfo['removed_filename'] ) ) {
562 - $wgOut->addWikiText( wfMsg( 'articles_removed' ) );
 551+ $wgOut->addWikiText( wfMsg( 'coll-articles_removed' ) );
563552 $lines = file( $pdfInfo['removed_filename'] );
564553 foreach( $lines as $line ) {
565554 $wgOut->addWikiText( '*' . $line );
@@ -571,8 +560,8 @@
572561 $wgRequest->response()->header( 'Cache-Control: no-cache, no-store, max-age=0, must-revalidate' );
573562 $wgRequest->response()->header( 'Pragma: no-cache' );
574563 $wgOut->addMeta( 'http:refresh', '2; URL=.' );
575 - $wgOut->setPageTitle( wfMsg( 'generating_pdf_title' ) );
576 - $wgOut->addWikiText( wfMsg( 'generating_pdf_text' ) );
 564+ $wgOut->setPageTitle( wfMsg( 'coll-generating_pdf_title' ) );
 565+ $wgOut->addWikiText( wfMsg( 'coll-generating_pdf_text' ) );
577566 }
578567 }
579568
@@ -638,18 +627,18 @@
639628 private function outputIntro() {
640629 global $wgOut;
641630
642 - $wgOut->addHTML( wfMsg( 'noscript_text') );
643 - $wgOut->addWikiText( wfMsg( 'intro_text' ) );
 631+ $wgOut->addHTML( wfMsg( 'coll-noscript_text') );
 632+ $wgOut->addWikiText( wfMsg( 'coll-intro_text' ) );
644633 }
645634
646635 private function outputArticleList() {
647636 global $wgOut;
648637 global $wgStylePath;
649638
650 - $wgOut->addWikiText( "== ". wfMsg( 'my_collection' ) . " ==" );
 639+ $wgOut->addWikiText( "== ". wfMsg( 'coll-my_collection' ) . " ==" );
651640
652 - $title = wfMsgHtml( 'title' );
653 - $subtitle = wfMsgHtml( 'subtitle' );
 641+ $title = wfMsgHtml( 'coll-title' );
 642+ $subtitle = wfMsgHtml( 'coll-subtitle' );
654643
655644 $wgOut->addHTML( <<<EOS
656645 <table><tbody>
@@ -664,11 +653,11 @@
665654 EOS
666655 );
667656
668 - $wgOut->addWikiText( "=== ". wfMsg( 'contents' ) . " ===" );
 657+ $wgOut->addWikiText( "=== ". wfMsg( 'coll-contents' ) . " ===" );
669658
670 - $createChapter = wfMsgHtml( 'create_chapter' );
671 - $sortAlphabetically = wfMsgHtml( 'sort_alphabetically' );
672 - $clearCollection = wfMsgHtml( 'clear_collection' );
 659+ $createChapter = wfMsgHtml( 'coll-create_chapter' );
 660+ $sortAlphabetically = wfMsgHtml( 'coll-sort_alphabetically' );
 661+ $clearCollection = wfMsgHtml( 'coll-clear_collection' );
673662 $wgOut->addHTML( <<<EOS
674663 <a id="createChapter" href="javascript:void(0);">$createChapter</a>
675664 <span id="sortSpan" style="display:none;">| <a id="sortLink" href="javascript:void(0);">$sortAlphabetically</a></span>
@@ -676,22 +665,22 @@
677666 EOS
678667 );
679668
680 - $rename = wfMsgHtml( 'rename' );
681 - $remove = wfMsgHtml( 'remove' );
 669+ $rename = wfMsgHtml( 'coll-rename' );
 670+ $remove = wfMsgHtml( 'coll-remove' );
682671 $removeImage = htmlspecialchars( "$wgStylePath/common/collection/cross.png" );
683 - $moveUp = wfMsgHtml( 'move_up' );
 672+ $moveUp = wfMsgHtml( 'coll-move_up' );
684673 $moveUpImage = htmlspecialchars( "$wgStylePath/common/collection/up.png" );
685 - $moveDown = wfMsgHtml( 'move_down' );
 674+ $moveDown = wfMsgHtml( 'coll-move_down' );
686675 $moveDownImage = htmlspecialchars( "$wgStylePath/common/collection/down.png" );
687676 $moveDisabledImage = htmlspecialchars( "$wgStylePath/common/collection/trans.png" );
688 - $newChapter = wfMsgHtml( 'new_chapter' );
689 - $renameChapter = wfMsgHtml( 'rename_chapter' );
690 - $enterTitle = wfMsgHtml( 'enter_title' );
691 - $collectionExists = wfMsgHtml( 'collection_exists' );
692 - $errorResponse = wfMsgHtml( 'error_response' );
693 - $emptyCollection = wfMsgHtml( 'empty_collection' );
694 - $revision = wfMsgHtml( 'revision' );
695 - $clearConfirm = wfMsgHtml( 'clear_confirm' );
 677+ $newChapter = wfMsgHtml( 'coll-new_chapter' );
 678+ $renameChapter = wfMsgHtml( 'coll-rename_chapter' );
 679+ $enterTitle = wfMsgHtml( 'coll-enter_title' );
 680+ $collectionExists = wfMsgHtml( 'coll-collection_exists' );
 681+ $errorResponse = wfMsgHtml( 'coll-error_response' );
 682+ $emptyCollection = wfMsgHtml( 'coll-empty_collection' );
 683+ $revision = wfMsgHtml( 'coll-revision' );
 684+ $clearConfirm = wfMsgHtml( 'coll-clear_confirm' );
696685
697686 $wgOut->addHTML( <<<EOS
698687 <div id="collectionList"></div>
@@ -730,9 +719,9 @@
731720 }
732721
733722 private function outputDownloadSection() {
734 - $downloadTitle = wfMsg("download_title");
735 - $downloadText = wfMsg( 'download_text' );
736 - $buttonLabel = wfMsg( 'download_pdf' );
 723+ $downloadTitle = wfMsg( 'coll-download_title' );
 724+ $downloadText = wfMsg( 'coll-download_text' );
 725+ $buttonLabel = wfMsg( 'coll-download_pdf' );
737726 $url = SkinTemplate::makeSpecialUrlSubpage( 'Collection', 'generate_pdf/' );
738727 $html = <<<EOS
739728 <h2><span class="mw-headline">$downloadTitle</span></h2>
@@ -752,17 +741,17 @@
753742 global $wgOut;
754743 global $wgUser;
755744
756 - $html = '<h2><span class="mw-headline">' . wfMsgHTML( 'save_collection_title' ) . '</span></h2>';
 745+ $html = '<h2><span class="mw-headline">' . wfMsgHtml( 'coll-save_collection_title' ) . '</span></h2>';
757746
758747 if ($wgUser->isLoggedIn()) {
759 - $html .= '<p>' . wfMsgHTML( 'save_collection_text' ) . '</p>';
 748+ $html .= '<p>' . wfMsgHtml( 'coll-save_collection_text' ) . '</p>';
760749
761 - $personalColl = wfMsgHtml( 'personal_collection_label' );
762 - $communityColl = wfMsgHtml( 'community_collection_label' );
763 - $saveColl = wfMsgHtml( 'save_collection' );
 750+ $personalColl = wfMsgHtml( 'coll-personal_collection_label' );
 751+ $communityColl = wfMsgHtml( 'coll-community_collection_label' );
 752+ $saveColl = wfMsgHtml( 'coll-save_collection' );
764753
765 - $personalTitle = $wgUser->getUserPage()->getPrefixedText(). '/' . wfMsg( 'collections' ) . '/';
766 - $communityTitle = Title::makeTitle( $wgCommunityCollectionNamespace, wfMsg( 'collections' ) )->getPrefixedText() . '/';
 754+ $personalTitle = $wgUser->getUserPage()->getPrefixedText(). '/' . wfMsg( 'coll-collections' ) . '/';
 755+ $communityTitle = Title::makeTitle( $wgCommunityCollectionNamespace, wfMsg( 'coll-collections' ) )->getPrefixedText() . '/';
767756
768757 $url = SkinTemplate::makeSpecialUrlSubpage( 'Collection', 'save_collection/' );
769758 $html .= <<<EOS
@@ -783,7 +772,7 @@
784773 ;
785774 } else {
786775 $href = SkinTemplate::makeSpecialUrl( 'Userlogin' );
787 - $html .= '<p>' . wfMsg( 'login_to_save', array( 'href' => $href ) ) . '</p>';
 776+ $html .= '<p>' . wfMsg( 'coll-login_to_save', array( 'href' => $href ) ) . '</p>';
788777 }
789778 $this->outputBox( $html );
790779 }
@@ -791,14 +780,14 @@
792781 private function outputSaveOverwrite( $title ) {
793782 global $wgOut;
794783
795 - $wgOut->setPageTitle( wfMsg( 'save_collection' ) );
 784+ $wgOut->setPageTitle( wfMsg( 'coll-save_collection' ) );
796785
797 - $wgOut->addWikiText( '==' . wfMsg( 'overwrite_title' ) . '==' );
798 - $wgOut->addWikiText( wfMsg( 'overwrite_text', array(
 786+ $wgOut->addWikiText( '==' . wfMsg( 'coll-overwrite_title' ) . '==' );
 787+ $wgOut->addWikiText( wfMsg( 'coll-overwrite_text', array(
799788 'title' => $title->getPrefixedText()
800789 ) ) );
801 - $yes = wfMsgHtml( 'yes' );
802 - $no = wfMsgHtml( 'no' );
 790+ $yes = wfMsgHtml( 'coll-yes' );
 791+ $no = wfMsgHtml( 'coll-no' );
803792 $escapedTitle = htmlspecialchars( $title->getPrefixedText() );
804793 $url = SkinTemplate::makeSpecialUrlSubpage( 'Collection', 'save_collection/' );
805794 $wgOut->addHTML( <<<EOS
@@ -814,14 +803,14 @@
815804 private function outputLoadOverwrite( $title ) {
816805 global $wgOut;
817806
818 - $wgOut->setPageTitle( wfMsg( 'load_collection' ) );
 807+ $wgOut->setPageTitle( wfMsg( 'coll-load_collection' ) );
819808
820 - $wgOut->addWikiText( wfMsg( 'load_overwrite_text', array(
 809+ $wgOut->addWikiText( wfMsg( 'coll-load_overwrite_text', array(
821810 'title' => $title->getPrefixedText()
822811 ) ) );
823 - $overwrite = wfMsgHtml( 'overwrite' );
824 - $append = wfMsgHtml( 'append' );
825 - $cancel = wfMsgHtml( 'cancel' );
 812+ $overwrite = wfMsgHtml( 'coll-overwrite' );
 813+ $append = wfMsgHtml( 'coll-append' );
 814+ $cancel = wfMsgHtml( 'coll-cancel' );
826815 $escapedTitle = htmlspecialchars( $title->getPrefixedText() );
827816 $url = SkinTemplate::makeSpecialUrlSubpage( 'Collection', 'load_collection/' );
828817 $wgOut->addHTML( <<<EOS
@@ -849,14 +838,14 @@
850839 }
851840
852841 static function isCollectionPage( $title, $article ) {
853 - self::loadMessages();
 842+ wfLoadExtensionMessages( 'Collection' );
854843
855844 if ( is_null( $title ) || is_null( $article ) ) {
856845 return false;
857846 }
858847
859848 $categoryFinder = new Categoryfinder();
860 - $categoryFinder->seed( array( $article->getID() ), array( wfMsg('collections') ) );
 849+ $categoryFinder->seed( array( $article->getID() ), array( wfMsg( 'coll-collections' ) ) );
861850 $articles = $categoryFinder->run();
862851 if ( $articles[0] == $article->getID() ) {
863852 return true;
@@ -870,8 +859,8 @@
871860 global $wgArticle;
872861 global $wgRequest;
873862
874 - self::loadMessages();
875 -
 863+ wfLoadExtensionMessages( 'Collection' );
 864+
876865 $action = $wgRequest->getVal('action');
877866
878867 if ( $skinTemplate->iscontent && ( $action == '' || $action == 'view' || $action == 'purge' ) ) {
@@ -882,7 +871,7 @@
883872 'Collection',
884873 'download_collection_pdf/'
885874 ) . $params,
886 - 'text' => wfMsg( 'download_as_pdf' ),
 875+ 'text' => wfMsg( 'coll-download_as_pdf' ),
887876 );
888877 } else {
889878 $params = '?arttitle=' . $skinTemplate->mTitle->getPrefixedURL();
@@ -895,7 +884,7 @@
896885 'Collection',
897886 'download_article_pdf/'
898887 ) . $params,
899 - 'text' => wfMsg( 'download_as_pdf' )
 888+ 'text' => wfMsg( 'coll-download_as_pdf' )
900889 );
901890 }
902891 }
@@ -930,15 +919,15 @@
931920 return;
932921 }
933922
934 - self::loadMessages();
935 -
936 - $portletTitle = wfMsgHtml( 'portlet_title' );
937 - $addArticle = wfMsgHtml( 'add_article' );
938 - $removeArticle = wfMsgHtml( 'remove_article' );
939 - $addCategory = wfMsgHtml( 'add_category' );
940 - $loadCollection = wfMsgHtml( 'load_collection' );
941 - $tooBigCat = wfMsgHtml( 'too_big_cat' );
 923+ wfLoadExtensionMessages( 'Collection' );
942924
 925+ $portletTitle = wfMsgHtml( 'coll-portlet_title' );
 926+ $addArticle = wfMsgHtml( 'coll-add_article' );
 927+ $removeArticle = wfMsgHtml( 'coll-remove_article' );
 928+ $addCategory = wfMsgHtml( 'coll-add_category' );
 929+ $loadCollection = wfMsgHtml( 'coll-load_collection' );
 930+ $tooBigCat = wfMsgHtml( 'coll-too_big_cat' );
 931+
943932 print <<<EOS
944933 <div id="p-collection" class="portlet">
945934 <h5>$portletTitle</h5>
@@ -987,19 +976,19 @@
988977 $wgOut->enableClientCache( false );
989978 }
990979 if ( $numArticles == 1 ){
991 - $articles = $numArticles . ' ' . wfMsgHtml( 'article' );
 980+ $articles = $numArticles . ' ' . wfMsgHtml( 'coll-article' );
992981 } else {
993 - $articles = $numArticles . ' ' . wfMsgHtml( 'articles' );
 982+ $articles = $numArticles . ' ' . wfMsgHtml( 'coll-articles' );
994983 }
995 - $showCollection = wfMsgHtml( 'show_collection' );
 984+ $showCollection = wfMsgHtml( 'coll-show_collection' );
996985 $showURL = htmlspecialchars( SkinTemplate::makeSpecialUrl( 'Collection') );
997986 print <<<EOS
998987 <li><a href="$showURL">$showCollection<br/>
999988 ($articles)</a></li>
1000989 EOS
1001990 ;
1002 - $helpCollections = wfMsgHtml( 'help_collections' );
1003 - $helpURL = htmlspecialchars( Title::makeTitle( NS_HELP, wfMsg( 'collections' ) )->getFullURL() );
 991+ $helpCollections = wfMsgHtml( 'coll-help_collections' );
 992+ $helpURL = htmlspecialchars( Title::makeTitle( NS_HELP, wfMsg( 'coll-collections' ) )->getFullURL() );
1004993 print <<<EOS
1005994 <li><a href="$helpURL">$helpCollections</a></li>
1006995 </ul>

Status & tagging log

  • 15:24, 12 September 2011 Meno25 (Talk | contribs) changed the status of r31185 [removed: ok added: old]
Personal tools
Namespaces

Variants
Views
Actions
Navigation
Support
Download
Development
Communication
Toolbox