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: