Fix build

This commit is contained in:
Pieter Vander Vennet 2024-05-27 10:21:34 +02:00
parent 12a200c54d
commit e28f4aeaf7
5 changed files with 35 additions and 63 deletions

View file

@ -1,16 +1,13 @@
{ {
"id": "mapcomplete-changes", "id": "mapcomplete-changes",
"title": { "title": {
"en": "Changes made with MapComplete", "en": "Changes made with MapComplete"
"de": "Änderungen mit MapComplete"
}, },
"shortDescription": { "shortDescription": {
"en": "Shows changes made by MapComplete", "en": "Shows changes made by MapComplete"
"de": "Änderungen von MapComplete anzeigen"
}, },
"description": { "description": {
"en": "This maps shows all the changes made with MapComplete", "en": "This maps shows all the changes made with MapComplete"
"de": "Diese Karte zeigt alle mit MapComplete vorgenommenen Änderungen"
}, },
"icon": "./assets/svg/logo.svg", "icon": "./assets/svg/logo.svg",
"hideFromOverview": true, "hideFromOverview": true,
@ -21,8 +18,7 @@
{ {
"id": "mapcomplete-changes", "id": "mapcomplete-changes",
"name": { "name": {
"en": "Changeset centers", "en": "Changeset centers"
"de": "Zentrum der Änderungssätze"
}, },
"minzoom": 0, "minzoom": 0,
"source": { "source": {
@ -32,48 +28,41 @@
}, },
"title": { "title": {
"render": { "render": {
"en": "Changeset for {theme}", "en": "Changeset for {theme}"
"de": "Änderungssatz für {theme}"
} }
}, },
"description": { "description": {
"en": "Shows all MapComplete changes", "en": "Shows all MapComplete changes"
"de": "Alle MapComplete-Änderungen anzeigen"
}, },
"tagRenderings": [ "tagRenderings": [
{ {
"id": "show_changeset_id", "id": "show_changeset_id",
"render": { "render": {
"en": "Changeset <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>", "en": "Changeset <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>"
"de": "Änderungssatz <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>"
} }
}, },
{ {
"id": "contributor", "id": "contributor",
"question": { "question": {
"en": "What contributor did make this change?", "en": "What contributor did make this change?"
"de": "Welcher Mitwirkende hat diese Änderung vorgenommen?"
}, },
"freeform": { "freeform": {
"key": "user" "key": "user"
}, },
"render": { "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>"
"de": "Änderung vorgenommen von <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>"
} }
}, },
{ {
"id": "theme-id", "id": "theme-id",
"question": { "question": {
"en": "What theme was used to make this change?", "en": "What theme was used to make this change?"
"de": "Welches Thema wurde für die Änderung verwendet?"
}, },
"freeform": { "freeform": {
"key": "theme" "key": "theme"
}, },
"render": { "render": {
"en": "Change with theme <a href='https://mapcomplete.org/{theme}'>{theme}</a>", "en": "Change with theme <a href='https://mapcomplete.org/{theme}'>{theme}</a>"
"de": "Geändert mit Thema <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>"
} }
}, },
{ {
@ -82,23 +71,19 @@
"key": "locale" "key": "locale"
}, },
"question": { "question": {
"en": "What locale (language) was this change made in?", "en": "What locale (language) was this change made in?"
"de": "In welcher Benutzersprache wurde die Änderung vorgenommen?"
}, },
"render": { "render": {
"en": "User locale is {locale}", "en": "User locale is {locale}"
"de": "Benutzersprache {locale}"
} }
}, },
{ {
"id": "host", "id": "host",
"render": { "render": {
"en": "Change with with <a href='{host}'>{host}</a>", "en": "Change with with <a href='{host}'>{host}</a>"
"de": "Änderung über <a href='{host}'>{host}</a>"
}, },
"question": { "question": {
"en": "What host (website) was this change made with?", "en": "What host (website) was this change made with?"
"de": "Über welchen Host (Webseite) wurde diese Änderung vorgenommen?"
}, },
"freeform": { "freeform": {
"key": "host" "key": "host"
@ -119,12 +104,10 @@
{ {
"id": "version", "id": "version",
"question": { "question": {
"en": "What version of MapComplete was used to make this change?", "en": "What version of MapComplete was used to make this change?"
"de": "Mit welcher MapComplete Version wurde die Änderung vorgenommen?"
}, },
"render": { "render": {
"en": "Made with {editor}", "en": "Made with {editor}"
"de": "Erstellt mit {editor}"
}, },
"freeform": { "freeform": {
"key": "editor" "key": "editor"
@ -506,8 +489,7 @@
} }
], ],
"question": { "question": {
"en": "Themename contains {search}", "en": "Themename contains {search}"
"de": "Themenname enthält {search}"
} }
} }
] ]
@ -523,8 +505,7 @@
} }
], ],
"question": { "question": {
"en": "Themename does <b>not</b> contain {search}", "en": "Themename does <b>not</b> contain {search}"
"de": "Themename enthält <b>not</b> {search}"
} }
} }
] ]
@ -540,8 +521,7 @@
} }
], ],
"question": { "question": {
"en": "Made by contributor {search}", "en": "Made by contributor {search}"
"de": "Erstellt vom Mitwirkenden {search}"
} }
} }
] ]
@ -557,8 +537,7 @@
} }
], ],
"question": { "question": {
"en": "<b>Not</b> made by contributor {search}", "en": "<b>Not</b> made by contributor {search}"
"de": "<b>Nicht</b> erstellt von Mitwirkendem {search}"
} }
} }
] ]
@ -575,8 +554,7 @@
} }
], ],
"question": { "question": {
"en": "Made before {search}", "en": "Made before {search}"
"de": "Erstellt vor {search}"
} }
} }
] ]
@ -593,8 +571,7 @@
} }
], ],
"question": { "question": {
"en": "Made after {search}", "en": "Made after {search}"
"de": "Erstellt nach {search}"
} }
} }
] ]
@ -610,8 +587,7 @@
} }
], ],
"question": { "question": {
"en": "User language (iso-code) {search}", "en": "User language (iso-code) {search}"
"de": "Benutzersprache (ISO-Code) {search}"
} }
} }
] ]
@ -627,8 +603,7 @@
} }
], ],
"question": { "question": {
"en": "Made with host {search}", "en": "Made with host {search}"
"de": "Erstellt mit Host {search}"
} }
} }
] ]
@ -639,8 +614,7 @@
{ {
"osmTags": "add-image>0", "osmTags": "add-image>0",
"question": { "question": {
"en": "Changeset added at least one image", "en": "Changeset added at least one image"
"de": "Änderungssatz hat mindestens ein Bild hinzugefügt"
} }
} }
] ]
@ -651,8 +625,7 @@
{ {
"osmTags": "theme!=grb", "osmTags": "theme!=grb",
"question": { "question": {
"en": "Exclude GRB theme", "en": "Exclude GRB theme"
"de": "GRB-Thema ausschließen"
} }
} }
] ]
@ -663,8 +636,7 @@
{ {
"osmTags": "theme!=etymology", "osmTags": "theme!=etymology",
"question": { "question": {
"en": "Exclude etymology theme", "en": "Exclude etymology theme"
"de": "Etymologie-Thema ausschließen"
} }
} }
] ]
@ -679,8 +651,7 @@
{ {
"id": "link_to_more", "id": "link_to_more",
"render": { "render": {
"en": "More statistics can be found <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>here</a>", "en": "More statistics can be found <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>here</a>"
"de": "Weitere Statistiken gibt es <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>hier</a>"
} }
}, },
{ {

View file

@ -269,6 +269,7 @@ class AddImportLayers extends DesugaringStep<LayoutConfigJson> {
json.layers.push(importLayerResult) json.layers.push(importLayerResult)
} }
} catch (e) { } catch (e) {
console.error("Error", e)
context.err("Could not generate an import-layer for " + layer.id + " due to " + e) context.err("Could not generate an import-layer for " + layer.id + " due to " + e)
} }
} }

View file

@ -1890,7 +1890,7 @@ export class DetectDuplicatePresets extends DesugaringStep<LayoutConfig> {
) )
const layerIds = layersWithDup.map((l) => l.id) const layerIds = layersWithDup.map((l) => l.id)
context.err( context.err(
`This themes has multiple presets which are named:${dups}, namely layers ${layerIds.join( `This theme has multiple presets which are named:${dups}, namely layers ${layerIds.join(
", " ", "
)} this is confusing for contributors and is probably the result of reusing the same layer multiple times. Use \`{"override": {"=presets": []}}\` to remove some presets` )} this is confusing for contributors and is probably the result of reusing the same layer multiple times. Use \`{"override": {"=presets": []}}\` to remove some presets`
) )
@ -1911,7 +1911,7 @@ export class DetectDuplicatePresets extends DesugaringStep<LayoutConfig> {
) )
) { ) {
context.err( context.err(
`This themes has multiple presets with the same tags: ${presetATags.asHumanString( `This theme has multiple presets with the same tags: ${presetATags.asHumanString(
false, false,
false, false,
{} {}

View file

@ -174,10 +174,10 @@ export class Translation extends BaseUIElement {
return "en" return "en"
} }
for (const i in this.translations) { for (const i in this.translations) {
return this.translations[i] // Return a random language return i // Return a random language
} }
console.error("Missing language ", Locale.language.data, "for", this.translations) console.error("Missing language ", Locale.language.data, "for", this.translations)
return "" return undefined
} }
public textFor(language: string): string | undefined { public textFor(language: string): string | undefined {
return this.translations[this.actualLanguage(language)] return this.translations[this.actualLanguage(language)]

View file

@ -523,7 +523,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
v = v =
v.translations[useLang] ?? v.translations[useLang] ??
v.translations["*"] ?? v.translations["*"] ??
(v.textFor !== undefined ? v.textFor(useLang) : v) (v?.textFor(useLang) ?? v)
} }
if (v.InnerConstructElement !== undefined) { if (v.InnerConstructElement !== undefined) {