Merge branch 'develop' into feature/maproulette

This commit is contained in:
Robin van der Linde 2022-07-19 09:38:12 +02:00
commit 330f1f53f3
Signed by untrusted user: Robin-van-der-Linde
GPG key ID: 53956B3252478F0D
72 changed files with 29673 additions and 611 deletions

View file

@ -11,9 +11,8 @@ mkdir dist/assets 2> /dev/null
# This script ends every line with '&&' to chain everything. A failure will thus stop the build
npm run generate:editor-layer-index &&
npm run reset:layeroverview
npm run generate &&
npm run generate:layeroverview --force && # generate:layeroverview has to be run twice: the personal theme won't pick up all the layers otherwise; first time happens in 'npm run generate'
npm run generate:translations &&
npm run test &&
npm run generate:layouts

View file

@ -1,5 +1,5 @@
import * as fs from "fs";
import {readFileSync, writeFileSync} from "fs";
import {existsSync, mkdirSync, readFileSync, writeFileSync} from "fs";
import {Utils} from "../Utils";
import ScriptUtils from "./ScriptUtils";
@ -55,7 +55,7 @@ class TranslationPart {
}
const v = translations[translationsKey]
if (typeof (v) != "string") {
console.error(`Non-string object at ${context} in translation while trying to add more translations to '` + translationsKey + "': ", v)
console.error(`Non-string object at ${context} in translation while trying to add more translations to '` + translationsKey + "'. The offending object which _should_ be a translation is: ", v,"\n\nThe current object is:", this.toJson("en"))
throw "Error in an object depicting a translation: a non-string object was found. (" + context + ")\n You probably put some other section accidentally in the translation"
}
this.contents.set(translationsKey, v)
@ -101,7 +101,7 @@ class TranslationPart {
continue
}
if (v["id"] !== undefined && context.endsWith("tagRenderings")) {
if (v["id"] !== undefined && context.endsWith(".tagRenderings")) {
// We use the embedded id as key instead of the index as this is more stable
// Note: indonesian is shortened as 'id' as well!
if (v["en"] !== undefined || v["nl"] !== undefined) {
@ -591,7 +591,9 @@ function mergeThemeTranslations() {
}
}
if(!existsSync("./langs/themes")){
mkdirSync("./langs/themes")
}
const themeOverwritesWeblate = process.argv[2] === "--ignore-weblate"
const questionsPath = "assets/tagRenderings/questions.json"
const questionsParsed = JSON.parse(readFileSync(questionsPath, 'utf8'))