jquery.i18n
jquery.i18n copied to clipboard
Preventing inner HTML items replacement
Say I want to replace just the Exit
text for an HTML button
,
<button data-i18n="Exit">Exit
<i class="sign out icon"></i>
</button>
If I do $('[data-i18n]').i18n()
the inner i
HTML element is lost,
<button data-i18n="Exit">Exit</button>
I'm afraid this is not an issue, but I couldn't find how to do it properly.
Thanks in advance.-
Just wrap your exit-text inside a span and give it the data-i18n attribute ;)
In jquery.i18n.parser.js
line 253 replace
$this.text(i18n.parse( messageKey ));
with
$this.html(i18n.parse( messageKey ));
html does the magic.
I can't find this code Line 253
$this.text(i18n.parse( messageKey ));
can you check for us?