mirror of
https://github.com/angular/angular.git
synced 2026-11-23 07:05:14 -05:00
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