diff --git a/packages/compiler-cli/test/compliance/r3_view_compiler_i18n_spec.ts b/packages/compiler-cli/test/compliance/r3_view_compiler_i18n_spec.ts index effb3a2486ceb..bcb1f76c9700e 100644 --- a/packages/compiler-cli/test/compliance/r3_view_compiler_i18n_spec.ts +++ b/packages/compiler-cli/test/compliance/r3_view_compiler_i18n_spec.ts @@ -3419,7 +3419,7 @@ describe('i18n support in the template compiler', () => { expect(errorThrown.ngParseErrors.length).toBe(1); const msg = errorThrown.ngParseErrors[0].toString(); expect(msg).toContain( - 'Could not mark an element as translatable inside of a translatable section'); + 'Cannot mark an element as translatable inside of a translatable section. Please remove the nested i18n marker.'); expect(msg).toContain(expectedErrorText); expect(msg).toMatch(/app\/spec\.ts\@\d+\:\d+/); }; diff --git a/packages/compiler/src/render3/r3_template_transform.ts b/packages/compiler/src/render3/r3_template_transform.ts index fcf27d1a6d210..4df6909321786 100644 --- a/packages/compiler/src/render3/r3_template_transform.ts +++ b/packages/compiler/src/render3/r3_template_transform.ts @@ -90,7 +90,7 @@ class HtmlAstToIvyAst implements html.Visitor { if (isI18nRootElement) { if (this.inI18nBlock) { this.reportError( - 'Could not mark an element as translatable inside of a translatable section', + 'Cannot mark an element as translatable inside of a translatable section. Please remove the nested i18n marker.', element.sourceSpan); } this.inI18nBlock = true;