Add support for marker functions, to be able to extract strings not directly passed to TranslateService. Closes #10

This commit is contained in:
Kim Biesbjerg
2017-03-30 14:37:30 +02:00
parent 42a6568d47
commit daaebede6f
11 changed files with 213 additions and 90 deletions

View File

@@ -50,6 +50,18 @@ If you want to use spaces instead, you can do the following:
`ngx-translate-extract -i ./src -o ./src/i18n/en.json --format-indentation ' '`
## Mark strings for extraction using a marker function
If, for some reason, you want to extract strings not passed directly to TranslateService, you can wrap them in a custom marker function.
```ts
import { _ } from '@biesbjerg/ngx-translate-extract';
_('Extract me');
```
Add the `marker` argument when running the extract script:
`ngx-translate-extract ... -m _`
Modify the scripts arguments as required.