r75894 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75893‎ | r75894 | r75895 >
Date:01:15, 3 November 2010
Author:nad
Status:deferred
Tags:
Comment:
add i18n
Modified paths:
  • /trunk/extensions/PdfBook/PdfBook.i18n.php (added) (history)
  • /trunk/extensions/PdfBook/PdfBook.php (modified) (history)

Diff [purge]

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 @@
1717 */
1818 if( !defined( 'MEDIAWIKI' ) ) die( "Not an entry point." );
1919
20 -define( 'PDFBOOK_VERSION', "1.0.6, 2010-10-28" );
 20+define( 'PDFBOOK_VERSION', "1.0.7, 2010-10-28" );
2121
2222 $wgExtensionFunctions[] = 'wfSetupPdfBook';
2323 $wgHooks['LanguageGetMagic'][] = 'wfPdfBookLanguageGetMagic';
2424
2525 $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',
3232 );
3333
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
3535 $wgPdfBookTab = false;
3636
37 -# The text displayed in the pdf tab, can be set to another value in Localsettings.
38 -$wgTabText = 'PDF';
39 -
40 -
4137 class PdfBook {
4238
4339 function __construct() {
@@ -72,7 +68,7 @@
7369 $opt = ParserOptions::newFromUser( $wgUser );
7470
7571 # Log the export
76 - $msg = $wgUser->getUserPage()->getPrefixedText() . " exported as a PDF book";
 72+ $msg = wfMsg( 'pdfbook-log', $wgUser->getUserPage()->getPrefixedText() );
7773 $log = new LogPage( 'pdf', false );
7874 $log->addEntry( 'book', $wgTitle, $msg );
7975
@@ -197,10 +193,10 @@
198194 * Add PDF to actions tabs in MonoBook based skins
199195 */
200196 function onSkinTemplateTabs( &$skin, &$actions) {
201 - global $wgTitle, $wgTabText;
 197+ global $wgTitle;
202198 $actions['pdfbook'] = array(
203199 'class' => false,
204 - 'text' => $wgTabText,
 200+ 'text' => wfMsg( 'pdfbook-action' ),
205201 'href' => $wgTitle->getLocalURL( "action=pdfbook&format=single" ),
206202 );
207203 return true;
@@ -211,10 +207,10 @@
212208 * Add PDF to actions tabs in vector based skins
213209 */
214210 function onSkinTemplateNavigation( &$skin, &$actions ) {
215 - global $wgTitle, $wgTabText;
 211+ global $wgTitle;
216212 $actions['views']['pdfbook'] = array(
217213 'class' => false,
218 - 'text' => $wgTabText,
 214+ 'text' => wfMsg( 'pdfbook-action' ),
219215 'href' => $wgTitle->getLocalURL( "action=pdfbook&format=single" ),
220216 );
221217 return true;

Follow-up revisions

RevisionCommit summaryAuthorDate
r75916Follow-up r75894 for consistent wording...raymond12:29, 3 November 2010
r75917Follow-up r75894 for consistent wording...raymond12:30, 3 November 2010

Status & tagging log