jquery.i18n icon indicating copy to clipboard operation
jquery.i18n copied to clipboard

Preventing inner HTML items replacement

Open theTestTube opened this issue 8 years ago • 3 comments

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.-

theTestTube avatar Oct 12 '16 20:10 theTestTube

Just wrap your exit-text inside a span and give it the data-i18n attribute ;)

ali-kamalizade avatar Dec 26 '16 12:12 ali-kamalizade

In jquery.i18n.parser.js line 253 replace $this.text(i18n.parse( messageKey )); with $this.html(i18n.parse( messageKey ));

html does the magic.

tkiener avatar Mar 20 '18 13:03 tkiener

I can't find this code Line 253 $this.text(i18n.parse( messageKey ));

can you check for us?

PixelMediaTr avatar Nov 06 '19 15:11 PixelMediaTr