Challenge - 5 Problems
Angular i18n Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ component_behavior
intermediate1:30remaining
What will be the rendered output of this Angular template?
Consider this Angular template snippet using i18n attribute:
What will the user see if no translation files are loaded?
<h1 i18n>Welcome to our site!</h1>
What will the user see if no translation files are loaded?
Angular
<h1 i18n>Welcome to our site!</h1>
Attempts:
2 left
💡 Hint
Think about what Angular does if no translation is found for marked text.
✗ Incorrect
When Angular cannot find a translation for marked text, it falls back to the original text inside the element.
📝 Syntax
intermediate1:30remaining
Which is the correct way to mark a button label for translation in Angular?
You want to mark the button text 'Submit' for translation. Which Angular syntax is correct?
Attempts:
2 left
💡 Hint
Angular uses a specific attribute to mark text for translation.
✗ Incorrect
The 'i18n' attribute is the standard way to mark text content for translation in Angular templates.
❓ state_output
advanced2:00remaining
What will be the value of the translated message in this Angular component?
Given this Angular component code snippet:
Assuming the translation file replaces 'Hello, {$INTERPOLATION}!' with 'Hola, {$INTERPOLATION}!', what will be rendered?
import { Component } from '@angular/core';
@Component({
selector: 'app-greet',
template: `Hello, {{name}}!
`
})
export class GreetComponent {
name = 'Alice';
}Assuming the translation file replaces 'Hello, {$INTERPOLATION}!' with 'Hola, {$INTERPOLATION}!', what will be rendered?
Attempts:
2 left
💡 Hint
Angular replaces interpolation inside translated strings.
✗ Incorrect
Angular applies translation and replaces interpolation placeholders with actual values at runtime.
🔧 Debug
advanced2:00remaining
Why does this Angular template fail to translate the button label?
Template snippet:
Translation file contains a translation for 'Click me'. Why is the label not translated?
<button i18n-label>Click me</button>
Translation file contains a translation for 'Click me'. Why is the label not translated?
Angular
<button i18n-label>Click me</button>
Attempts:
2 left
💡 Hint
Check Angular's official i18n attribute names.
✗ Incorrect
Angular uses 'i18n' attribute, not 'i18n-label'. The latter is invalid and ignored.
🧠 Conceptual
expert3:00remaining
How does Angular handle pluralization in translations marked with i18n?
You want to translate a message that changes based on a number, like 'You have 1 message' vs 'You have 5 messages'. How does Angular's i18n system support this?
Attempts:
2 left
💡 Hint
Think about how ICU messages work in translation systems.
✗ Incorrect
Angular supports pluralization by allowing ICU message syntax inside i18n marked text, enabling dynamic plural forms based on variables.