Skip to content

Commit

Permalink
fixes #971
Browse files Browse the repository at this point in the history
  • Loading branch information
benibenj committed May 2, 2024
1 parent af201cd commit d3cc84c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/nls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ function createPatcher(translations: ITranslations): <T>(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;
};
}

Expand Down

0 comments on commit d3cc84c

Please sign in to comment.