2016-12-23 05:45:23 +01:00
2016-12-10 03:29:03 +01:00
2016-12-23 05:45:06 +01:00
2016-12-23 05:23:33 +01:00
2016-12-07 15:27:48 +01:00
2016-12-23 05:45:23 +01:00
2016-12-20 16:02:56 +01:00
2016-12-08 15:38:52 +01:00

ng2-translate-extract

Extract translatable (ng2-translate) strings and save as a JSON or Gettext pot file. Merges with existing strings if the output file already exists.

Usage

Install the package in your project:

npm install @biesbjerg/ng2-translate-extract --save-dev

Add an extract script to your project's package.json:

"scripts": {
  "extract": "ng2-translate-extract --dir ./src --output ./ --format=json --clean"
}

You can now run npm run extract to extract strings from your project's src dir. The extracted strings are saved in JSON-format in your project's root.

Modify the scripts arguments as required.

Commandline arguments

Usage:
  ng2-translate-extract [OPTIONS] [ARGS]

Options:
  -d, --dir [DIR]        Directory path you would like to extract strings from  (Default is current directory)
  -o, --output [DIR]     Directory path you would like to save extracted
                         strings  (Default is current directory)
  -f, --format [VALUE]   Output format. VALUE must be either [json|pot]  (Default is json)
  -r, --replace BOOLEAN  Replace the contents of output file if it exists
                         (Merges by default)
  -c, --clean BOOLEAN    Remove obsolete strings when merging
  -h, --help             Display help and usage details
Description
Extract translatable (using ngx-translate) strings and save as a JSON or Gettext pot file
Readme
Languages
TypeScript 99.9%