Add better error messages when a translation is missing; add play forests

This commit is contained in:
Pieter Vander Vennet 2021-03-13 19:08:31 +01:00
parent 7a69847cda
commit 1c2646ae19
8 changed files with 156 additions and 13 deletions

View file

@ -53,6 +53,9 @@ export default class LayoutConfig {
} else {
this.language = json.language;
}
if(this.language.length == 0){
throw "No languages defined. Define at least one language"
}
if (json.title === undefined) {
throw "Title not defined in " + this.id;
}
@ -62,7 +65,7 @@ export default class LayoutConfig {
this.title = new Translation(json.title, context + ".title");
this.description = new Translation(json.description, context + ".description");
this.shortDescription = json.shortDescription === undefined ? this.description.FirstSentence() : new Translation(json.shortDescription, context + ".shortdescription");
this.descriptionTail = json.descriptionTail === undefined ? new Translation({"*": ""}, context) : new Translation(json.descriptionTail, context + ".descriptionTail");
this.descriptionTail = json.descriptionTail === undefined ? new Translation({"*": ""}, context+".descriptionTail") : new Translation(json.descriptionTail, context + ".descriptionTail");
this.icon = json.icon;
this.socialImage = json.socialImage;
this.startZoom = json.startZoom;