Bird
0
0

Given this Angular template snippet:

medium📝 state output Q13 of 15
Angular - Internationalization and Accessibility
Given this Angular template snippet:
<button i18n>Submit</button>

What will happen when you build the app with i18n enabled and provide translations?
AThe button text will remain 'Submit' regardless of language.
BThe app will throw a syntax error during build.
CThe button text will change to the translated word based on user locale.
DThe button will disappear from the UI.
Step-by-Step Solution
Solution:
  1. Step 1: Understand i18n attribute effect

    The i18n attribute marks text for translation during build.
  2. Step 2: Effect of providing translations

    When translations exist, Angular replaces the original text with the translated version based on user locale.
  3. Final Answer:

    The button text will change to the translated word based on user locale. -> Option C
  4. Quick Check:

    i18n + translations = translated text [OK]
Quick Trick: i18n text changes with user language if translations exist [OK]
Common Mistakes:
  • Assuming text never changes
  • Expecting build errors without syntax issues
  • Thinking UI elements disappear

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes