forked from MapComplete/MapComplete
Add translation files for shared questions
This commit is contained in:
parent
9a13df9130
commit
a8a4b797fd
7 changed files with 97 additions and 9 deletions
|
@ -71,12 +71,14 @@
|
|||
"question": {
|
||||
"en": "What are the opening hours of {name}?",
|
||||
"fr": "Quelles sont les horaires d'ouverture de {name}?",
|
||||
"de": "Was sind die Öffnungszeiten von {name}?"
|
||||
"de": "Was sind die Öffnungszeiten von {name}?",
|
||||
"nl": "Wat zijn de openingsuren van {name}?"
|
||||
},
|
||||
"render": {
|
||||
"de": "<h3>Öffnungszeiten</h3>{opening_hours_table(opening_hours)}",
|
||||
"fr": "<h3>Horaires d'ouverture</h3>{opening_hours_table(opening_hours)}",
|
||||
"en": "<h3>Opening hours</h3>{opening_hours_table(opening_hours)}"
|
||||
"en": "<h3>Opening hours</h3>{opening_hours_table(opening_hours)}",
|
||||
"nl": "<h3>Openingsuren</h3>{opening_hours_table(opening_hours)}"
|
||||
},
|
||||
"freeform": {
|
||||
"key": "opening_hours",
|
||||
|
@ -92,4 +94,4 @@
|
|||
"#": "Prints all the tags",
|
||||
"render": "{all_tags()}"
|
||||
}
|
||||
}
|
||||
}
|
11
langs/shared-questions/de.json
Normal file
11
langs/shared-questions/de.json
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"undefined": {
|
||||
"phone": {
|
||||
"question": "Was ist die Telefonnummer von {name}?"
|
||||
},
|
||||
"opening_hours": {
|
||||
"question": "Was sind die Öffnungszeiten von {name}?",
|
||||
"render": "<h3>Öffnungszeiten</h3>{opening_hours_table(opening_hours)}"
|
||||
}
|
||||
}
|
||||
}
|
20
langs/shared-questions/en.json
Normal file
20
langs/shared-questions/en.json
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"undefined": {
|
||||
"phone": {
|
||||
"question": "What is the phone number of {name}?"
|
||||
},
|
||||
"email": {
|
||||
"question": "What is the email address of {name}?"
|
||||
},
|
||||
"website": {
|
||||
"question": "What is the website of {name}?"
|
||||
},
|
||||
"description": {
|
||||
"question": "Is there still something relevant you couldn't give in the previous questions? Add it here.<br/><span style='font-size: small'>Don't repeat already stated facts</span>"
|
||||
},
|
||||
"opening_hours": {
|
||||
"question": "What are the opening hours of {name}?",
|
||||
"render": "<h3>Opening hours</h3>{opening_hours_table(opening_hours)}"
|
||||
}
|
||||
}
|
||||
}
|
20
langs/shared-questions/fr.json
Normal file
20
langs/shared-questions/fr.json
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"undefined": {
|
||||
"phone": {
|
||||
"question": "Quel est le numéro de téléphone de {name} ?"
|
||||
},
|
||||
"email": {
|
||||
"question": "Quelle est l'adresse courriel de {name} ?"
|
||||
},
|
||||
"website": {
|
||||
"question": "Quel est le site internet de {name}?"
|
||||
},
|
||||
"description": {
|
||||
"question": "Y a-t-il quelque chose de pertinent que vous n'avez pas pu donner à la dernière question ? Ajoutez-le ici.<br/><span style='font-size: small'>Ne répétez pas des réponses déjà données</span>"
|
||||
},
|
||||
"opening_hours": {
|
||||
"question": "Quelles sont les horaires d'ouverture de {name}?",
|
||||
"render": "<h3>Horaires d'ouverture</h3>{opening_hours_table(opening_hours)}"
|
||||
}
|
||||
}
|
||||
}
|
7
langs/shared-questions/gl.json
Normal file
7
langs/shared-questions/gl.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"undefined": {
|
||||
"website": {
|
||||
"question": "Cal é a páxina web de {name}?"
|
||||
}
|
||||
}
|
||||
}
|
20
langs/shared-questions/nl.json
Normal file
20
langs/shared-questions/nl.json
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"undefined": {
|
||||
"phone": {
|
||||
"question": "Wat is het telefoonnummer van {name}?"
|
||||
},
|
||||
"email": {
|
||||
"question": "Wat is het email-adres van {name}?"
|
||||
},
|
||||
"website": {
|
||||
"question": "Wat is de website van {name}?"
|
||||
},
|
||||
"description": {
|
||||
"question": "Zijn er extra zaken die je niet in de bovenstaande vragen kwijt kon? Zet deze in de description<span style='font-size: small'>Herhaal geen antwoorden die je reeds gaf</span>"
|
||||
},
|
||||
"opening_hours": {
|
||||
"question": "Wat zijn de openingsuren van {name}?",
|
||||
"render": "<h3>Openingsuren</h3>{opening_hours_table(opening_hours)}"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -232,8 +232,8 @@ function MergeTranslation(source: any, target: any, language: string, context: s
|
|||
|
||||
targetV[language] = sourceV;
|
||||
let was = ""
|
||||
if(targetV[language] !== undefined && targetV[language] !== sourceV){
|
||||
was = " (overwritten "+targetV[language]+")"
|
||||
if (targetV[language] !== undefined && targetV[language] !== sourceV) {
|
||||
was = " (overwritten " + targetV[language] + ")"
|
||||
}
|
||||
console.log(" + ", context + "." + language, "-->", sourceV, was)
|
||||
continue
|
||||
|
@ -307,17 +307,25 @@ function mergeThemeTranslations() {
|
|||
|
||||
|
||||
const themeOverwritesWeblate = process.argv[2] === "--ignore-weblate"
|
||||
|
||||
if(!themeOverwritesWeblate) {
|
||||
const questionsPath = "assets/tagRenderings/questions.json"
|
||||
const questionsParsed = JSON.parse(readFileSync(questionsPath, 'utf8'))
|
||||
if (!themeOverwritesWeblate) {
|
||||
mergeLayerTranslations();
|
||||
mergeThemeTranslations();
|
||||
}else{
|
||||
|
||||
mergeLayerTranslation(questionsParsed, questionsPath, loadTranslationFilesFrom("shared-questions"))
|
||||
writeFileSync(questionsPath, JSON.stringify(questionsParsed, null, " "))
|
||||
|
||||
} else {
|
||||
console.log("Ignore weblate")
|
||||
}
|
||||
generateTranslationsObjectFrom(ScriptUtils.getLayerFiles(), "layers")
|
||||
generateTranslationsObjectFrom(ScriptUtils.getThemeFiles(), "themes")
|
||||
|
||||
if(!themeOverwritesWeblate) {
|
||||
|
||||
generateTranslationsObjectFrom([{path: questionsPath, parsed: questionsParsed}], "shared-questions")
|
||||
|
||||
if (!themeOverwritesWeblate) {
|
||||
// Generates the core translations
|
||||
compileTranslationsFromWeblate();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue