[Mediawiki-i18n] why is jquery.localize undocumented and little used?

S Page spage at wikimedia.org
Wed Aug 7 22:06:18 UTC 2013

Shamelessly looking at dialog code to lift, I came across WikiLove's dialog
            $dialog = $( '\
<div id="mw-wikilove-dialog">\
    <h2><html:msg key="wikilove-get-started-header"/></h2> ...

Wait, html:msg ?  It calls $dialog.localize() and the whole chunk of DOM
gets localized at once.

This has been in core since I believe 1.17, and the AFT,  MoodBar, and
WikiLove extensions use it. I'm not sure why it's not mentioned in
Localisation <https://www.mediawiki.org/wiki/Localisation> or Manual:Messages
API <https://www.mediawiki.org/wiki/Manual:Messages_API> . I just added it
to Resource Loader modules

Why isn't newer code using it, did it fall out of favor? E.g. Echo uses
jQuery chaining:
   $( '<a>' ).attr(...).text( mw.msg( 'echo-overlay-link' ) ). ...

jquery.localize() doesn't give you the control of
mw.msg().escape/parse/plain/text() , but for big basic chunks of HTML it
seems ideal.

Thanks for any insight,
=S Page  software engineer on E3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wikimedia.org/pipermail/mediawiki-i18n/attachments/20130807/3c86639c/attachment.html>

More information about the Mediawiki-i18n mailing list