From d3cc84cdec99b8e9f24be63d1a2a54abe908f68b Mon Sep 17 00:00:00 2001 From: BeniBenj Date: Thu, 2 May 2024 15:35:27 +0200 Subject: [PATCH] fixes #971 --- src/nls.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/nls.ts b/src/nls.ts index fdcbfd92..9f358753 100644 --- a/src/nls.ts +++ b/src/nls.ts @@ -18,7 +18,12 @@ function createPatcher(translations: ITranslations): (value: T) => T { return value; } - return ((translations[match[1]] as unknown) ?? value) as T; + const translation = translations[match[1]] as unknown; + if (translation === undefined) { + throw new Error(`No translation found for ${value}`); + } + + return translation as T; }; }