gilbsgilbs/babel-plugin-i18next-extract

Support for pug files

samuliasmala opened this issue · 0 comments

In addition to js files I'm using i18next in pug templates, e.g. #{t('frontpage.login-button')}. Has there been any discussion to include pug files in this plugin? It would be great to get the i18n keys extracted also from pug templates and combined with the keys from js files.

My current solution is to manually extract the keys using grep and inserting those to dummy js file to get the keys merged with other keys.

grep -ohP '(?<!\w)t\(.*?\)' *.pug > dummy.js

It works but is not ideal.