<div dir="ltr"><div><div><div><div>Shamelessly looking at dialog code to lift, I came across WikiLove's dialog box:<br>            $dialog = $( '\<br><div id="mw-wikilove-dialog">\<br>    <h2><html:msg key="wikilove-get-started-header"/></h2> ...<br>
<br></div>Wait, html:msg ?  It calls $dialog.localize() and the whole chunk of DOM gets localized at once.<br></div><br></div>This has been in core since I believe 1.17, and the AFT,  MoodBar, and WikiLove extensions use it. <span class="">I'm not sure why it's not mentioned in <a href="https://www.mediawiki.org/wiki/Localisation" title="Localisation">Localisation</a> or <a href="https://www.mediawiki.org/wiki/Manual:Messages_API" title="Manual:Messages API">Manual:Messages API</a> . </span>I just added it to <a href="https://www.mediawiki.org/wiki/ResourceLoader/Default_modules#jquery.localize">Resource Loader modules page</a>.<br>
<br></div>Why isn't newer code using it, did it fall out of favor? E.g. Echo uses jQuery chaining:<br>   $( '<a>' ).attr(...).text( mw.msg( 'echo-overlay-link' ) ). ...<br><br>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.<br clear="all">
<div><div><div><div><div><div><br></div><div>Thanks for any insight,<br></div><div>--<br>=S Page  software engineer on E3
</div></div></div></div></div></div></div>