| Index: trunk/extensions/Collection/Collection.i18n.php |
| — | — | @@ -21,85 +21,82 @@ |
| 22 | 22 | * http://www.gnu.org/copyleft/gpl.html |
| 23 | 23 | */ |
| 24 | 24 | |
| 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(); |
| 77 | 26 | |
| 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:', |
| 105 | 102 | ); |
| 106 | 103 | ?> |
| Index: trunk/extensions/Collection/Collection.php |
| — | — | @@ -64,9 +64,10 @@ |
| 65 | 65 | |
| 66 | 66 | # register Special:Collection: |
| 67 | 67 | |
| 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'; |
| 69 | 71 | $wgSpecialPages['Collection'] = 'Collection'; |
| 70 | | -$wgHooks['LoadAllMessages'][] = 'Collection::loadMessages'; |
| 71 | 72 | $wgHooks['LanguageGetSpecialPageAliases'][] = 'collectionLocalizedPageName'; |
| 72 | 73 | |
| 73 | 74 | $wgHooks['SkinTemplateBuildNavUrlsNav_urlsAfterPermalink'][] = 'Collection::createNavURLs'; |
| — | — | @@ -74,9 +75,9 @@ |
| 75 | 76 | |
| 76 | 77 | |
| 77 | 78 | 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 ); |
| 81 | 82 | $specialPageArray['Collection'][] = $title->getDBKey(); |
| 82 | 83 | return true; |
| 83 | 84 | } |
| Index: trunk/extensions/Collection/Collection.body.php |
| — | — | @@ -26,11 +26,14 @@ |
| 27 | 27 | |
| 28 | 28 | class Collection extends SpecialPage |
| 29 | 29 | { |
| 30 | | - function Collection() { |
| | 30 | + public function __construct() { |
| 31 | 31 | SpecialPage::SpecialPage( "Collection" ); |
| 32 | | - self::loadMessages(); |
| 33 | 32 | } |
| 34 | | - |
| | 33 | + |
| | 34 | + function getDescription() { |
| | 35 | + return wfMsg( 'coll-collection' ); |
| | 36 | + } |
| | 37 | + |
| 35 | 38 | function execute( $par ) { |
| 36 | 39 | global $wgOut; |
| 37 | 40 | global $wgRequest; |
| — | — | @@ -42,6 +45,8 @@ |
| 43 | 46 | global $wgCollectionMaxArticles; |
| 44 | 47 | global $wgCollectionVersion; |
| 45 | 48 | |
| | 49 | + wfLoadExtensionMessages( 'Collection' ); |
| | 50 | + |
| 46 | 51 | if ( $par == 'add_article/' ) { |
| 47 | 52 | if ( self::countArticles() >= $wgCollectionMaxArticles ) { |
| 48 | 53 | $this->limitExceeded(); |
| — | — | @@ -126,14 +131,14 @@ |
| 127 | 132 | $userPageTitle = $wgUser->getUserPage()->getPrefixedText(); |
| 128 | 133 | $name = $wgRequest->getVal( 'pcollname', '' ); |
| 129 | 134 | if ( !empty( $name ) ) { |
| 130 | | - $title = Title::newFromText( $userPageTitle . '/' . wfMsg( 'collections' ) . '/' . $name ); |
| | 135 | + $title = Title::newFromText( $userPageTitle . '/' . wfMsg( 'coll-collections' ) . '/' . $name ); |
| 131 | 136 | $saveCalled = true; |
| 132 | 137 | $saved = $this->saveCollection( $title, $overwrite ); |
| 133 | 138 | } |
| 134 | 139 | } else if ( $collType == 'community' ) { |
| 135 | 140 | $name = $wgRequest->getVal( 'ccollname', '' ); |
| 136 | 141 | if ( !empty( $name ) ) { |
| 137 | | - $title = Title::makeTitle( $wgCommunityCollectionNamespace, wfMsg( 'collections' ) . '/' . $name ); |
| | 142 | + $title = Title::makeTitle( $wgCommunityCollectionNamespace, wfMsg( 'coll-collections' ) . '/' . $name ); |
| 138 | 143 | $saveCalled = true; |
| 139 | 144 | $saved = $this->saveCollection( $title, $overwrite ); |
| 140 | 145 | } |
| — | — | @@ -180,22 +185,6 @@ |
| 181 | 186 | $this->outputArticleList(); |
| 182 | 187 | } |
| 183 | 188 | |
| 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 | | - |
| 200 | 189 | static function countArticles() { |
| 201 | 190 | if ( isset( $_SESSION['wsCollection'] ) ) { |
| 202 | 191 | $collection = $_SESSION['wsCollection']; |
| — | — | @@ -438,7 +427,7 @@ |
| 439 | 428 | } |
| 440 | 429 | } |
| 441 | 430 | } |
| 442 | | - $catTitle = Title::makeTitle( NS_CATEGORY, wfMsg( 'collections' ) ); |
| | 431 | + $catTitle = Title::makeTitle( NS_CATEGORY, wfMsg( 'coll-collections' ) ); |
| 443 | 432 | if ( !is_null( $catTitle ) ) { |
| 444 | 433 | $articleText .= "\n[[" . $catTitle->getPrefixedText() . "]]\n"; |
| 445 | 434 | } |
| — | — | @@ -538,9 +527,9 @@ |
| 539 | 528 | for ( $i = 0; $i < 16; $i++ ) { |
| 540 | 529 | $downloadLink .= $alpha[rand( 0, 61 )]; |
| 541 | 530 | } |
| 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' ); |
| 545 | 534 | $dllink = "<a href=\"$downloadLink\">$downloadText</a>"; |
| 546 | 535 | $wgOut->addHTML( <<<EOS |
| 547 | 536 | <table class="toccolours" width="100%"> |
| — | — | @@ -553,12 +542,12 @@ |
| 554 | 543 | </table> |
| 555 | 544 | EOS |
| 556 | 545 | ); |
| 557 | | - $wgOut->addHTML( wfMsg( 'return_to_collection', array( |
| | 546 | + $wgOut->addHTML( wfMsg( 'coll-return_to_collection', array( |
| 558 | 547 | 'referrer_link' => htmlspecialchars( $pdfInfo['referrer_link'] ), |
| 559 | 548 | 'referrer_name' => htmlspecialchars( $pdfInfo['referrer_name'] ) |
| 560 | 549 | ) ) ); |
| 561 | 550 | if ( file_exists( $pdfInfo['removed_filename'] ) ) { |
| 562 | | - $wgOut->addWikiText( wfMsg( 'articles_removed' ) ); |
| | 551 | + $wgOut->addWikiText( wfMsg( 'coll-articles_removed' ) ); |
| 563 | 552 | $lines = file( $pdfInfo['removed_filename'] ); |
| 564 | 553 | foreach( $lines as $line ) { |
| 565 | 554 | $wgOut->addWikiText( '*' . $line ); |
| — | — | @@ -571,8 +560,8 @@ |
| 572 | 561 | $wgRequest->response()->header( 'Cache-Control: no-cache, no-store, max-age=0, must-revalidate' ); |
| 573 | 562 | $wgRequest->response()->header( 'Pragma: no-cache' ); |
| 574 | 563 | $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' ) ); |
| 577 | 566 | } |
| 578 | 567 | } |
| 579 | 568 | |
| — | — | @@ -638,18 +627,18 @@ |
| 639 | 628 | private function outputIntro() { |
| 640 | 629 | global $wgOut; |
| 641 | 630 | |
| 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' ) ); |
| 644 | 633 | } |
| 645 | 634 | |
| 646 | 635 | private function outputArticleList() { |
| 647 | 636 | global $wgOut; |
| 648 | 637 | global $wgStylePath; |
| 649 | 638 | |
| 650 | | - $wgOut->addWikiText( "== ". wfMsg( 'my_collection' ) . " ==" ); |
| | 639 | + $wgOut->addWikiText( "== ". wfMsg( 'coll-my_collection' ) . " ==" ); |
| 651 | 640 | |
| 652 | | - $title = wfMsgHtml( 'title' ); |
| 653 | | - $subtitle = wfMsgHtml( 'subtitle' ); |
| | 641 | + $title = wfMsgHtml( 'coll-title' ); |
| | 642 | + $subtitle = wfMsgHtml( 'coll-subtitle' ); |
| 654 | 643 | |
| 655 | 644 | $wgOut->addHTML( <<<EOS |
| 656 | 645 | <table><tbody> |
| — | — | @@ -664,11 +653,11 @@ |
| 665 | 654 | EOS |
| 666 | 655 | ); |
| 667 | 656 | |
| 668 | | - $wgOut->addWikiText( "=== ". wfMsg( 'contents' ) . " ===" ); |
| | 657 | + $wgOut->addWikiText( "=== ". wfMsg( 'coll-contents' ) . " ===" ); |
| 669 | 658 | |
| 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' ); |
| 673 | 662 | $wgOut->addHTML( <<<EOS |
| 674 | 663 | <a id="createChapter" href="javascript:void(0);">$createChapter</a> |
| 675 | 664 | <span id="sortSpan" style="display:none;">| <a id="sortLink" href="javascript:void(0);">$sortAlphabetically</a></span> |
| — | — | @@ -676,22 +665,22 @@ |
| 677 | 666 | EOS |
| 678 | 667 | ); |
| 679 | 668 | |
| 680 | | - $rename = wfMsgHtml( 'rename' ); |
| 681 | | - $remove = wfMsgHtml( 'remove' ); |
| | 669 | + $rename = wfMsgHtml( 'coll-rename' ); |
| | 670 | + $remove = wfMsgHtml( 'coll-remove' ); |
| 682 | 671 | $removeImage = htmlspecialchars( "$wgStylePath/common/collection/cross.png" ); |
| 683 | | - $moveUp = wfMsgHtml( 'move_up' ); |
| | 672 | + $moveUp = wfMsgHtml( 'coll-move_up' ); |
| 684 | 673 | $moveUpImage = htmlspecialchars( "$wgStylePath/common/collection/up.png" ); |
| 685 | | - $moveDown = wfMsgHtml( 'move_down' ); |
| | 674 | + $moveDown = wfMsgHtml( 'coll-move_down' ); |
| 686 | 675 | $moveDownImage = htmlspecialchars( "$wgStylePath/common/collection/down.png" ); |
| 687 | 676 | $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' ); |
| 696 | 685 | |
| 697 | 686 | $wgOut->addHTML( <<<EOS |
| 698 | 687 | <div id="collectionList"></div> |
| — | — | @@ -730,9 +719,9 @@ |
| 731 | 720 | } |
| 732 | 721 | |
| 733 | 722 | 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' ); |
| 737 | 726 | $url = SkinTemplate::makeSpecialUrlSubpage( 'Collection', 'generate_pdf/' ); |
| 738 | 727 | $html = <<<EOS |
| 739 | 728 | <h2><span class="mw-headline">$downloadTitle</span></h2> |
| — | — | @@ -752,17 +741,17 @@ |
| 753 | 742 | global $wgOut; |
| 754 | 743 | global $wgUser; |
| 755 | 744 | |
| 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>'; |
| 757 | 746 | |
| 758 | 747 | if ($wgUser->isLoggedIn()) { |
| 759 | | - $html .= '<p>' . wfMsgHTML( 'save_collection_text' ) . '</p>'; |
| | 748 | + $html .= '<p>' . wfMsgHtml( 'coll-save_collection_text' ) . '</p>'; |
| 760 | 749 | |
| 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' ); |
| 764 | 753 | |
| 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() . '/'; |
| 767 | 756 | |
| 768 | 757 | $url = SkinTemplate::makeSpecialUrlSubpage( 'Collection', 'save_collection/' ); |
| 769 | 758 | $html .= <<<EOS |
| — | — | @@ -783,7 +772,7 @@ |
| 784 | 773 | ; |
| 785 | 774 | } else { |
| 786 | 775 | $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>'; |
| 788 | 777 | } |
| 789 | 778 | $this->outputBox( $html ); |
| 790 | 779 | } |
| — | — | @@ -791,14 +780,14 @@ |
| 792 | 781 | private function outputSaveOverwrite( $title ) { |
| 793 | 782 | global $wgOut; |
| 794 | 783 | |
| 795 | | - $wgOut->setPageTitle( wfMsg( 'save_collection' ) ); |
| | 784 | + $wgOut->setPageTitle( wfMsg( 'coll-save_collection' ) ); |
| 796 | 785 | |
| 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( |
| 799 | 788 | 'title' => $title->getPrefixedText() |
| 800 | 789 | ) ) ); |
| 801 | | - $yes = wfMsgHtml( 'yes' ); |
| 802 | | - $no = wfMsgHtml( 'no' ); |
| | 790 | + $yes = wfMsgHtml( 'coll-yes' ); |
| | 791 | + $no = wfMsgHtml( 'coll-no' ); |
| 803 | 792 | $escapedTitle = htmlspecialchars( $title->getPrefixedText() ); |
| 804 | 793 | $url = SkinTemplate::makeSpecialUrlSubpage( 'Collection', 'save_collection/' ); |
| 805 | 794 | $wgOut->addHTML( <<<EOS |
| — | — | @@ -814,14 +803,14 @@ |
| 815 | 804 | private function outputLoadOverwrite( $title ) { |
| 816 | 805 | global $wgOut; |
| 817 | 806 | |
| 818 | | - $wgOut->setPageTitle( wfMsg( 'load_collection' ) ); |
| | 807 | + $wgOut->setPageTitle( wfMsg( 'coll-load_collection' ) ); |
| 819 | 808 | |
| 820 | | - $wgOut->addWikiText( wfMsg( 'load_overwrite_text', array( |
| | 809 | + $wgOut->addWikiText( wfMsg( 'coll-load_overwrite_text', array( |
| 821 | 810 | 'title' => $title->getPrefixedText() |
| 822 | 811 | ) ) ); |
| 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' ); |
| 826 | 815 | $escapedTitle = htmlspecialchars( $title->getPrefixedText() ); |
| 827 | 816 | $url = SkinTemplate::makeSpecialUrlSubpage( 'Collection', 'load_collection/' ); |
| 828 | 817 | $wgOut->addHTML( <<<EOS |
| — | — | @@ -849,14 +838,14 @@ |
| 850 | 839 | } |
| 851 | 840 | |
| 852 | 841 | static function isCollectionPage( $title, $article ) { |
| 853 | | - self::loadMessages(); |
| | 842 | + wfLoadExtensionMessages( 'Collection' ); |
| 854 | 843 | |
| 855 | 844 | if ( is_null( $title ) || is_null( $article ) ) { |
| 856 | 845 | return false; |
| 857 | 846 | } |
| 858 | 847 | |
| 859 | 848 | $categoryFinder = new Categoryfinder(); |
| 860 | | - $categoryFinder->seed( array( $article->getID() ), array( wfMsg('collections') ) ); |
| | 849 | + $categoryFinder->seed( array( $article->getID() ), array( wfMsg( 'coll-collections' ) ) ); |
| 861 | 850 | $articles = $categoryFinder->run(); |
| 862 | 851 | if ( $articles[0] == $article->getID() ) { |
| 863 | 852 | return true; |
| — | — | @@ -870,8 +859,8 @@ |
| 871 | 860 | global $wgArticle; |
| 872 | 861 | global $wgRequest; |
| 873 | 862 | |
| 874 | | - self::loadMessages(); |
| 875 | | - |
| | 863 | + wfLoadExtensionMessages( 'Collection' ); |
| | 864 | + |
| 876 | 865 | $action = $wgRequest->getVal('action'); |
| 877 | 866 | |
| 878 | 867 | if ( $skinTemplate->iscontent && ( $action == '' || $action == 'view' || $action == 'purge' ) ) { |
| — | — | @@ -882,7 +871,7 @@ |
| 883 | 872 | 'Collection', |
| 884 | 873 | 'download_collection_pdf/' |
| 885 | 874 | ) . $params, |
| 886 | | - 'text' => wfMsg( 'download_as_pdf' ), |
| | 875 | + 'text' => wfMsg( 'coll-download_as_pdf' ), |
| 887 | 876 | ); |
| 888 | 877 | } else { |
| 889 | 878 | $params = '?arttitle=' . $skinTemplate->mTitle->getPrefixedURL(); |
| — | — | @@ -895,7 +884,7 @@ |
| 896 | 885 | 'Collection', |
| 897 | 886 | 'download_article_pdf/' |
| 898 | 887 | ) . $params, |
| 899 | | - 'text' => wfMsg( 'download_as_pdf' ) |
| | 888 | + 'text' => wfMsg( 'coll-download_as_pdf' ) |
| 900 | 889 | ); |
| 901 | 890 | } |
| 902 | 891 | } |
| — | — | @@ -930,15 +919,15 @@ |
| 931 | 920 | return; |
| 932 | 921 | } |
| 933 | 922 | |
| 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' ); |
| 942 | 924 | |
| | 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 | + |
| 943 | 932 | print <<<EOS |
| 944 | 933 | <div id="p-collection" class="portlet"> |
| 945 | 934 | <h5>$portletTitle</h5> |
| — | — | @@ -987,19 +976,19 @@ |
| 988 | 977 | $wgOut->enableClientCache( false ); |
| 989 | 978 | } |
| 990 | 979 | if ( $numArticles == 1 ){ |
| 991 | | - $articles = $numArticles . ' ' . wfMsgHtml( 'article' ); |
| | 980 | + $articles = $numArticles . ' ' . wfMsgHtml( 'coll-article' ); |
| 992 | 981 | } else { |
| 993 | | - $articles = $numArticles . ' ' . wfMsgHtml( 'articles' ); |
| | 982 | + $articles = $numArticles . ' ' . wfMsgHtml( 'coll-articles' ); |
| 994 | 983 | } |
| 995 | | - $showCollection = wfMsgHtml( 'show_collection' ); |
| | 984 | + $showCollection = wfMsgHtml( 'coll-show_collection' ); |
| 996 | 985 | $showURL = htmlspecialchars( SkinTemplate::makeSpecialUrl( 'Collection') ); |
| 997 | 986 | print <<<EOS |
| 998 | 987 | <li><a href="$showURL">$showCollection<br/> |
| 999 | 988 | ($articles)</a></li> |
| 1000 | 989 | EOS |
| 1001 | 990 | ; |
| 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() ); |
| 1004 | 993 | print <<<EOS |
| 1005 | 994 | <li><a href="$helpURL">$helpCollections</a></li> |
| 1006 | 995 | </ul> |