diff --git a/Customizations/JSON/FromJSON.ts b/Customizations/JSON/FromJSON.ts index f93c70002..307b3e94a 100644 --- a/Customizations/JSON/FromJSON.ts +++ b/Customizations/JSON/FromJSON.ts @@ -104,6 +104,10 @@ export class FromJSON { if (typeof (json) === "string") { return new Translation({"*": json}); } + if(json.render !== undefined){ + console.error("Using a 'render' where a translation is expected. Content is", json.render); + throw "ERROR: using a 'render' where none is expected" + } const tr = {}; let keyCount = 0; for (let key in json) { diff --git a/assets/layers/drinking_water/drinking_water.json b/assets/layers/drinking_water/drinking_water.json index 7c6e79707..4a8159b7c 100644 --- a/assets/layers/drinking_water/drinking_water.json +++ b/assets/layers/drinking_water/drinking_water.json @@ -45,7 +45,8 @@ "nl": "Is deze drinkwaterkraan nog steeds werkende?" }, "render": { - "en": "The operational status is {operational_status" + "en": "The operational status is {operational_status", + "nl": "Deze waterkraan-status is {operational_status}" }, "freeform": { "key": "operational_status" diff --git a/assets/layers/maps/maps.json b/assets/layers/maps/maps.json index e2e5f87a3..a05eca0e5 100644 --- a/assets/layers/maps/maps.json +++ b/assets/layers/maps/maps.json @@ -18,8 +18,8 @@ } }, "description": { - "en": "", - "nl": "" + "en": "A map, meant for tourists which is permanently installed in the public space", + "nl": "Een permantent geinstalleerde kaart" }, "tagRenderings": [ { diff --git a/assets/themes/toilets/toilets.json b/assets/themes/toilets/toilets.json index 0b85b52d7..3c532ae91 100644 --- a/assets/themes/toilets/toilets.json +++ b/assets/themes/toilets/toilets.json @@ -23,10 +23,8 @@ { "id": "Toilet", "name": { - "render": { - "en": "Toilets", - "de": "Toiletten" - } + "en": "Toilets", + "de": "Toiletten" }, "overpassTags": "amenity=toilets", "title": { @@ -59,10 +57,8 @@ "amenity=toilets" ], "description": { - "render": { "en": "A publicly accessible toilet or restroom", "de": "Eine öffentlich zugängliche Toilette" - } } }, { diff --git a/createLayouts.ts b/createLayouts.ts index 4eace8161..56f62eacd 100644 --- a/createLayouts.ts +++ b/createLayouts.ts @@ -45,9 +45,13 @@ function validate(layout: Layout) { missing[ln] = 0; present[ln] = 0; for (const translation of translations) { + if (translation.translations["*"] !== undefined) { + continue; + } const txt = translation.translations[ln]; const isMissing = txt === undefined || txt === "" || txt.toLowerCase().indexOf("todo") >= 0; if (isMissing) { + console.log(` ${layout.id}: No translation for`, ln, "in", translation.translations, "got:", txt) missing[ln]++ } else { present[ln]++; @@ -55,12 +59,21 @@ function validate(layout: Layout) { } } - console.log("Translation completenes for theme", layout.id); + let message = `Translation completenes for theme ${layout.id}` + let isComplete = true; for (const ln of layout.supportedLanguages) { const amiss = missing[ln]; const ok = present[ln]; const total = amiss + ok; - console.log(`${ln}: ${ok}/${total}`) + message += `\n${ln}: ${ok}/${total}` + if (ok !== total) { + isComplete = false; + } + } + if (isComplete) { + console.log(`${layout.id} is fully translated!`) + } else { + console.log(message) } } @@ -242,7 +255,11 @@ for (const layoutName in all) { wikiPage += "\n\n"+generateWikiEntry(layout); } -writeFile("wikiIndex", wikiPage, (err) => {err ?? console.log("Could not save wikiindex", err)}); +writeFile("wikiIndex", wikiPage, (err) => { + if (err !== null) { + console.log("Could not save wikiindex", err); + } +}); console.log("Counting all translations") Translations.CountTranslations(); console.log("All done!"); \ No newline at end of file