0.1.2 • Published 5 years ago
@ilya-spiridonov/smart-extract v0.1.2
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 @ilya-spiridonov/smart-extract
npm install @ilya-spiridonov/smart-extract
Usage
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./src
output
(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
0.1.2
5 years ago