Bird
0
0

Consider this Angular template snippet:

medium📝 Predict Output Q4 of 15
Angular - Internationalization and Accessibility
Consider this Angular template snippet:
<div i18n="alert|Warning message">Caution: High voltage!</div>

What will Angular do with this text during the build process when translations are provided?
AThrow a build error due to incorrect i18n syntax.
BIgnore the text since it has a description but no custom ID.
CReplace the text with the translated version based on the current locale.
DDuplicate the text in the output without changes.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the i18n attribute usage

    The attribute i18n="alert|Warning message" marks the text for translation with meaning and description.
  2. Step 2: Build process with translations

    During build, Angular extracts this text and replaces it with the appropriate translation for the active locale.
  3. Final Answer:

    Replace the text with the translated version based on the current locale. -> Option C
  4. Quick Check:

    Text marked with i18n is replaced by translations at build time. [OK]
Quick Trick: i18n text is replaced by translations during build [OK]
Common Mistakes:
  • Assuming description prevents translation
  • Thinking missing custom ID causes errors
  • Believing text remains untranslated

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes