case 4377

This commit is contained in:
2023-05-12 23:07:47 +00:00
parent d76cffe5c1
commit a42f1a92f2
6 changed files with 52 additions and 13 deletions

View File

@@ -98,11 +98,12 @@ function ayRegisterHelpers() {
Handlebars.registerHelper("ayT", function (translationKey) {
if (ayTranslationKeyCache[translationKey] == undefined) {
throw `ayT reporting helper error: the key "${translationKey}" is not present in the translation cache, did you forget to include it in your call to "await ayGetTranslations(['ExampleTranslationKey1','ExampleTranslationKey2','etc']);" in ayPrepareData()\nTranslationKeyCache contains: ${JSON.stringify(
ayTranslationKeyCache,
null,
3
)}?`;
return `**Error: "${translationKey}" translation key not cached or unknown**`;
// throw `ayT reporting helper error: the key "${translationKey}" is not present in the translation cache, did you forget to include it in your call to "await ayGetTranslations(['ExampleTranslationKey1','ExampleTranslationKey2','etc']);" in ayPrepareData()\nTranslationKeyCache contains: ${JSON.stringify(
// ayTranslationKeyCache,
// null,
// 3
// )}?`;
// return translationKey;
}
return ayTranslationKeyCache[translationKey];