From c742ef5b6106bcdb020566812ba3b10c82fbd425 Mon Sep 17 00:00:00 2001 From: Sergey Chernyshev Date: Wed, 4 Nov 2009 05:51:27 +0000 Subject: [PATCH] Added backwards compatible Magic Words handling similar to r55348 per Siebrand's comment to r58458. --- Widgets.i18n.php | 3 --- Widgets.php | 10 +++++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Widgets.i18n.php b/Widgets.i18n.php index 7ec501c..b1d9555 100644 --- a/Widgets.i18n.php +++ b/Widgets.i18n.php @@ -4,9 +4,6 @@ * */ -// FIXME: Can be enabled when new style magic words are used (introduced in r52503) -// require_once( dirname(__FILE__) . '/Widgets.i18n.magic.php' ); - $messages = array(); $messages['en'] = array( diff --git a/Widgets.php b/Widgets.php index 056dd5c..5488f08 100644 --- a/Widgets.php +++ b/Widgets.php @@ -50,9 +50,13 @@ $dir = dirname( __FILE__ ) . '/'; require_once( $dir . 'smarty/Smarty.class.php' ); $wgExtensionMessagesFiles['Widgets'] = $dir . 'Widgets.i18n.php'; -// Magic words handling -// FIXME: Can be disabled when new style magic words are used (introduced in r52503) -$wgHooks['LanguageGetMagic'][] = 'widgetLanguageGetMagic'; +if( version_compare( $wgVersion, '1.16alpha', '>=' ) ) { + $wgExtensionMessagesFiles['WidgetsMagic'] = $edgIP . '/Widgets.i18n.magic.php'; +} else { + // Pre 1.16alpha backward compatibility for magic words + $wgHooks['LanguageGetMagic'][] = 'widgetLanguageGetMagic'; +} + function widgetLanguageGetMagic( &$magicWords, $langCode = 'en' ) { switch ( $langCode ) { default: