claudetech / node-static-i18n

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

not correctly remove attribute with string ends with 't' #27

Closed shoota closed 6 years ago

shoota commented 6 years ago

string ends with 't' is removed 't' after translation in v0.2.1

source

<img src="foo" alt-t="foo.bar">

translated

<img src="foo" al="foo.bar">

reason

https://github.com/claudetech/node-static-i18n/blob/master/lib/index.js#L141

lodash.trimEnd will remove all string. ref

> lodash.trimEnd('content-t', '-t')
'conten'
shoota commented 6 years ago

I will send PR soon :)

danhper commented 6 years ago

Oh, I misunderstood how trimEnd works. Thank you, I'll be waiting for your PR.