From bfc4c3cf4372773b526ff285115e4a650f05466e Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Mon, 7 Jun 2021 21:05:34 +0200 Subject: [PATCH] refactor(localize): ensure compatibility with noImplicitOverride (#42512) Adds the `override` keyword to the `localize` sources to ensure compatibility with `noImplicitOverride`. PR Close #42512 --- .../message_serialization/message_serializer.ts | 8 ++++---- .../translation_parsers/xliff1_translation_parser.ts | 4 ++-- .../translation_parsers/xliff2_translation_parser.ts | 2 +- .../translation_parsers/xtb_translation_parser.ts | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/localize/src/tools/src/translate/translation_files/message_serialization/message_serializer.ts b/packages/localize/src/tools/src/translate/translation_files/message_serialization/message_serializer.ts index af0fd9c3a7..57487a7b35 100644 --- a/packages/localize/src/tools/src/translate/translation_files/message_serialization/message_serializer.ts +++ b/packages/localize/src/tools/src/translate/translation_files/message_serialization/message_serializer.ts @@ -36,7 +36,7 @@ export class MessageSerializer extends BaseVisitor { return this.renderer.message; } - visitElement(element: Element): void { + override visitElement(element: Element): void { if (this.config.placeholder && element.name === this.config.placeholder.elementName) { const name = getAttrOrThrow(element, this.config.placeholder.nameAttribute); const body = this.config.placeholder.bodyAttribute && @@ -55,18 +55,18 @@ export class MessageSerializer extends BaseVisitor { } } - visitText(text: Text): void { + override visitText(text: Text): void { this.renderer.text(text.value); } - visitExpansion(expansion: Expansion): void { + override visitExpansion(expansion: Expansion): void { this.renderer.startIcu(); this.renderer.text(`${expansion.switchValue}, ${expansion.type},`); visitAll(this, expansion.cases); this.renderer.endIcu(); } - visitExpansionCase(expansionCase: ExpansionCase): void { + override visitExpansionCase(expansionCase: ExpansionCase): void { this.renderer.text(` ${expansionCase.value} {`); this.renderer.startContainer(); visitAll(this, expansionCase.expression); diff --git a/packages/localize/src/tools/src/translate/translation_files/translation_parsers/xliff1_translation_parser.ts b/packages/localize/src/tools/src/translate/translation_files/translation_parsers/xliff1_translation_parser.ts index 2dd951ffe4..c70a56578a 100644 --- a/packages/localize/src/tools/src/translate/translation_files/translation_parsers/xliff1_translation_parser.ts +++ b/packages/localize/src/tools/src/translate/translation_files/translation_parsers/xliff1_translation_parser.ts @@ -106,7 +106,7 @@ export class Xliff1TranslationParser implements TranslationParser