diff --git a/packages/localize/src/tools/src/translate/translation_files/message_serialization/target_message_renderer.ts b/packages/localize/src/tools/src/translate/translation_files/message_serialization/target_message_renderer.ts index 3db16dea25..449dfaf712 100644 --- a/packages/localize/src/tools/src/translate/translation_files/message_serialization/target_message_renderer.ts +++ b/packages/localize/src/tools/src/translate/translation_files/message_serialization/target_message_renderer.ts @@ -35,7 +35,9 @@ export class TargetMessageRenderer implements MessageRenderer<ɵParsedTranslatio this.icuDepth--; this.text('}'); } + private normalizePlaceholderName(name: string) { return name.replace(/-/g, '_'); } private renderPlaceholder(name: string) { + name = this.normalizePlaceholderName(name); if (this.icuDepth > 0) { this.text(`{${name}}`); } else { diff --git a/packages/localize/src/tools/test/translate/translation_files/translation_parsers/xliff1_translation_parser_spec.ts b/packages/localize/src/tools/test/translate/translation_files/translation_parsers/xliff1_translation_parser_spec.ts index 4a4c2268a7..594d2fabc7 100644 --- a/packages/localize/src/tools/test/translate/translation_files/translation_parsers/xliff1_translation_parser_spec.ts +++ b/packages/localize/src/tools/test/translate/translation_files/translation_parsers/xliff1_translation_parser_spec.ts @@ -88,7 +88,7 @@ describe('Xliff1TranslationParser', () => { * Source HTML: * * ``` - *