Index: trunk/extensions/PdfBook/PdfBook.i18n.php |
— | — | @@ -0,0 +1,20 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Internationalisation file for the extension PdfBook |
| 5 | + * |
| 6 | + * @file |
| 7 | + * @ingroup Extensions |
| 8 | + * @author Aran Dunkley |
| 9 | + * @licence GNU General Public Licence 2.0 or later |
| 10 | + */ |
| 11 | + |
| 12 | +$messages = array(); |
| 13 | + |
| 14 | +/** English |
| 15 | + * @author Aran Dunkley |
| 16 | + */ |
| 17 | +$messages['en'] = array( |
| 18 | + 'pdfbook-action' => "Print as PDF", |
| 19 | + 'pdfbook-log' => "$1 exported as a PDF book", |
| 20 | + 'pdfbook-desc' => "Composes a book from articles in a category and exports as a PDF book", |
| 21 | +); |
Index: trunk/extensions/PdfBook/PdfBook.php |
— | — | @@ -16,27 +16,23 @@ |
17 | 17 | */ |
18 | 18 | if( !defined( 'MEDIAWIKI' ) ) die( "Not an entry point." ); |
19 | 19 | |
20 | | -define( 'PDFBOOK_VERSION', "1.0.6, 2010-10-28" ); |
| 20 | +define( 'PDFBOOK_VERSION', "1.0.7, 2010-10-28" ); |
21 | 21 | |
22 | 22 | $wgExtensionFunctions[] = 'wfSetupPdfBook'; |
23 | 23 | $wgHooks['LanguageGetMagic'][] = 'wfPdfBookLanguageGetMagic'; |
24 | 24 | |
25 | 25 | $wgExtensionCredits['parserhook'][] = array( |
26 | | - 'path' => __FILE__, |
27 | | - 'name' => "PdfBook", |
28 | | - 'author' => "[http://www.organicdesign.co.nz/nad User:Nad]", |
29 | | - 'description' => "Composes a book from articles in a category and exports as a PDF book", |
30 | | - 'url' => "http://www.mediawiki.org/wiki/Extension:PdfBook", |
31 | | - 'version' => PDFBOOK_VERSION |
| 26 | + 'path' => __FILE__, |
| 27 | + 'name' => "PdfBook", |
| 28 | + 'author' => "[http://www.organicdesign.co.nz/nad User:Nad]", |
| 29 | + 'url' => "http://www.mediawiki.org/wiki/Extension:PdfBook", |
| 30 | + 'version' => PDFBOOK_VERSION, |
| 31 | + 'descriptionmsg' => 'pdfbook-desc', |
32 | 32 | ); |
33 | 33 | |
34 | | -# Set this to true in LocalSettings to add PdfBook to the action tabs |
| 34 | +# Whether or not an action tab is wanted for printing to PDF |
35 | 35 | $wgPdfBookTab = false; |
36 | 36 | |
37 | | -# The text displayed in the pdf tab, can be set to another value in Localsettings. |
38 | | -$wgTabText = 'PDF'; |
39 | | - |
40 | | - |
41 | 37 | class PdfBook { |
42 | 38 | |
43 | 39 | function __construct() { |
— | — | @@ -72,7 +68,7 @@ |
73 | 69 | $opt = ParserOptions::newFromUser( $wgUser ); |
74 | 70 | |
75 | 71 | # Log the export |
76 | | - $msg = $wgUser->getUserPage()->getPrefixedText() . " exported as a PDF book"; |
| 72 | + $msg = wfMsg( 'pdfbook-log', $wgUser->getUserPage()->getPrefixedText() ); |
77 | 73 | $log = new LogPage( 'pdf', false ); |
78 | 74 | $log->addEntry( 'book', $wgTitle, $msg ); |
79 | 75 | |
— | — | @@ -197,10 +193,10 @@ |
198 | 194 | * Add PDF to actions tabs in MonoBook based skins |
199 | 195 | */ |
200 | 196 | function onSkinTemplateTabs( &$skin, &$actions) { |
201 | | - global $wgTitle, $wgTabText; |
| 197 | + global $wgTitle; |
202 | 198 | $actions['pdfbook'] = array( |
203 | 199 | 'class' => false, |
204 | | - 'text' => $wgTabText, |
| 200 | + 'text' => wfMsg( 'pdfbook-action' ), |
205 | 201 | 'href' => $wgTitle->getLocalURL( "action=pdfbook&format=single" ), |
206 | 202 | ); |
207 | 203 | return true; |
— | — | @@ -211,10 +207,10 @@ |
212 | 208 | * Add PDF to actions tabs in vector based skins |
213 | 209 | */ |
214 | 210 | function onSkinTemplateNavigation( &$skin, &$actions ) { |
215 | | - global $wgTitle, $wgTabText; |
| 211 | + global $wgTitle; |
216 | 212 | $actions['views']['pdfbook'] = array( |
217 | 213 | 'class' => false, |
218 | | - 'text' => $wgTabText, |
| 214 | + 'text' => wfMsg( 'pdfbook-action' ), |
219 | 215 | 'href' => $wgTitle->getLocalURL( "action=pdfbook&format=single" ), |
220 | 216 | ); |
221 | 217 | return true; |