Extracting i18n from Angular applications is broken when using @nx/angular:application
or @nx/angular:browser-esbuild
builders
#21225
Labels
@nx/angular:application
or @nx/angular:browser-esbuild
builders
#21225
Current Behavior
When running the
@angular-devkit/build-angular:extract-i18n
to extract i18n messages while using@nx/angular:application
or@nx/angular:browser-esbuild
builders, the extraction will complete succesfully, however the generated file will be empty.The final result says:
Extraction Complete. (Messages: 0)
This is caused by Angular hardcoding their own builders in the
extract-i18n
builder: https://github.com/angular/angular-cli/blob/8eab5aa9122265396fccb9592aab71caf7d45d19/packages/angular_devkit/build_angular/src/builders/extract-i18n/builder.ts#L64.When you use the Angular builder
@angular-devkit/build-angular:application
, it works fine and extracts all messages. However, you will miss out on the advantages of the NX builders.Expected Behavior
That the extraction will be run without problems and that the generated translation file is not empty. Maybe copy the entire generator to NX and only change these builder names?
GitHub Repo
https://github.com/nrwl/nx-examples
Steps to Reproduce
products
app to@nx/angular:application
(https://github.com/nrwl/nx-examples/blob/b36d283837c11db11ced41251c8adfa79aded65a/apps/products/project.json#L14)app.component.html
that should be extracted (for example<span i18n>This should be in the file</span>
in https://github.com/nrwl/nx-examples/blob/master/apps/products/src/app/app.component.html#L4)nx run products:extract-i18n
messages.xlf
is empty.@angular-devkit/build-angular:application
nx run products:extract-i18n
messages.xlf
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: