Added backwards compatible Magic Words handling similar to r55348 per Siebrand's comment to r58458.
This commit is contained in:
Родитель
bfe1305048
Коммит
c742ef5b61
|
@ -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(
|
||||
|
|
10
Widgets.php
10
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:
|
||||
|
|
Загрузка…
Ссылка в новой задаче