Skip to content

Commit

Permalink
refactor(compiler): Fix out-of-order i18n issue (angular#53405)
Browse files Browse the repository at this point in the history
Fix a bug in the i18n retargeting and reordering phase.

PR Close angular#53405
  • Loading branch information
dylhunn authored and alxhub committed Dec 8, 2023
1 parent 8ab7e84 commit 44c2c26
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,7 @@
"verifyUniqueConsts"
]
}
],
"skipForTemplatePipeline": true
]
},
{
"description": "when the last element inside an i18n block has i18n attributes",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,18 @@ export function assignI18nSlotDependencies(job: CompilationJob) {
break;
}

if (ir.hasDependsOnSlotContextTrait(updateOp) && updateOp.target !== createOp.xref) {
break;
}

if (state !== null && updateOp.kind === ir.OpKind.I18nExpression &&
updateOp.usage === ir.I18nExpressionFor.I18nText) {
updateOp.usage === ir.I18nExpressionFor.I18nText &&
updateOp.i18nOwner === state.blockXref) {
const opToRemove = updateOp;
updateOp = updateOp.prev!;
updateOp = updateOp.next!;
ir.OpList.remove<ir.UpdateOp>(opToRemove);
i18nExpressionsInProgress.push(opToRemove);
continue;
}

if (ir.hasDependsOnSlotContextTrait(updateOp) && updateOp.target !== createOp.xref) {
break;
}

updateOp = updateOp.next!;
Expand Down

0 comments on commit 44c2c26

Please sign in to comment.