Better output for errors

This commit is contained in:
Pieter Vander Vennet 2022-04-18 01:06:22 +02:00
parent 0f5c132287
commit 9d8f0698f1
2 changed files with 62 additions and 1 deletions

View file

@ -300,7 +300,7 @@ function transformTranslation(obj: any, path: string[] = [], languageWhitelist :
if(value["en"] === undefined){
throw `At ${path.join(".")}: Missing 'en' translation for ${JSON.stringify(value)}`
throw `At ${path.join(".")}: Missing 'en' translation at path ${path.join(".")}.${key}\n\tThe translations in other languages are ${JSON.stringify(value)}`
}
const subParts : string[] = value["en"].match(/{[^}]*}/g)
let expr = `return new Translation(${JSON.stringify(value)}, "core:${path.join(".")}.${key}")`