martinkr / next-export-i18n

Internationalize (18n) next.js with true support for next export
MIT License
247 stars 37 forks source link

Template string support #2

Closed kigawas closed 2 years ago

kigawas commented 2 years ago

Thanks for your work. This library is a lifesaver for building static next sites, but it lacks template string support, which is quite useful in many cases.

Users would probably want to translate like:

t('key', {count: 2})
{
   "key": "You clicked {{count}} times"
}

How about implement this feature by integrating mustache?

martinkr commented 2 years ago

Thank you for the suggestion. I think it's a great improvement. If you want to submit a PR I will happily merge it. Otherwise it might take a week until I can add this feature :)

kigawas commented 2 years ago

No problem, I'll do this

kigawas commented 2 years ago

Oh man, you're using tab to indent...

kigawas commented 2 years ago

Ready for review

martinkr commented 2 years ago

Thank you!

martinkr commented 2 years ago

v1.1.0 https://www.npmjs.com/package/next-export-i18n