1.0.1 • Published 5 years ago

@supl.biz_tech/smart-extract v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

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-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 (alias s), defaults to ./src
  • output (alias o), 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

1.0.1

5 years ago

0.1.3

5 years ago