r109571 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109570‎ | r109571 | r109572 >
Date:21:21, 19 January 2012
Author:johnduhart
Status:resolved (Comments)
Tags:i18nreview, languagegetmagic 
Comment:
Merge branch 'magic'
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.setup.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/backend/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/frontend/language/FlaggedRevs.i18n.magic.php (added) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php (modified) (history)
  • /trunk/extensions/MetavidWiki/languages/MV_Magic.php (added) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/frontend/language/FlaggedRevs.i18n.magic.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Internationalization file for magic words.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+$magicWords['en'] = array(
 10+ 'pagesusingpendingchanges' => array( 0, 'pagesusingpendingchanges' ),
 11+ 'pagesusingpendingchanges' => array( 0, 'pendingchangelevel' ),
 12+);
\ No newline at end of file
Property changes on: trunk/extensions/FlaggedRevs/frontend/language/FlaggedRevs.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
113 + native
Index: trunk/extensions/FlaggedRevs/backend/FlaggedRevs.hooks.php
@@ -229,12 +229,6 @@
230230 return true;
231231 }
232232
233 - public static function onLanguageGetMagic( &$magicWords, $langCode ) {
234 - $magicWords['pagesusingpendingchanges'] = array( 0, 'pagesusingpendingchanges' );
235 - $magicWords['pendingchangelevel'] = array( 0, 'pendingchangelevel' );
236 - return true;
237 - }
238 -
239233 public static function onParserGetVariableValueSwitch( &$parser, &$cache, &$word, &$ret ) {
240234 if ( $word == 'pendingchangelevel' ) {
241235 $title = $parser->getTitle();
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.setup.php
@@ -81,6 +81,7 @@
8282 ### Presentation classes ###
8383 # Main i18n file and special page alias file
8484 $messagesFiles['FlaggedRevs'] = "$langDir/FlaggedRevs.i18n.php";
 85+ $messagesFiles['FlaggedRevsMagic'] = "$langDir/FlaggedRevs.i18n.magic.php";
8586 $messagesFiles['FlaggedRevsAliases'] = "$langDir/FlaggedRevs.alias.php";
8687 # UI setup, forms, and HTML elements
8788 $classes['FlaggedRevsUISetup'] = "$frontendDir/FlaggedRevsUI.setup.php";
@@ -246,8 +247,6 @@
247248 if ( $wgFlaggedRevsProtection ) {
248249 # Add pending changes related magic words
249250 $wgHooks['ParserFirstCallInit'][] = 'FlaggedRevsHooks::onParserFirstCallInit';
250 - // @todo FIXME: Use $wgExtensionMessagesFiles instead of LanguageGetMagic hook.
251 - $wgHooks['LanguageGetMagic'][] = 'FlaggedRevsHooks::onLanguageGetMagic';
252251 $wgHooks['ParserGetVariableValueSwitch'][] = 'FlaggedRevsHooks::onParserGetVariableValueSwitch';
253252 $wgHooks['MagicWordwgVariableIDs'][] = 'FlaggedRevsHooks::onMagicWordwgVariableIDs';
254253 }
Index: trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php
@@ -23,6 +23,9 @@
2424 // Register special page aliases file
2525 $wgExtensionMessagesFiles['MetavidWikiAlias'] = $mvgIP . '/languages/MV_Aliases.php';
2626
 27+// Register magic words
 28+$wgExtensionMessagesFiles['MetavidWikiMagic'] = $mvgIP . '/languages/MV_Magic.php';
 29+
2730 $markerList = array();
2831 $mvGlobalJSVariables = array();
2932 // override special search page:
@@ -230,12 +233,6 @@
231234 $wgAutoloadClasses['mvOggHandler'] = dirname( __FILE__ ) . '/MV_OggHandler.php';
232235 $wgMediaHandlers['application/ogg']='mvOggHandler';
233236 $wgParserOutputHooks['OggHandler'] = array( 'mvOggHandler', 'outputHook' );
234 - // @todo FIXME: LanguageGetMagic is deprecated. Need to find another solution.
235 - foreach($wgHooks['LanguageGetMagic'] as & $hook_function){
236 - if($hook_function=='OggHandler::registerMagicWords'){
237 - $hook_function='mvOggHandler::registerMagicWords';
238 - }
239 - }
240237 foreach($wgExtensionCredits as & $ext){
241238 if(isset($ext['name'])){
242239 if($ext['name']=='OggHandler'){
@@ -267,17 +264,7 @@
268265 'descriptionmsg' => 'mv-desc',
269266 );
270267 }
271 -# Define a setup function
272 -// @todo FIXME LanguageGetMagic is deprecated. Need to find another solution.
273 -# Add a hook to initialize the magic word
274 -$wgHooks['LanguageGetMagic'][] = 'mvMagicParserFunction_Magic';
275268
276 -function mvMagicParserFunction_Magic( &$magicWords, $langCode ) {
277 - $magicWords['mvData'] = array( 0, 'mvData' );
278 - $magicWords['mvEmbed'] = array( 0, 'mvEmbed' );
279 - return true;
280 -}
281 -
282269 function mvMagicParserFunction_Render( &$parser ) {
283270 // gennerate arg_list array without parser param
284271 $arg_list = array_slice( func_get_args(), 1 );
Index: trunk/extensions/MetavidWiki/languages/MV_Magic.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Internationalization file for magic words.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+$magicWords['en'] = array(
 10+ 'mvData' => array( 0, 'mvData' ),
 11+ 'mvEmbed' => array( 0, 'mvEmbed' ),
 12+);
\ No newline at end of file
Property changes on: trunk/extensions/MetavidWiki/languages/MV_Magic.php
___________________________________________________________________
Added: svn:eol-style
113 + native

Follow-up revisions

RevisionCommit summaryAuthorDate
r109831Fix double message key use from r109571reedy16:53, 23 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108997Remove use of deprecated LanguageGetMagic hook....siebrand20:07, 15 January 2012

Comments

#Comment by Johnduhart (talk | contribs)   21:23, 19 January 2012

I'm sorry for the horrible commit message.

This just updates FlaggedRevs and MetavidWiki to use $wgExtensionMessagesFiles for magic words.

#Comment by Siebrand (talk | contribs)   22:10, 19 January 2012

'pagesusingpendingchanges' is used as key twice.

Status & tagging log