To prepare an Angular component for translation, mark fixed template text with i18n, mark translatable attributes with i18n-attribute, and wrap strings in component code with $localize. Add useful translator context, use ICU expressions for plural or choice-dependent messages, then extract the marked text with ng extract-i18n.
Mark fixed text in the component template
Add i18n to each element whose text content should be translated. For example:
As an Amazon Associate I earn from qualifying purchases.
<h1 i18n>Hello!</h1>
For text that should be translated without adding a visible wrapper element, use ng-container:
<ng-container i18n>Welcome back</ng-container>
Mark text-valued attributes
Use the matching i18n-{attribute} marker for an attribute containing user-facing text. For example, mark an image’s title with i18n-title:
#1 Best Overall
<img src="help.png" title="Help" i18n-title>
Only mark text intended for localization; technical values such as image paths are not translation messages. See Angular’s template marking guidance.
Add context translators can use
Angular message metadata can include a meaning, a description, and a custom ID. The syntax is {meaning}|{description}@@{id}. Meaning distinguishes identical words used in different senses; description supplies context. For example:
<h1 i18n="site header|Introduction heading">Hello!</h1>
Descriptions help people understand a message, but do not affect its generated message ID. The same source text and meaning can be extracted once even when descriptions differ; a different meaning produces a different ID. Angular documents this behavior in its guide to managing marked text and custom IDs.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #2
Name interpolations
When a message contains a value, give the placeholder a name that explains its role. For example, a username placeholder is more useful to a translator than an anonymous expression:
<p i18n>Hello, {{ username //i18n(ph="name") }}!</p>
Placeholder names clarify what changes inside the message; they do not replace the need to translate the surrounding sentence as a whole.
Mark strings in component code with $localize
For a string in TypeScript rather than a template, use Angular’s $localize tagged template literal. Its metadata uses the same meaning, description, and ID convention, with a colon-delimited form:
Rank #3
const heading = $localize`:site header|Introduction heading:Hello!`;
For interpolated code strings, provide explicit placeholder names when they help explain the value to translators. Angular’s $localize API documentation describes the tagged-string API.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchRepresent plurals and choices as complete messages
Use ICU plural expressions when wording depends on a quantity and select expressions when it depends on a string choice. Include an other case so the message has a fallback. For example:
{minutes, plural, =0 {just now} =1 {one minute ago} other {{{ minutes }} minutes ago}}
The categories and grammar shown in an English example are not a universal set for every language. Give translators the complete message and its alternatives in context rather than splitting the English fragments into independently translated strings. Angular’s preparation guide covers ICU expressions.
Rank #4
Install localization support and extract the messages
Angular’s package guide documents ng add @angular/localize; it updates package and TypeScript configuration. By default, the package is placed in devDependencies. The --use-at-runtime option places it in dependencies; follow the requirements of the project’s Angular version and build configuration. See Add the localize package.
-
From the project root, mark the template messages and code strings that need translation.
Recommended Free Tools
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
Run
ng extract-i18nto create the source translation file. The default output ismessages.xlf. -
If needed, configure the output format, filename, or directory with the extraction command’s options described in Angular’s translation-file guide.
-
Use the extracted source file to create and translate a file for each target locale, including its plural and alternate-text expressions.
Choose message IDs with maintenance in mind
Angular generates IDs based on source text and meaning. Custom IDs are useful when a translation workflow requires a specific ID format or when a team wants IDs to carry application metadata. They also shift maintenance responsibility to the team: changing the source text does not change a custom ID, so an existing translation can become out of date.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Keep custom IDs unique. If different source strings share one custom ID, Angular can use the same extracted translation for both locations. Review extracted messages when source wording changes, especially where custom IDs are used. The details are in Angular’s guide to custom IDs.
Know what runtime translation loading does
$localize can evaluate messages using translations loaded at runtime, but loading another translation later does not update messages already processed. Angular’s loadTranslations API documents that this does not provide dynamic language switching without refreshing the browser. Treat runtime loading and extraction-based translated builds as distinct implementation approaches, not as interchangeable promises of live language switching.
Angular’s official internationalization overview provides the broader context for the framework’s localization workflow. The documentation reviewed for this guidance was accessed October 7, 2026; it does not identify a precise Angular release for every displayed instruction, so check the documentation for the version installed in your project.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →




