angular / angular/angular-cli

extract-i18n does not extract message from files loaded only server side

オープン
#22,871 コメント 7 件 リアクション 5 件 担当者 0 名 GitHub で見る
area: @angular-devkit/build-angular devkit/build-angular:i18n feature feature: insufficient votes
主要言語
TypeScript
スター
27k
フォーク
11.8k
平均マージ
14時間 23分
マージ済み PR(30日)
162

説明

# 🐞 Bug report

### Command (mark with an `x`)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [x ] extract-i18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

### Is this a regression?

Yes, the previous version in which this bug was not present was: ....

### Description
The extraction tool does not process files that do not have a direct dependency on the app.module, or, generally, on the browser side.
In my case an abstract service is replaced by two versions of the service, one browser side, the other server side. The server-side one is ignored during the extraction process.

## 🔬 Minimal Reproduction

I made a simple [repro app](https://github.com/manzonif/ng-extract-i18n-server) that reproduce the problem.
Just run extract-i18n to see that message in [server-service.service.ts](https://github.com/manzonif/ng-extract-i18n-server/blob/master/src/app/server-service.service.ts) is ignored.
## 🔥 Exception or Error

## 🌍 Your Environment

Angular: 12.0.1
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, language-service, material, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker

Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.1200.5
@angular-devkit/build-angular 12.0.5
@angular-devkit/build-optimizer 0.1200.5
@angular-devkit/core 12.0.1
@angular-devkit/schematics 12.0.1
@angular/flex-layout 12.0.0-beta.34
@angular/localize 12.0.5
@nguniversal/builders 12.1.3
@nguniversal/common 12.0.0
@nguniversal/express-engine 12.0.0
@schematics/angular 12.0.1
rxjs 7.4.0
typescript 4.2.4

**Anything else relevant?**

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Run extract-i18n in the linked repro app and compare its output with the message in server-service.service.ts. Trace how the command discovers files that are not directly dependent on app.module or the browser-side code. Done means messages from the server-side service are included in extraction output.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
localization, tooling
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。