Skip to content

Commit a8042f9

Browse files
author
Angular Builds
committed
acf7532bd fix(@angular-devkit/build-angular): load translations fresh start
1 parent 3d942e2 commit a8042f9

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
"builders": "builders.json",
88
"dependencies": {
99
"@ampproject/remapping": "1.0.2",
10-
"@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#0421cb5e8",
11-
"@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#0421cb5e8",
12-
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#0421cb5e8",
10+
"@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#acf7532bd",
11+
"@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#acf7532bd",
12+
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#acf7532bd",
1313
"@babel/core": "7.16.7",
1414
"@babel/generator": "7.16.8",
1515
"@babel/helper-annotate-as-pure": "7.16.7",
@@ -20,7 +20,7 @@
2020
"@babel/runtime": "7.16.7",
2121
"@babel/template": "7.16.7",
2222
"@discoveryjs/json-ext": "0.5.6",
23-
"@ngtools/webpack": "github:angular/ngtools-webpack-builds#0421cb5e8",
23+
"@ngtools/webpack": "github:angular/ngtools-webpack-builds#acf7532bd",
2424
"ansi-colors": "4.1.1",
2525
"babel-loader": "8.2.3",
2626
"babel-plugin-istanbul": "6.1.1",

src/utils/i18n-options.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ function deleteTempDirectory(tempPath) {
216216
catch { }
217217
}
218218
function loadTranslations(locale, desc, workspaceRoot, loader, logger, usedFormats, duplicateTranslation) {
219+
let translations = undefined;
219220
for (const file of desc.files) {
220221
const loadResult = loader(path_1.default.join(workspaceRoot, file.path));
221222
for (const diagnostics of loadResult.diagnostics.messages) {
@@ -232,10 +233,10 @@ function loadTranslations(locale, desc, workspaceRoot, loader, logger, usedForma
232233
usedFormats === null || usedFormats === void 0 ? void 0 : usedFormats.add(loadResult.format);
233234
file.format = loadResult.format;
234235
file.integrity = loadResult.integrity;
235-
if (desc.translation) {
236+
if (translations) {
236237
// Merge translations
237238
for (const [id, message] of Object.entries(loadResult.translations)) {
238-
if (desc.translation[id] !== undefined) {
239+
if (translations[id] !== undefined) {
239240
const duplicateTranslationMessage = `[${file.path}]: Duplicate translations for message '${id}' when merging.`;
240241
switch (duplicateTranslation) {
241242
case schema_1.I18NTranslation.Ignore:
@@ -249,13 +250,14 @@ function loadTranslations(locale, desc, workspaceRoot, loader, logger, usedForma
249250
break;
250251
}
251252
}
252-
desc.translation[id] = message;
253+
translations[id] = message;
253254
}
254255
}
255256
else {
256257
// First or only translation file
257-
desc.translation = loadResult.translations;
258+
translations = loadResult.translations;
258259
}
259260
}
261+
desc.translation = translations;
260262
}
261263
exports.loadTranslations = loadTranslations;

uniqueId

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Wed Jan 19 2022 12:45:09 GMT+0000 (Coordinated Universal Time)
1+
Wed Jan 19 2022 17:14:55 GMT+0000 (Coordinated Universal Time)

0 commit comments

Comments
 (0)