What is @angular/localize?
@angular/localize is an Angular package that provides localization support for Angular applications. It allows developers to easily translate their applications into different languages and manage translations efficiently.
What are @angular/localize's main functionalities?
Extracting Translatable Strings
This command extracts translatable strings from your Angular application and generates a translation file (e.g., messages.xlf). This file can then be used to provide translations for different languages.
ng extract-i18n
Translating Application
This command serves the application using a specific translation file (e.g., French). The application will display the translated strings based on the provided translation file.
ng serve --configuration=fr
Marking Strings for Translation
This code snippet shows how to mark a string for translation using the `i18n` attribute. The string 'Hello, world!' will be extracted and can be translated into different languages.
<p i18n>Hello, world!</p>
Other packages similar to @angular/localize
angular-translate
angular-translate is another popular library for AngularJS (1.x) that provides i18n support. It allows you to define translations in JSON files and switch between languages dynamically. While it is not compatible with Angular (2+), it offers similar functionalities for AngularJS applications.
i18next
i18next is a powerful internationalization framework for JavaScript applications, including Angular. It provides a wide range of features for managing translations, including support for pluralization, context, and interpolation. Compared to @angular/localize, i18next is more versatile and can be used with various JavaScript frameworks.
Angular
The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.
Usage information and reference details can be found in Angular documentation.
License: MIT
19.2.1 (2025-03-05)
common
| Commit | Type | Description |
| -- | -- | -- |
| c2de5f68b3 | fix | clean up onUrlChange
listener when root scope is destroyed (#60004) |
compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| 1dd94476b3 | fix | ensure template IDs are not reused if a source file changes (#60152) |
core
| Commit | Type | Description |
| -- | -- | -- |
| 1b3b05bf72 | fix | cache ComponentRef inputs and outputs (#60156) |
| 330c24aed9 | fix | prevent invoking replay listeners on disconnected nodes (#60103) |
| cfad089cc3 | fix | prevents event replay from being called on comment nodes (#60130) |
language-service
| Commit | Type | Description |
| -- | -- | -- |
| 3f0116607d | fix | Forward the tags for quick info from the type definition (#59524) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.0.0-next.0"></a>