fix(ivy): i18n - ensure that colons in i18n metadata are not rendered (#33820)

The `:` char is used as a metadata marker in `$localize` messages.
If this char appears in the metadata it must be escaped, as `\:`.
Previously, although the `:` char was being escaped, the TS AST
being generated was not correct and so it was being output double
escaped, which meant that it appeared in the rendered message.

As of TS 3.6.2 the "raw" string can be specified when creating tagged
template AST nodes, so it is possible to correct this.

PR Close #33820
This commit is contained in:
Pete Bacon Darwin
2019-11-15 16:25:32 +00:00
committed by Alex Rickabaugh
parent 74e6d379d8
commit 62f7d0fe5c
7 changed files with 44 additions and 27 deletions

View File

@ -264,7 +264,7 @@ describe('i18n support in the template compiler', () => {
$I18N_23$ = $MSG_EXTERNAL_idG$$APP_SPEC_TS_24$;
}
else {
$I18N_23$ = $localize \`:[BACKUP_MESSAGE_ID\\:idH]desc@@idG:Title G\`;
$I18N_23$ = $localize \`:[BACKUP_MESSAGE_ID\:idH]desc@@idG:Title G\`;
}
const $_c25$ = ["title", $I18N_23$];