Instead of the following (styled after what works in XF1)
XF2 supports the following;
The "js-extraPhrases" handling occurs before the HTML is attached, so you avoid races between when the custom phrases are added and when various jvascript actually executes
HTML:
<xf:js>
jQuery.extend(XF.phrases, {
"picker": "{{ phrase('picker')|escape('json') }}",
"update": "{{ phrase('update')|escape('json') }}"
});
</xf:js>
HTML:
<script class="js-extraPhrases" type="application/json">
{
"picker": "{{ phrase('picker')|escape('json') }}",
"update": "{{ phrase('update')|escape('json') }}"
}
</script>
The "js-extraPhrases" handling occurs before the HTML is attached, so you avoid races between when the custom phrases are added and when various jvascript actually executes