Ahmad Sherif wrote:
> Hi Dave
> 
> You should put this line in execute function in the main class of your
> special page (i.e. class <SpecialPage> extends SpecialPage)
> 
> wfLoadExtensionMessages('<Your Special Page>');
> 
> Also you should add message with your special page name in lowercase i think
> ('yourspecialpage' => 'The Desired Name',)
> 
> And don't forget to load the messages file with
> 
> $wgExtensionMessagesFiles['<SpecialPageName>'] = $dir
> .'Special<PageName>.i18n.php';

This is going off on a tangent a bit, but this isn't the first time that
our system for loading extension messages has struck me as awkward.  We
already have extensions specify the location of their message files via
$wgExtensionMessagesFiles, but currently there's no way for MediaWiki to
know what messages are in each file without loading them.

Does anyone see a reason why we shouldn't make (okay, allow and strongly
recommend) extensions list the names of the messages they define?  That
way the message loading code could just automatically pull in the right
message files as needed.  I'm envisioning something like:

$wgExtensionMessagesFiles['MyExtension'] = "$dir/MyExtension.i18n.php";
$wgExtensionMessages['MyExtension'] = array(
        'myextension-desc',
        'myextension-something',
        'myextension-other',
        'myextension-whatever',
);

I believe this would also allow us to fix several longstanding bugs, 
such as the fact that links to the MediaWiki: pages of extension 
messages currently appear as redlinks unless the message just happens to 
have been loaded.

-- 
Ilmari Karonen


_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to