Bird
0
0

How can you combine Angular's i18n attribute with dynamic content inside a translated sentence?

hard📝 Application Q9 of 15
Angular - Internationalization and Accessibility
How can you combine Angular's i18n attribute with dynamic content inside a translated sentence?
AUse <code>i18n</code> on the container and <code>{{variable}}</code> inside the text
BPlace <code>i18n</code> on each dynamic variable separately
CDynamic content cannot be used inside <code>i18n</code> marked text
DUse <code>i18n</code> only on static parts and concatenate dynamic parts outside
Step-by-Step Solution
Solution:
  1. Step 1: Recall Angular's support for dynamic content in translations

    Angular allows interpolation expressions like {{variable}} inside elements marked with i18n.
  2. Step 2: Identify correct usage

    Mark the whole sentence with i18n and include dynamic parts as interpolations inside.
  3. Final Answer:

    Use i18n on the container and {{variable}} inside the text -> Option A
  4. Quick Check:

    Dynamic interpolation inside i18n container = D [OK]
Quick Trick: Put i18n on container with {{variables}} inside [OK]
Common Mistakes:
  • Trying to mark variables separately
  • Thinking dynamic content breaks translation
  • Concatenating strings outside i18n

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes