New build system application missing i18n strings from templates
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- angular, typescript
調査の方向性
まず angular.json の application-builder 設定で問題を再現し、ng extract-i18n --format=json を実行します。結果を browser-builder 設定と比較し、TypeScript 内の $localization メッセージは抽出される一方で、コンポーネントの HTML テンプレート内のメッセージが欠落していることを確認します。テンプレートのメッセージが抽出に含まれれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Which @angular/* package(s) are the source of the bug?
compiler-cli
Is this a regression?
No
Description
I have opted in to the new build system, this is my angular.json after the upgrade:
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"my-lib": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
},
"@schematics/angular:application": {
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": {
"base": "dist/my-lib"
},
"i18nMissingTranslation": "ignore",
"deleteOutputPath": true,
"index": "src/index.html",
"polyfills": [
"@angular/localize/init",
"src/polyfills.ts"
],
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": [
"./node_modules/quill/dist/quill.min.js"
],
"stylePreprocessorOptions": {
"includePaths": [
"node_modules",
"src/app"
]
},
"allowedCommonJsDependencies": [
"@uppy/core",
"@uppy/tus",
"url-parse",
"lodash",
"namespace-emitter",
"classnames",
"is-shallow-equal",
"cropperjs",
"quill",
"ts-deepmerge"
],
"browser": "src/main.ts"
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
},
"development": {
"aot": false,
"optimization": false,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "development"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "my-lib:build:production"
},
"development": {
"buildTarget": "my-lib:build:development"
}
},
"defaultConfiguration": "development",
"options": {
"sslCert": "./node_modules/browser-sync/certs/server.crt",
"sslKey": "./node_modules/browser-sync/certs/server.key",
"ssl": true,
"liveReload": false
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"buildTarget": "my-lib:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test/test.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"styles": [
"src/styles.scss"
],
"stylePreprocessorOptions": {
"includePaths": [
"node_modules",
"src/app"
]
}
}
}
}
}
},
"cli": {
"analytics": false
}
}
The project is serving and building but when I try to extract the translation strings with:
ng extract-i18n --format=json
At the end I get:
Extraction Complete. (Messages: 713)
In fact with my previous setup:
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"my-lib": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
},
"@schematics/angular:application": {
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/my-lib",
"i18nMissingTranslation": "ignore",
"deleteOutputPath": true,
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": [
"./node_modules/quill/dist/quill.min.js"
],
"stylePreprocessorOptions": {
"includePaths": [
"node_modules",
"src/app"
]
},
"allowedCommonJsDependencies": [
"@uppy/core",
"@uppy/tus",
"url-parse",
"lodash",
"namespace-emitter",
"classnames",
"is-shallow-equal",
"cropperjs",
"quill",
"ts-deepmerge"
]
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
},
"development": {
"aot": false,
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "development"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "my-lib:build:production"
},
"development": {
"buildTarget": "my-lib:build:development"
}
},
"defaultConfiguration": "development",
"options": {
"sslCert": "./node_modules/browser-sync/certs/server.crt",
"sslKey": "./node_modules/browser-sync/certs/server.key",
"ssl": true,
"liveReload": false
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"buildTarget": "my-lib:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test/test.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"styles": [
"src/styles.scss"
],
"stylePreprocessorOptions": {
"includePaths": [
"node_modules",
"src/app"
]
}
}
}
}
}
},
"cli": {
"analytics": false
}
}
The same i18n extraction command gets me:
Extraction Complete. (Messages: 1602)
I notices that with the application builder translations are missing from the component html templates, while $localization used inside TS files are recognized.
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run ng version)
Angular CLI: 20.3.1
Node: 20.19.5
Anything else?
No response
- 主要言語
- TypeScript
- スター
- 27k
- フォーク
- 11.8k
- 平均マージ
- 16時間 35分
- マージ済み PR(30日)
- 176
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
angular/angular-cli のほかの issue
-
area: @angular/build gemini-triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
angular/angular-cli#33055 · コメント 1 件 · リアクション 3 件 ·
-
area: @angular/build gemini-triaged
難易度 4/5 3〜5日 初心者へのやさしさ 72/100
angular/angular-cli#34137 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 担当者 1 名 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 担当者 1 名 ·
angular/angular-cli の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
dennys-bd/agent-hive#184 ·
-
Add: hunch オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
AbdelStark/awesome-typesafe#104 ·
-
ai-observability bug team/ai-observability
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
vicharanashala/fln#563 ·