From c09dcfbe72b44406e01bfddb4d05a1aaa4e32967 Mon Sep 17 00:00:00 2001 From: Chris Czach <42812259+chrisczach@users.noreply.github.com> Date: Mon, 12 Jun 2023 08:17:01 -0700 Subject: [PATCH 1/2] Fix node.lastKey never being set In cases where the key and translated value are the same or translated value isn't available the node.lastKey is never set. This causes issue #1416 where the value for the node constantly set to the same string. --- packages/core/lib/translate.directive.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/lib/translate.directive.ts b/packages/core/lib/translate.directive.ts index 5e859ff..5d34806 100644 --- a/packages/core/lib/translate.directive.ts +++ b/packages/core/lib/translate.directive.ts @@ -111,7 +111,7 @@ export class TranslateDirective implements AfterViewChecked, OnDestroy { this.lastParams = this.currentParams; let onTranslation = (res: unknown) => { - if (res !== key) { + if (res !== key || || !node.lastKey) { node.lastKey = key; } if (!node.originalContent) { From f7a4f3c79a6e56a8a9af253f70af4b10e41247c6 Mon Sep 17 00:00:00 2001 From: Chris Czach <42812259+chrisczach@users.noreply.github.com> Date: Mon, 12 Jun 2023 08:19:51 -0700 Subject: [PATCH 2/2] Update translate.directive.ts fix typo --- packages/core/lib/translate.directive.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/lib/translate.directive.ts b/packages/core/lib/translate.directive.ts index 5d34806..fdd253d 100644 --- a/packages/core/lib/translate.directive.ts +++ b/packages/core/lib/translate.directive.ts @@ -111,7 +111,7 @@ export class TranslateDirective implements AfterViewChecked, OnDestroy { this.lastParams = this.currentParams; let onTranslation = (res: unknown) => { - if (res !== key || || !node.lastKey) { + if (res !== key || !node.lastKey) { node.lastKey = key; } if (!node.originalContent) {