Fix: temporarily only warn for incomplete translations

This commit is contained in:
Pieter Vander Vennet 2023-06-26 11:00:19 +02:00
parent ecd84c2cf6
commit adb5d892fb
4 changed files with 51 additions and 21 deletions

View file

@ -31,6 +31,7 @@ class ValidateLanguageCompleteness extends DesugaringStep<any> {
convert(obj: any, context: string): { result: LayerConfig; errors: string[] } {
const errors = []
const warnings: string[] = []
const translations = Translation.ExtractAllTranslationsFrom(obj)
for (const neededLanguage of this._languages) {
translations
@ -40,7 +41,7 @@ class ValidateLanguageCompleteness extends DesugaringStep<any> {
t.tr.translations["*"] === undefined
)
.forEach((missing) => {
errors.push(
warnings.push(
context +
"A theme should be translation-complete for " +
neededLanguage +
@ -55,6 +56,7 @@ class ValidateLanguageCompleteness extends DesugaringStep<any> {
return {
result: obj,
errors,
warnings,
}
}
}
@ -248,6 +250,7 @@ class ValidateTheme extends DesugaringStep<LayoutConfigJson> {
const checked = new ValidateLanguageCompleteness(
...json["mustHaveLanguage"]
).convert(theme, theme.id)
errors.push(...checked.errors)
}
if (!json.hideFromOverview && theme.id !== "personal" && this._isBuiltin) {

View file

@ -1412,7 +1412,8 @@
"href": "{_backend}/changeset/{_last_edit:changeset}",
"text": {
"en": "Last edited on {_last_edit:timestamp} by {_last_edit:contributor}",
"nl": "Laatst gewijzigd op {_last_edit:timestamp} door {_last_edit:contributor} "
"nl": "Laatst gewijzigd op {_last_edit:timestamp} door {_last_edit:contributor} ",
"de": "Zuletzt bearbeitet am {_last_edit:timestamp} vom {_last_edit:contributor}"
},
"class": "subtle font-small"
}

View file

@ -1,13 +1,16 @@
{
"id": "mapcomplete-changes",
"title": {
"en": "Changes made with MapComplete"
"en": "Changes made with MapComplete",
"nl": "Wijzigingen gemaakt met MapComplete"
},
"shortDescription": {
"en": "Shows changes made by MapComplete"
"en": "Shows changes made by MapComplete",
"nl": "Toon wijzigingen gemaakt met MapComplete"
},
"description": {
"en": "This maps shows all the changes made with MapComplete"
"en": "This maps shows all the changes made with MapComplete",
"nl": "Deze kaart toont alle wijzigingen die met MapComplete gemaakt werden"
},
"icon": "./assets/svg/logo.svg",
"hideFromOverview": true,
@ -20,7 +23,8 @@
{
"id": "mapcomplete-changes",
"name": {
"en": "Changeset centers"
"en": "Changeset centers",
"nl": "Centerpunt van changeset"
},
"minzoom": 0,
"source": {
@ -35,7 +39,8 @@
}
},
"description": {
"en": "Shows all MapComplete changes"
"en": "Shows all MapComplete changes",
"nl": "Toon alle MapComplete wijzigingen"
},
"tagRenderings": [
{
@ -47,13 +52,15 @@
{
"id": "contributor",
"question": {
"en": "What contributor did make this change?"
"en": "What contributor did make this change?",
"nl": "Welke bijdrager maakte deze wijziging?"
},
"freeform": {
"key": "user"
},
"render": {
"en": "Change made by <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>"
"en": "Change made by <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>",
"nl": "Wijziging gemaakt door <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>"
}
},
{
@ -74,19 +81,23 @@
"key": "locale"
},
"question": {
"en": "What locale (language) was this change made in?"
"en": "What locale (language) was this change made in?",
"nl": "In welke locale (taal) werd deze wijziging gemaakt?"
},
"render": {
"en": "User locale is {locale}"
"en": "User locale is {locale}",
"nl": "De gebruikerstaal is {locale}"
}
},
{
"id": "host",
"render": {
"en": "Change with with <a href='{host}'>{host}</a>"
"en": "Change with <a href='{host}'>{host}</a>",
"nl": "Wijziging gemaakt met <a href='{host}'>{host}</a>"
},
"question": {
"en": "What host (website) was this change made with?"
"en": "What host (website) was this change made with?",
"nl": "Met welke host (website) werd deze wijziging gemaakt?"
},
"freeform": {
"key": "host"
@ -444,7 +455,8 @@
}
],
"question": {
"en": "Themename contains {search}"
"en": "Themename contains {search}",
"nl": "Themenaam bevat {search}"
}
}
]
@ -460,7 +472,8 @@
}
],
"question": {
"en": "Made by contributor {search}"
"en": "Made by contributor {search}",
"nl": "Gemaakt door bijdrager {search}"
}
}
]
@ -476,7 +489,8 @@
}
],
"question": {
"en": "<b>Not</b> made by contributor {search}"
"en": "<b>Not</b> made by contributor {search}",
"nl": "<b>Niet</b> gemaakt door bijdrager {search}"
}
}
]
@ -493,7 +507,8 @@
}
],
"question": {
"en": "Made before {search}"
"en": "Made before {search}",
"nl": "Gemaakt voor {search}"
}
}
]
@ -510,7 +525,8 @@
}
],
"question": {
"en": "Made after {search}"
"en": "Made after {search}",
"nl": "Gemaakt na {search}"
}
}
]
@ -526,7 +542,8 @@
}
],
"question": {
"en": "User language (iso-code) {search}"
"en": "User language (iso-code) {search}",
"nl": "De taal van de bijdrager is {search}"
}
}
]
@ -542,7 +559,8 @@
}
],
"question": {
"en": "Made with host {search}"
"en": "Made with host {search}",
"nl": "Gemaakt met host {search}"
}
}
]
@ -553,7 +571,8 @@
{
"osmTags": "add-image>0",
"question": {
"en": "Changeset added at least one image"
"en": "Changeset added at least one image",
"nl": "Changeset bevat minstens één afbeelding"
}
}
]

View file

@ -138,6 +138,13 @@
}
}
},
"last_edit": {
"render": {
"special": {
"text": "Zuletzt bearbeitet am {_last_edit:timestamp} vom {_last_edit:contributor}"
}
}
},
"level": {
"mappings": {
"0": {