Question presented to candidate: "We need our Angular app in English and French, with correct plurals, dates and currencies, and the marketing team wants French URLs to be indexable. How do you internationalise an Angular app, and what does the build produce?"
What a strong answer should cover:
@angular/localize(ng add @angular/localize); mark templates withi18n, attributes withi18n-<attr>, code with$localize.- Message IDs: generated by default, custom with
@@id; meaning and description for translators. - ICU expressions for plural and select.
ng extract-i18nproduces XLIFF (or JSON, ARB, XMB); translators return per-locale files.angular.jsoni18n.sourceLocale/localesandlocalize: true: one build per locale, own folder,<base href>andlang.LOCALE_IDdrivesDatePipe,CurrencyPipe,DecimalPipe.- Trade-offs: build-time (fast, needs a reload to switch) vs runtime libraries; missing-translation handling; SSR hydration with
withI18nSupport().
Clarifying questions expected:
- "Must users switch language without reloading the page?"
- "How will the server route
/fr/and/en-US/to the right build?"
Code / implementation expected: Yes β a marked-up template with an ICU plural, and the translation workflow.