-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Description
🐞 Bug report / 🚀Feature request
Command (mark with an x
)
- new
- build
- serve
- test
- e2e
- generate
- add
- update
- lint
- xi18n
- run
- config
- help
- version
- doc
Description
ng xi18n
isn't extracting localized messages when using $localize
inside component ts files.
🔬 Minimal Reproduction
- Create a Angular v9 Ivy enabled application.
- Add
@angular/localize
(ng add @angular/localize
) - Add a localized message in a component HTML template using
i18n
attribute (<h2 i18n="@@works">This works</h2>
). - Add a localized message in a component ts file using
$localize
(this.message = $localize`:@@anId:a basic message`;
) - Execute
ng xi18n
. - Only the HTML template messages are being extracted.
Manually adding the non extracted translations and building the application works as expected but running ng xi18n
again will erase them.
I've created a minimal GitHub repository with the reproduction of the issue : ivy-xi18n-issue
🌍 Your Environment
Angular CLI: 9.0.0-rc.5
Node: 10.17.0
OS: darwin x64
Angular: 9.0.0-rc.5
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router
Ivy Workspace: Yes
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.900.0-rc.5
@angular-devkit/build-angular 0.900.0-rc.5
@angular-devkit/build-optimizer 0.900.0-rc.5
@angular-devkit/build-webpack 0.900.0-rc.5
@angular-devkit/core 9.0.0-rc.5
@angular-devkit/schematics 9.0.0-rc.5
@ngtools/webpack 9.0.0-rc.5
@schematics/angular 9.0.0-rc.5
@schematics/update 0.900.0-rc.5
rxjs 6.5.3
typescript 3.6.4
webpack 4.41.2
Metadata
Metadata
Assignees
Labels
No labels