Skip to content

Loading Translations (with or without AOT)

Angular can load translations at build time (AOT) or runtime (JIT).

Build-time example:

Terminal window
ng build --localize

Runtime example using loadTranslations() in Angular 17+:

import { loadTranslations } from "@angular/localize";
loadTranslations({
"Hello, {{ name }}!": "Bonjour, {{ name }}!",
});

Explanation:

  • AOT embeds translations in compiled code
  • Runtime allows switching locales without rebuilding