claudetech / node-static-i18n

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

Update index.coffee #19

Closed alvarotrigo closed 6 years ago

alvarotrigo commented 6 years ago

Removes data-t-interpolate attribute. So instead of:

<p data-t-interpolate="">
    texto aqui
    <div>Whatever here</div>
</p>

It creates

<p>
    texto aqui
    <div>Whatever here</div>
</p>

Please review the code changes as my knowledge in cofeescript is far from ideal :)

danhper commented 6 years ago

Hi, and sorry for the delay. I think you simply need to add the data-t attribute, otherwise the tag will not be considered for translation. Let me know if it works for you.

alvarotrigo commented 6 years ago

What I meant is that the attribute data-t-interpolate="" won't get removed after translating the page. Unlike data-t that does get removed.

My first code makes reference to the resulting file, not to the origin one :)

danhper commented 6 years ago

Do you still get this behaviour in the latest version? I added a test for this case and it seems to be passing, but I might have forgotten something.

https://github.com/claudetech/node-static-i18n/blob/master/test/index-test.coffee#L59

alvarotrigo commented 6 years ago

I didn't try the latest version yet. I'll do and let you know! Thanks!

danhper commented 6 years ago

Great, thanks!