biesbjerg / ngx-translate-extract

Extract translatable (using ngx-translate) strings and save as a JSON or Gettext pot file
MIT License
524 stars 196 forks source link

Is there a way to extract the default values from pipes #266

Open klodianshaba opened 10 months ago

klodianshaba commented 10 months ago

I have in place across the system translate pipes like this {{'app-welcome' | translate: '{ defaultText : \'Welcome\'}'}}

When i run the script to extract the translations, i need the default values for each property into en.json taken from defaultText

This is the script i am using to init the en.json file ngx-translate-extract --input ./src --output ./src/assets/i18n/en.json --key-as-default-value --replace --format json

The result in en.json { "'app-welcome": "'app-welcome", }

The preferred result in en.json should be { "'app-welcome": "'Welcome", // "Welcome" taken from defaultText passed in pipe as parameter }