claudetech / node-static-i18n

HTML static pages i18n tool
https://www.npmjs.com/package/static-i18n
MIT License
102 stars 21 forks source link

interpolate for attribute like data-tooltip #29

Closed abdullahsumbal closed 5 years ago

abdullahsumbal commented 5 years ago

Hello,

I am trying to translate the content in an attribute called data-tooltip and this is how I am doing it.

<a
  class="menu-link modal-button tooltip is-tooltip-right" href="javascript:"
  data-target="modal-about" aria-haspopup="true"
  data-attr-t
  data-attr-t-interpolate
  data-tooltip-t="{{menu.about}}"
>
....
</a>

This translates to

<a 
class="menu-link modal-button tooltip is-tooltip-right" href="javascript:" 
data-target="modal-about" aria-haspopup="true" 
dataooltip-t="&nbsp;Sur"
>
....
</a>

I am able to translate "{{menu.about}}", however it also changes the attribute data-tooltip to dataooltip. Is there a way I can keep data-tooltip attribute the same?

danhper commented 5 years ago

Hi, thanks for reporting. This was due to a bug, it should now be fixed. Please try to update to the latest version. Thanks! https://github.com/claudetech/node-static-i18n/commit/0f9379a018b7d4d41f0524dd24dc2f384c9ad007#diff-6d186b954a58d5bb740f73d84fe39073R141