Bird
0
0

Which syntax correctly marks a text for translation in an Angular template?

easy📝 Syntax Q3 of 15
Angular - Internationalization and Accessibility
Which syntax correctly marks a text for translation in an Angular template?
A<code><h1 i18n-text>Welcome</h1></code>
B<code><h1 translate>Welcome</h1></code>
C<code><h1 translatable>Welcome</h1></code>
D<code><h1 i18n>Welcome</h1></code>
Step-by-Step Solution
Solution:
  1. Step 1: Recall Angular i18n syntax

    Angular uses the i18n attribute to mark text for translation.
  2. Step 2: Compare options with correct syntax

    Only <h1 i18n>Welcome</h1> uses i18n attribute correctly in the template.
  3. Final Answer:

    <h1 i18n>Welcome</h1> -> Option D
  4. Quick Check:

    Correct i18n syntax = i18n attribute [OK]
Quick Trick: Use i18n attribute to mark text for translation [OK]
Common Mistakes:
  • Using non-existent attributes like translate or translatable
  • Adding extra suffixes to i18n attribute

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes