Exclude Directories From "ng Xi18n" · Issue #18885 - GitHub

Skip to content Dismiss alert {{ message }} / angular-cli Public
  • Notifications You must be signed in to change notification settings
  • Fork 11.9k
  • Star 27k
  • Code
  • Issues 263
  • Pull requests 21
  • Actions
  • Security

    Uh oh!

    There was an error while loading. Please reload this page.

  • Insights
Additional navigation options Exclude directories from "ng xi18n" #18885New issueNew issueClosed as not plannedClosed as not plannedExclude directories from "ng xi18n"#18885Labelsarea: @angular-devkit/build-angulardevkit/build-angular:i18nfeatureIssue that requests a new featurefeature: under considerationFeature request for which voting has completed and the request is now under considerationMilestoneneedsTriage@schwitin

Description

@schwitinschwitinopened on Feb 7, 2020🚀 Feature request

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

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-app

install a third party module npm @ng-bootstrap/ng-bootstrap

import this module in the app.module.ts

import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; ... imports: [ ... NgbModule ] ...

run xi18n ng xi18n --output-path src/locale --i18n-locale=de

look in the generated messages.xlf

<trans-unit id="ngb.alert.close" datatype="html"> <source>Close</source> <context-group purpose="location"> <context context-type="sourcefile">node_modules/@ng-bootstrap/ng-bootstrap/alert/alert.d.ts</context> <context context-type="linenumber">3</context> </context-group> </trans-unit>

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.

👍React with 👍29

Metadata

Metadata

Assignees

No one assigned

Labels

area: @angular-devkit/build-angulardevkit/build-angular:i18nfeatureIssue that requests a new featurefeature: under considerationFeature request for which voting has completed and the request is now under consideration

Type

No type

Projects

No projects

Milestone

  • needsTriageNo due date

Relationships

None yet

Development

No branches or pull requests

Issue actions

You can’t perform that action at this time.

Từ khóa » Ng Xi18n