1.0.1 • Published 6 years ago
@supl.biz_tech/smart-extract v1.0.1
smart-extract
Like i18n_extract from the redux-i18n package, except it always works.
Built on top of the code that powers Babel - @babel/parser, @babel/traverse, and @babel/generator.
Always looks for t(). Supports both .js and .jsx files.
Installation
yarn add @supl.biz_tech/smart-extract
npm install @supl.biz_tech/smart-extractUsage
Add the following script to your package.json:
"scripts": {
"i18n:extract": "i18n_extract_smart"
}Additionally, you can change the source and the output directory for the script by using the following options:
source(aliass), defaults to./srcoutput(aliaso), defaults to./locales
"scripts": {
"i18n:extract": "i18n_extract_smart --source foo --output bar"
}Please note that both of these path values will be resolved relative to the current working directory if they're not absolute.
Finally, execute the i18n:extract script via npm/Yarn (whichever you prefer) and
enjoy the newly generated POT file.
License
MIT