babel-plugin-i18next-extract icon indicating copy to clipboard operation
babel-plugin-i18next-extract copied to clipboard

Support for pug files

Open samuliasmala opened this issue 4 years ago • 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.

samuliasmala avatar Apr 20 '20 19:04 samuliasmala