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.
13.4.0 (2023-04-06)
common
| Commit | Type | Description |
| -- | -- | -- |
| ae34dbca1b | feat | Backport NgOptimizedImage to v13 |
Special Thanks
Alex Castle and Paul Gschwendtner
<!-- CHANGELOG SPLIT MARKER -->
<a name="15.2.6"></a>