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 |
1 | 34 | + native |
Index: trunk/extensions/Rdf/Rdf.php |
— | — | @@ -91,29 +91,17 @@ |
92 | 92 | |
93 | 93 | $wgExtensionFunctions[] = 'setupMwRdf'; |
94 | 94 | |
95 | | -function setupMwRdf() { |
96 | | - global $wgParser, $wgMessageCache, $wgRequest, $wgOut, $wgHooks; |
| 95 | +$wgExtensionMessagesFiles['Rdf'] = dirname( __FILE__ ) . '/Rdf.i18n.php'; |
97 | 96 | |
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'; |
116 | 102 | |
117 | | - $wgParser->setHook( 'rdf', 'renderMwRdf' ); |
| 103 | +function setupMwRdf() { |
| 104 | + global $wgRequest, $wgOut; |
| 105 | + |
118 | 106 | SpecialPage::AddPage(new SpecialPage('Rdf', '', true, 'wfSpecialRdf', |
119 | 107 | 'extensions/MwRdf.php')); |
120 | 108 | |
— | — | @@ -158,13 +146,12 @@ |
159 | 147 | } |
160 | 148 | } |
161 | 149 | } |
| 150 | +} |
162 | 151 | |
163 | | - # We set some hooks for invalidating the cache |
| 152 | +function MwRdfOnParserFirstCallInit( $parser ) { |
| 153 | + $parser->setHook( 'rdf', 'renderMwRdf' ); |
164 | 154 | |
165 | | - $wgHooks['ArticleSave'][] = 'MwRdfOnArticleSave'; |
166 | | - $wgHooks['ArticleSaveComplete'][] = 'MwRdfOnArticleSaveComplete'; |
167 | | - $wgHooks['TitleMoveComplete'][] = 'MwRdfOnTitleMoveComplete'; |
168 | | - $wgHooks['ArticleDeleteComplete'][] = 'MwRdfOnArticleDeleteComplete'; |
| 155 | + return true; |
169 | 156 | } |
170 | 157 | |
171 | 158 | function wfSpecialRdf($par) { |
Index: trunk/extensions/Rdf/README.RDF.txt |
— | — | @@ -286,10 +286,9 @@ |
287 | 287 | |
288 | 288 | $wgRdfModelFunctions['charcount'] = 'CharacterCount'; |
289 | 289 | |
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". |
291 | 292 | |
292 | | -$wgMessageCache->addMessages(array('rdf-charcount' => 'Count of characters')); |
293 | | - |
294 | 293 | You can also create model-outputting functions if you so desire; they |
295 | 294 | should accept a RAP model as input and make output as they would to |
296 | 295 | the Web. This is probably only useful if you want a specific RDF |