Open
Description
Which @angular/* package(s) are relevant/related to the feature request?
localize
Description
I would like to use custom IDs on ICU expression translations.
The following template
<h1 i18n="@@IcuPluralTest">ICU plural test {test, plural, =0 {now} other {{{test}} minutes}}</h1>
Results in two translations in json output format:
"IcuPluralTest": "ICU plural test {$ICU}",
"5042638883563958958": "{VAR_PLURAL, plural, =0 {now} other {{INTERPOLATION} minutes}}",
However, I have no way to assign a custom ID to the nested ICU expression
Proposed solution
Enable a syntax like
<h1 i18n="@@IcuPluralTest">ICU plural test {:@@IcuPluralTestNested:test, plural, =0 {now} other {{{test}} minutes}}</h1>
that allows assigning an ID to the nested ICU expression
Alternatives considered
As a workaround, a simple interpolation can be used in the template
<h1 i18n="@@IcuPluralTest">ICU plural test {{testPlural}}</h1>
with the ICU expression being defined in the .ts file using intl-messageformat
testPlural = new IntlMessageFormat($localize`:@@IcuPluralTestNested:{test, plural, =0 {now} other {# minutes}}`, $localize.locale).format(this as any);
Metadata
Metadata
Assignees
Labels
Issues related to localization and internationalizationIssues related to localization and internationalizationIssue that requests a new featureIssue that requests a new featureLabel to add when the not a sufficient number of votes or comments from unique authorsLabel to add when the not a sufficient number of votes or comments from unique authors