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.
17.3.0 (2024-03-13)
compiler
| Commit | Type | Description |
| -- | -- | -- |
| 1a6beae8a2 | feat | Enable template pipeline by default. (#54571) |
| f386a04c9d | fix | handle two-way bindings to signal-based template variables in instruction generation (#54714) |
| 1f129f114e | fix | not catching for loop empty tracking expressions (#54772) |
compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| 12dc4d074e | fix | account for as expression in docs extraction (#54414) |
| da7fbb40f0 | fix | detect when the linker is working in unpublished angular and widen supported versions (#54439) |
| 492e03f699 | fix | flag two-way bindings to non-signal values in templates (#54714) |
| 5afa4f0ec1 | fix | support ModuleWithProviders
literal detection with typeof
(#54650) |
core
| Commit | Type | Description |
| -- | -- | -- |
| 331b16efd2 | feat | add API to inject attributes on the host node (#54604) |
| fb540e169a | feat | add migration for invalid two-way bindings (#54630) |
| c687b8f453 | feat | expose new output()
API (#54650) |
| c809069f21 | feat | introduce outputFromObservable()
interop function (#54650) |
| aff65fd1f4 | feat | introduce outputToObservable
interop helper (#54650) |
| 974958913c | feat | support TypeScript 5.4 (#54414) |
| 39a50f9a8d | fix | ensure all initializer functions run in an injection context (#54761) |
| 243ccce624 | fix | exclude class attribute intended for projection matching from directive matching (#54800) |
| 2909e9817d | fix | prevent infinite loops in clobbered elements check (#54425) |
| 7243c704cf | fix | return a readonly signal on asReadonly
. (#54706) |
| bb35414a38 | perf | speed up retrieval of DestroyRef
in EventEmitter
(#54748) |
http
| Commit | Type | Description |
| -- | -- | -- |
| 8d37ed035c | fix | exclude caching for authenticated HTTP requests (#54746) |
router
| Commit | Type | Description |
| -- | -- | -- |
| c1c7384e02 | feat | Add reusable types for router guards (#54580) |
| 7225485311 | fix | Navigations triggered by cancellation events should cancel previous navigation (#54710) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="17.2.4"></a>