Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upExclude directories from "ng xi18n" #18885
Comments
|
I think this falls within the purview of the extractor itself, so I'll move it to the angular/angular repo where that package is. |
|
That sounds right. Also we are working on a new i18n extractor that understands |
|
Hi, @petebacondarwin is there any ETA for this feature? |
|
The new standalone extractor binary can already handle this, since you can point it at the compiled JS files that you care about. Using this binary, the proposed approach is to simply compile the application code using We should include this discussion here in the RFC for Ivy Library Distribution: angular/angular#38366. |
|
@petebacondarwin Sorry, did you mean xi18n as "new standalone extractor binary" or something else? For |
|
@aslubsky - sorry not to be clearer. There is a new message extractor in |
|
got it, thanks |
|
Hi Team, How to exclude node_modules while extract strings in i18n |
|
Have you tried using the latest pre-release versions of Angular and the CLI (i.e. 10.1.0-rc.0)? I am not sure if the new implementation of |
|
@petebacondarwin I am using angular 6 version , how can exclude node_modules extract strings in i18n? |
|
@vengababu5 - I don't think you can in v6. |
With this option users will be able to exclude modules from localize extraction. The `exclude` option accept an array of strings and/or RegExp. Closes angular#18885
With this option users will be able to exclude modules from localize extraction. The `exclude` option accept an array of strings and/or RegExp. Closes angular#18885
With this option users will be able to exclude modules from localize extraction. The `exclude` option accept an array of strings and/or RegExp. Closes angular#18885
With this option users will be able to exclude modules from localize extraction. The `exclude` option accept an array RegExp. Closes angular#18885


Command (mark with an
x)Description
The tool parses imported third party modules in node_modules folder too and there is no way to exclude directories from parsing. For example:
create an new app
ng new repro-appinstall a third party module
npm @ng-bootstrap/ng-bootstrapimport this module in the app.module.ts
run xi18n
ng xi18n --output-path src/locale --i18n-locale=delook in the generated messages.xlf
As you cas see the file contains translation units from a third party module although we don,t use it in our templates.
Describe the solution you'd like
A command line parameter --exclude=path/one,path/two will solve my problem. Alternatively (or at once) the parameter --include=path/one, path/two will be helpful.
Describe alternatives you've considered
I could postprocess the messages.xlf with a custom tool to remove unwanted translation units.