Bird
0
0

You want to mark a complex sentence with embedded HTML tags for translation in Angular. Which is the correct approach?

hard📝 Application Q8 of 15
Angular - Internationalization and Accessibility
You want to mark a complex sentence with embedded HTML tags for translation in Angular. Which is the correct approach?
AAngular does not support translation of text with embedded HTML
BMark each HTML tag separately with its own <code>i18n</code> attribute
CUse <code>i18n</code> only on the outermost parent and ignore inner tags
DWrap the entire sentence including tags in a single element with <code>i18n</code>
Step-by-Step Solution
Solution:
  1. Step 1: Understand Angular's handling of HTML in translations

    Angular supports marking complex text with embedded HTML by placing i18n on the container element.
  2. Step 2: Identify best practice for translation markup

    Wrapping the entire sentence including tags in one element with i18n ensures translators see the full context.
  3. Final Answer:

    Wrap the entire sentence including tags in a single element with i18n -> Option D
  4. Quick Check:

    Use one i18n on container for complex HTML = A [OK]
Quick Trick: Mark full container with i18n for HTML text [OK]
Common Mistakes:
  • Marking each tag separately causing fragmented translations
  • Ignoring inner tags leads to incomplete context
  • Believing Angular can't translate HTML content

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes