r80823 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80822‎ | r80823 | r80824 >
Date:18:03, 23 January 2011
Author:ialex
Status:deferred (Comments)
Tags:
Comment:
* Moved messages to their own file
* Use ParserFirstCallInit hook to register the tag
* Removed mention of deprecated $wgMessageCache->addMessages() in README
Modified paths:
  • /trunk/extensions/Rdf/README.RDF.txt (modified) (history)
  • /trunk/extensions/Rdf/Rdf.i18n.php (added) (history)
  • /trunk/extensions/Rdf/Rdf.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Rdf/Rdf.i18n.php
@@ -0,0 +1,32 @@
 2+<?php
 3+/**
 4+ * Messages for the Rdf extension.
 5+ *
 6+ * @file
 7+ */
 8+
 9+$messages = array();
 10+
 11+/**
 12+ * English
 13+ */
 14+$messages['en'] = array(
 15+ 'rdf' => 'Rdf',
 16+ 'rdf-inpage' => "Embedded In-page Turtle",
 17+ 'rdf-dcmes' => "Dublin Core Metadata Element Set",
 18+ 'rdf-cc' => "Creative Commons",
 19+ 'rdf-image' => "Embedded images",
 20+ 'rdf-linksto' => "Links to the page",
 21+ 'rdf-linksfrom' => "Links from the page",
 22+ 'rdf-links' => "All links",
 23+ 'rdf-history' => "Historical versions",
 24+ 'rdf-interwiki' => "Interwiki links",
 25+ 'rdf-categories' => "Categories",
 26+ 'rdf-target' => "Target page",
 27+ 'rdf-modelnames' => "Model(s)",
 28+ 'rdf-format' => "Output format",
 29+ 'rdf-output-xml' => "XML",
 30+ 'rdf-output-turtle' => "Turtle",
 31+ 'rdf-output-ntriples' => "NTriples",
 32+ 'rdf-instructions' => "Select the target page and RDF models you're interested in."
 33+);
Property changes on: trunk/extensions/Rdf/Rdf.i18n.php
___________________________________________________________________
Added: svn:eol-style
134 + native
Index: trunk/extensions/Rdf/Rdf.php
@@ -91,29 +91,17 @@
9292
9393 $wgExtensionFunctions[] = 'setupMwRdf';
9494
95 -function setupMwRdf() {
96 - global $wgParser, $wgMessageCache, $wgRequest, $wgOut, $wgHooks;
 95+$wgExtensionMessagesFiles['Rdf'] = dirname( __FILE__ ) . '/Rdf.i18n.php';
9796
98 - $wgMessageCache->addMessages(array('rdf' => 'Rdf',
99 - 'rdf-inpage' => "Embedded In-page Turtle",
100 - 'rdf-dcmes' => "Dublin Core Metadata Element Set",
101 - 'rdf-cc' => "Creative Commons",
102 - 'rdf-image' => "Embedded images",
103 - 'rdf-linksto' => "Links to the page",
104 - 'rdf-linksfrom' => "Links from the page",
105 - 'rdf-links' => "All links",
106 - 'rdf-history' => "Historical versions",
107 - 'rdf-interwiki' => "Interwiki links",
108 - 'rdf-categories' => "Categories",
109 - 'rdf-target' => "Target page",
110 - 'rdf-modelnames' => "Model(s)",
111 - 'rdf-format' => "Output format",
112 - 'rdf-output-xml' => "XML",
113 - 'rdf-output-turtle' => "Turtle",
114 - 'rdf-output-ntriples' => "NTriples",
115 - 'rdf-instructions' => "Select the target page and RDF models you're interested in."));;
 97+$wgHooks['ParserFirstCallInit'][] = 'MwRdfOnParserFirstCallInit';
 98+$wgHooks['ArticleSave'][] = 'MwRdfOnArticleSave';
 99+$wgHooks['ArticleSaveComplete'][] = 'MwRdfOnArticleSaveComplete';
 100+$wgHooks['TitleMoveComplete'][] = 'MwRdfOnTitleMoveComplete';
 101+$wgHooks['ArticleDeleteComplete'][] = 'MwRdfOnArticleDeleteComplete';
116102
117 - $wgParser->setHook( 'rdf', 'renderMwRdf' );
 103+function setupMwRdf() {
 104+ global $wgRequest, $wgOut;
 105+
118106 SpecialPage::AddPage(new SpecialPage('Rdf', '', true, 'wfSpecialRdf',
119107 'extensions/MwRdf.php'));
120108
@@ -158,13 +146,12 @@
159147 }
160148 }
161149 }
 150+}
162151
163 - # We set some hooks for invalidating the cache
 152+function MwRdfOnParserFirstCallInit( $parser ) {
 153+ $parser->setHook( 'rdf', 'renderMwRdf' );
164154
165 - $wgHooks['ArticleSave'][] = 'MwRdfOnArticleSave';
166 - $wgHooks['ArticleSaveComplete'][] = 'MwRdfOnArticleSaveComplete';
167 - $wgHooks['TitleMoveComplete'][] = 'MwRdfOnTitleMoveComplete';
168 - $wgHooks['ArticleDeleteComplete'][] = 'MwRdfOnArticleDeleteComplete';
 155+ return true;
169156 }
170157
171158 function wfSpecialRdf($par) {
Index: trunk/extensions/Rdf/README.RDF.txt
@@ -286,10 +286,9 @@
287287
288288 $wgRdfModelFunctions['charcount'] = 'CharacterCount';
289289
290 -You can add a message to the site describing your model like so:
 290+You can add a message to the site describing your model by creating the page
 291+MediaWiki:Rdf-charcount and set its content to "Count of characters".
291292
292 -$wgMessageCache->addMessages(array('rdf-charcount' => 'Count of characters'));
293 -
294293 You can also create model-outputting functions if you so desire; they
295294 should accept a RAP model as input and make output as they would to
296295 the Web. This is probably only useful if you want a specific RDF

Follow-up revisions

RevisionCommit summaryAuthorDate
r81559Follow-up r80823: Add description message...raymond11:06, 5 February 2011

Comments

#Comment by Siebrand (talk | contribs)   10:18, 14 February 2011

Any idea what "Embedded In-page Turtle" tries to convey? "embedded" and "in-page" sounds like (almost?) the same thing to me. Please document at translatewiki.net.

#Comment by IAlex (talk | contribs)   11:03, 14 February 2011

I have no idea at all about this; I just moved the messages to their own file, nothing more.

Status & tagging log