Files
angular/packages/localize
aparziale 0f78a2f00c fix(core): improve error message for unparsable ICU expressions in translations
Previously, when a translation contained an ICU expression that could not be
parsed at runtime, the error was a plain `Unable to parse ICU expression in
"..." message.` without explaining the most common causes or carrying an
error code.

The error is now a `RuntimeError` with the dedicated code NG0702
(`UNPARSABLE_ICU_EXPRESSION`). The message explains that the translation must
contain a valid ICU expression and that ICU expressions can only be used in a
translation when the original message contains one as well. The detailed
message is guarded by `ngDevMode`, so it is tree-shaken away from production
bundles where only the error code remains, while the error itself is still
thrown in production because translations vary by locale and may not be
exercised during development.

Additionally, the `$localize` docs now call out that ICU expressions are not
supported by the tagged-string API.

Fixes #48217

(cherry picked from commit 3296939422)
2026-11-10 19:12:42 +00:00
..
2025-12-16 14:44:19 -08:00