From ea5c71de536626801c9069b52a7673e55f75200e Mon Sep 17 00:00:00 2001 From: jsangmeister <33004050+jsangmeister@users.noreply.github.com> Date: Tue, 11 Jul 2023 15:59:13 +0200 Subject: [PATCH] Update custom translations to work without PO file (#2510) --- .../src/app/site/modules/translations/translation-parser.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/app/site/modules/translations/translation-parser.ts b/client/src/app/site/modules/translations/translation-parser.ts index 2ad56e7e8b..5f514ed32a 100644 --- a/client/src/app/site/modules/translations/translation-parser.ts +++ b/client/src/app/site/modules/translations/translation-parser.ts @@ -47,9 +47,9 @@ export class OpenSlidesTranslateParser extends TranslateDefaultParser { */ public override getValue(target: any, key: string): any { const translation = super.getValue(target, key); - const customTranslationKey = Object.keys(this.customTranslations).find(original => original === translation); - if (customTranslationKey) { - return this.customTranslations[customTranslationKey]; + const customTranslationsKey = translation || key; // use the original string if no translation was found + if (customTranslationsKey && this.customTranslations.hasOwnProperty(customTranslationsKey)) { + return this.customTranslations[customTranslationsKey]; } else { return translation; }