https://github.com/oguimbal/ngi18n-localize-collector
A (temporary) fix to collect `$localize` statements in Angular 9 typecript files
https://github.com/oguimbal/ngi18n-localize-collector
Last synced: 2 months ago
JSON representation
A (temporary) fix to collect `$localize` statements in Angular 9 typecript files
- Host: GitHub
- URL: https://github.com/oguimbal/ngi18n-localize-collector
- Owner: oguimbal
- Created: 2020-03-01T20:01:36.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-01T20:07:36.000Z (over 5 years ago)
- Last Synced: 2025-02-09T20:16:24.019Z (8 months ago)
- Language: TypeScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
When running `ng xi18n`, you may have noticed that Angular does not (yet) collect new `$localize` statements in your source files.
This small commandline tools addresses this.
**DISCLAIMER** This is a hack... it is in no way the recommanded way to do this, and the `$localize` statement will probably be supported by the Angular cli soon.
# Usage
Install it
```bash
npm i ngi18n-localize-collector -D
```Add a pass to collect `$localize` statements when collecting all translations.
For instance, add this in your `package.json` scripts
```json
{
"scripts": {
"collect": "ng xi18n --output-path i18n && ngi18n-localize-collector collect && xliffmerge --profile xliffmerge.json en"
}
}
```... this should do it ! You will see your `$localize` translations pop in `messages.xlf`