forked from MapComplete/MapComplete
		
	Merge branch 'develop'
This commit is contained in:
		
						commit
						dbe53afb49
					
				
					 11 changed files with 69 additions and 62 deletions
				
			
		| 
						 | 
					@ -16,7 +16,7 @@ export default class TitleHandler {
 | 
				
			||||||
        const currentTitle: UIEventSource<string> = state.selectedElement.map(
 | 
					        const currentTitle: UIEventSource<string> = state.selectedElement.map(
 | 
				
			||||||
            selected => {
 | 
					            selected => {
 | 
				
			||||||
                const layout = state.layoutToUse
 | 
					                const layout = state.layoutToUse
 | 
				
			||||||
                const defaultTitle = Translations.WT(layout?.title)?.txt ?? "MapComplete"
 | 
					                const defaultTitle = layout?.title?.txt ?? "MapComplete"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (selected === undefined) {
 | 
					                if (selected === undefined) {
 | 
				
			||||||
                    return defaultTitle
 | 
					                    return defaultTitle
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -148,6 +148,26 @@ export default class Wikidata {
 | 
				
			||||||
        return src;
 | 
					        return src;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 | 
					    public static async searchAdvanced(text: string, options: WikidataSearchoptions & {
 | 
				
			||||||
 | 
					        instanceOf: number}){
 | 
				
			||||||
 | 
					        const sparql = `SELECT * WHERE {
 | 
				
			||||||
 | 
					            SERVICE wikibase:mwapi {
 | 
				
			||||||
 | 
					                bd:serviceParam wikibase:api "EntitySearch" .
 | 
				
			||||||
 | 
					                    bd:serviceParam wikibase:endpoint "www.wikidata.org" .
 | 
				
			||||||
 | 
					                    bd:serviceParam mwapi:search "${text}" .
 | 
				
			||||||
 | 
					                    bd:serviceParam mwapi:language "${options.lang}" .
 | 
				
			||||||
 | 
					                    ?item wikibase:apiOutputItem mwapi:item .
 | 
				
			||||||
 | 
					                    ?num wikibase:apiOrdinal true .
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					                ?item (wdt:P279|wdt:P31) wd:Q${options.instanceOf}
 | 
				
			||||||
 | 
					        } ORDER BY ASC(?num) LIMIT ${options.maxCount}`
 | 
				
			||||||
 | 
					        const url = wds.sparqlQuery(sparql)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        const result = await Utils.downloadJson(url, {"User-Agent": "MapComplete script"})
 | 
				
			||||||
 | 
					        return result.results.bindings
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static async search(
 | 
					    public static async search(
 | 
				
			||||||
        search: string,
 | 
					        search: string,
 | 
				
			||||||
        options?: WikidataSearchoptions,
 | 
					        options?: WikidataSearchoptions,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -191,7 +191,7 @@ export default class SimpleAddUI extends Toggle {
 | 
				
			||||||
            preset.icon(),
 | 
					            preset.icon(),
 | 
				
			||||||
            new Combine([
 | 
					            new Combine([
 | 
				
			||||||
                title.SetClass("font-bold"),
 | 
					                title.SetClass("font-bold"),
 | 
				
			||||||
                Translations.WT(preset.description)?.FirstSentence()
 | 
					                preset.description?.FirstSentence()
 | 
				
			||||||
            ]).SetClass("flex flex-col")
 | 
					            ]).SetClass("flex flex-col")
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -202,7 +202,7 @@ export default class DeleteWizard extends Toggle {
 | 
				
			||||||
    private static generateDeleteTagRenderingConfig(softDeletionTags: TagsFilter,
 | 
					    private static generateDeleteTagRenderingConfig(softDeletionTags: TagsFilter,
 | 
				
			||||||
                                                    nonDeleteOptions: { if: TagsFilter; then: Translation }[],
 | 
					                                                    nonDeleteOptions: { if: TagsFilter; then: Translation }[],
 | 
				
			||||||
                                                    extraDeleteReasons: { explanation: Translation; changesetMessage: string }[],
 | 
					                                                    extraDeleteReasons: { explanation: Translation; changesetMessage: string }[],
 | 
				
			||||||
                                                    currentTags: any) {
 | 
					                                                    currentTags: any): TagRenderingConfig {
 | 
				
			||||||
        const t = Translations.t.delete
 | 
					        const t = Translations.t.delete
 | 
				
			||||||
        nonDeleteOptions = nonDeleteOptions ?? []
 | 
					        nonDeleteOptions = nonDeleteOptions ?? []
 | 
				
			||||||
        let softDeletionTagsStr = []
 | 
					        let softDeletionTagsStr = []
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -613,7 +613,7 @@ export class ImportPointButton extends AbstractImportButton {
 | 
				
			||||||
            icon: () => new Img(args.icon),
 | 
					            icon: () => new Img(args.icon),
 | 
				
			||||||
            layerToAddTo: state.filteredLayers.data.filter(l => l.layerDef.id === args.targetLayer)[0],
 | 
					            layerToAddTo: state.filteredLayers.data.filter(l => l.layerDef.id === args.targetLayer)[0],
 | 
				
			||||||
            name: args.text,
 | 
					            name: args.text,
 | 
				
			||||||
            title: Translations.WT(args.text),
 | 
					            title: Translations.T(args.text),
 | 
				
			||||||
            preciseInput: preciseInputSpec, // must be explicitely assigned, if 'undefined' won't work otherwise
 | 
					            preciseInput: preciseInputSpec, // must be explicitely assigned, if 'undefined' won't work otherwise
 | 
				
			||||||
            boundsFactor: 3
 | 
					            boundsFactor: 3
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -86,7 +86,7 @@ export default class MoveWizard extends Toggle {
 | 
				
			||||||
            moveReason.setData(reason)
 | 
					            moveReason.setData(reason)
 | 
				
			||||||
            moveButton = new SubtleButton(
 | 
					            moveButton = new SubtleButton(
 | 
				
			||||||
                reason.icon.SetStyle("height: 1.5rem; width: 1.5rem;"),
 | 
					                reason.icon.SetStyle("height: 1.5rem; width: 1.5rem;"),
 | 
				
			||||||
                Translations.WT(reason.invitingText)
 | 
					                Translations.T(reason.invitingText)
 | 
				
			||||||
            ).onClick(() => {
 | 
					            ).onClick(() => {
 | 
				
			||||||
                currentStep.setData("pick_location")
 | 
					                currentStep.setData("pick_location")
 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -207,7 +207,7 @@ export default class TagRenderingQuestion extends Combine {
 | 
				
			||||||
                applicableMappings.map((mapping, i) => {
 | 
					                applicableMappings.map((mapping, i) => {
 | 
				
			||||||
                    return {
 | 
					                    return {
 | 
				
			||||||
                        value: new And([mapping.if, ...allIfNotsExcept(i)]),
 | 
					                        value: new And([mapping.if, ...allIfNotsExcept(i)]),
 | 
				
			||||||
                        shown: Translations.WT(mapping.then)
 | 
					                        shown: Translations.T(mapping.then)
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                })
 | 
					                })
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -22,6 +22,25 @@ export default class Translations {
 | 
				
			||||||
        return s;
 | 
					        return s;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Converts a string or an object into a typed translation.
 | 
				
			||||||
 | 
					     * Translation objects ('Translation' and 'TypedTranslation') are converted/returned
 | 
				
			||||||
 | 
					     * 
 | 
				
			||||||
 | 
					     * Translations.T("some text") // => new TypedTranslation({"*": "some text"})
 | 
				
			||||||
 | 
					     * Translations.T("some text").txt // => "some text"
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * const t = new Translation({"nl": "vertaling", "en": "translation"})
 | 
				
			||||||
 | 
					     * Translations.T(t) // => new TypedTranslation<object>({"nl": "vertaling", "en": "translation"})
 | 
				
			||||||
 | 
					     * 
 | 
				
			||||||
 | 
					     * const t = new TypedTranslation({"nl": "vertaling", "en": "translation"})
 | 
				
			||||||
 | 
					     * Translations.T(t) // => t
 | 
				
			||||||
 | 
					     * 
 | 
				
			||||||
 | 
					     * const json: any = {"en": "English", "nl": "Nederlands"};
 | 
				
			||||||
 | 
					     * const translation = Translations.T(new Translation(json));
 | 
				
			||||||
 | 
					     * translation.textFor("en") // => "English"
 | 
				
			||||||
 | 
					     * translation.textFor("nl") // => "Nederlands"
 | 
				
			||||||
 | 
					     * 
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
    static T(t: string | any, context = undefined): TypedTranslation<object> {
 | 
					    static T(t: string | any, context = undefined): TypedTranslation<object> {
 | 
				
			||||||
        if (t === undefined || t === null) {
 | 
					        if (t === undefined || t === null) {
 | 
				
			||||||
            return undefined;
 | 
					            return undefined;
 | 
				
			||||||
| 
						 | 
					@ -30,7 +49,7 @@ export default class Translations {
 | 
				
			||||||
            t = "" + t
 | 
					            t = "" + t
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (typeof t === "string") {
 | 
					        if (typeof t === "string") {
 | 
				
			||||||
            return new TypedTranslation({"*": t}, context);
 | 
					            return new TypedTranslation<object>({"*": t}, context);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (t.render !== undefined) {
 | 
					        if (t.render !== undefined) {
 | 
				
			||||||
            const msg = "Creating a translation, but this object contains a 'render'-field. Use the translation directly"
 | 
					            const msg = "Creating a translation, but this object contains a 'render'-field. Use the translation directly"
 | 
				
			||||||
| 
						 | 
					@ -40,30 +59,12 @@ export default class Translations {
 | 
				
			||||||
        if (t instanceof TypedTranslation) {
 | 
					        if (t instanceof TypedTranslation) {
 | 
				
			||||||
            return t;
 | 
					            return t;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return new TypedTranslation(t, context);
 | 
					        if(t instanceof Translation){
 | 
				
			||||||
 | 
					            return new TypedTranslation<object>(t.translations)
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        return new TypedTranslation<object>(t, context);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * 'Wrap Translation': given an object containing translations OR a string, returns a translation object
 | 
					 | 
				
			||||||
     * 
 | 
					 | 
				
			||||||
     * const json: any = {"en": "English", "nl": "Nederlands"};
 | 
					 | 
				
			||||||
     * const translation = Translations.WT(new Translation(json));
 | 
					 | 
				
			||||||
     * translation.textFor("en") // => "English"
 | 
					 | 
				
			||||||
     * translation.textFor("nl") // => "Nederlands"
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    public static WT(s: string | Translation): Translation {
 | 
					 | 
				
			||||||
        if (s === undefined || s === null) {
 | 
					 | 
				
			||||||
            return undefined;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        if (typeof (s) === "string") {
 | 
					 | 
				
			||||||
            return new Translation({'*': s});
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        if (s instanceof Translation) {
 | 
					 | 
				
			||||||
            return s.Clone() /* MUST CLONE HERE! */;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        console.error("Trying to Translation.WT, but got ", s)
 | 
					 | 
				
			||||||
        throw "??? Not a valid translation"
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static CountTranslations() {
 | 
					    public static CountTranslations() {
 | 
				
			||||||
        const queue: any = [Translations.t];
 | 
					        const queue: any = [Translations.t];
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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": "Zeigt Änderungen von MapComplete"
 | 
					 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "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 Änderungen die mit MapComplete gemacht wurden"
 | 
					 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "maintainer": "",
 | 
					  "maintainer": "",
 | 
				
			||||||
  "icon": "./assets/svg/logo.svg",
 | 
					  "icon": "./assets/svg/logo.svg",
 | 
				
			||||||
| 
						 | 
					@ -25,8 +22,7 @@
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      "id": "mapcomplete-changes",
 | 
					      "id": "mapcomplete-changes",
 | 
				
			||||||
      "name": {
 | 
					      "name": {
 | 
				
			||||||
        "en": "Changeset centers",
 | 
					        "en": "Changeset centers"
 | 
				
			||||||
        "de": "Schwerpunkte von Änderungssätzen"
 | 
					 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "minzoom": 0,
 | 
					      "minzoom": 0,
 | 
				
			||||||
      "source": {
 | 
					      "source": {
 | 
				
			||||||
| 
						 | 
					@ -40,41 +36,35 @@
 | 
				
			||||||
      ],
 | 
					      ],
 | 
				
			||||||
      "title": {
 | 
					      "title": {
 | 
				
			||||||
        "render": {
 | 
					        "render": {
 | 
				
			||||||
          "en": "Changeset for {theme}",
 | 
					          "en": "Changeset for {theme}"
 | 
				
			||||||
          "de": "Änderungen für {theme}"
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "description": {
 | 
					      "description": {
 | 
				
			||||||
        "en": "Shows all MapComplete changes",
 | 
					        "en": "Shows all MapComplete changes"
 | 
				
			||||||
        "de": "Zeigt alle MapComplete Änderungen"
 | 
					 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "tagRenderings": [
 | 
					      "tagRenderings": [
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          "id": "render_id",
 | 
					          "id": "render_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": "Änderung <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>"
 | 
					 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          "id": "contributor",
 | 
					          "id": "contributor",
 | 
				
			||||||
          "render": {
 | 
					          "render": {
 | 
				
			||||||
            "en": "Change made by <a href='https://openstreetmap.org/user/{_last_edit:contributor}' target='_blank'>{_last_edit:contributor}</a>",
 | 
					            "en": "Change made by <a href='https://openstreetmap.org/user/{_last_edit:contributor}' target='_blank'>{_last_edit:contributor}</a>"
 | 
				
			||||||
            "de": "Änderung wurde von <a href='https://openstreetmap.org/user/{_last_edit:contributor}' target='_blank'>{_last_edit:contributor}</a> gemacht"
 | 
					 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          "id": "theme",
 | 
					          "id": "theme",
 | 
				
			||||||
          "render": {
 | 
					          "render": {
 | 
				
			||||||
            "en": "Change with theme <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>",
 | 
					            "en": "Change with theme <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>"
 | 
				
			||||||
            "de": "Änderung mit Thema <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>"
 | 
					 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
          "mappings": [
 | 
					          "mappings": [
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
              "if": "theme~http.*",
 | 
					              "if": "theme~http.*",
 | 
				
			||||||
              "then": {
 | 
					              "then": {
 | 
				
			||||||
                "en": "Change with <b>unofficial</b> theme <a href='https://mapcomplete.osm.be/theme.html?userlayout={theme}'>{theme}</a>",
 | 
					                "en": "Change with <b>unofficial</b> theme <a href='https://mapcomplete.osm.be/theme.html?userlayout={theme}'>{theme}</a>"
 | 
				
			||||||
                "de": "Änderung mit <b>inoffiziellem</b> Thema <a href='https://mapcomplete.osm.be/theme.html?userlayout={theme}'>{theme}</a>"
 | 
					 | 
				
			||||||
              }
 | 
					              }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          ]
 | 
					          ]
 | 
				
			||||||
| 
						 | 
					@ -338,8 +328,7 @@
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
              ],
 | 
					              ],
 | 
				
			||||||
              "question": {
 | 
					              "question": {
 | 
				
			||||||
                "en": "Themename contains {search}",
 | 
					                "en": "Themename contains {search}"
 | 
				
			||||||
                "de": "Themenname enthält {search}"
 | 
					 | 
				
			||||||
              }
 | 
					              }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          ]
 | 
					          ]
 | 
				
			||||||
| 
						 | 
					@ -355,8 +344,7 @@
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
              ],
 | 
					              ],
 | 
				
			||||||
              "question": {
 | 
					              "question": {
 | 
				
			||||||
                "en": "Made by contributor {search}",
 | 
					                "en": "Made by contributor {search}"
 | 
				
			||||||
                "de": "Erstellt von {search}"
 | 
					 | 
				
			||||||
              }
 | 
					              }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          ]
 | 
					          ]
 | 
				
			||||||
| 
						 | 
					@ -372,8 +360,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 {search}"
 | 
					 | 
				
			||||||
              }
 | 
					              }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          ]
 | 
					          ]
 | 
				
			||||||
| 
						 | 
					@ -388,8 +375,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 finden Sie <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>hier</a>"
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
          {
 | 
					          {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -161,8 +161,8 @@ async function createManifest(layout: LayoutConfig, alreadyWritten: string[]): P
 | 
				
			||||||
        console.log(icon)
 | 
					        console.log(icon)
 | 
				
			||||||
        throw "Icon is not an svg for " + layout.id
 | 
					        throw "Icon is not an svg for " + layout.id
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    const ogTitle = Translations.WT(layout.title).txt;
 | 
					    const ogTitle = Translations.T(layout.title).txt;
 | 
				
			||||||
    const ogDescr = Translations.WT(layout.description ?? "").txt;
 | 
					    const ogDescr = Translations.T(layout.description ?? "").txt;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const manifest = {
 | 
					    const manifest = {
 | 
				
			||||||
        name: name,
 | 
					        name: name,
 | 
				
			||||||
| 
						 | 
					@ -186,8 +186,8 @@ async function createLandingPage(layout: LayoutConfig, manifest, whiteIcons, alr
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Locale.language.setData(layout.language[0]);
 | 
					    Locale.language.setData(layout.language[0]);
 | 
				
			||||||
    const targetLanguage = layout.language[0]
 | 
					    const targetLanguage = layout.language[0]
 | 
				
			||||||
    const ogTitle = Translations.WT(layout.title).textFor(targetLanguage).replace(/"/g, '\\"');
 | 
					    const ogTitle = Translations.T(layout.title).textFor(targetLanguage).replace(/"/g, '\\"');
 | 
				
			||||||
    const ogDescr = Translations.WT(layout.shortDescription ?? "Easily add and edit geodata with OpenStreetMap").textFor(targetLanguage).replace(/"/g, '\\"');
 | 
					    const ogDescr = Translations.T(layout.shortDescription ?? "Easily add and edit geodata with OpenStreetMap").textFor(targetLanguage).replace(/"/g, '\\"');
 | 
				
			||||||
    let ogImage = layout.socialImage;
 | 
					    let ogImage = layout.socialImage;
 | 
				
			||||||
    let twitterImage = ogImage
 | 
					    let twitterImage = ogImage
 | 
				
			||||||
    if (ogImage === LayoutConfig.defaultSocialImage && layout.official) {
 | 
					    if (ogImage === LayoutConfig.defaultSocialImage && layout.official) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,7 +18,7 @@ function generateWikiEntry(layout: { hideFromOverview: boolean, id: string, shor
 | 
				
			||||||
|name= [https://mapcomplete.osm.be/${layout.id} ${layout.id}]
 | 
					|name= [https://mapcomplete.osm.be/${layout.id} ${layout.id}]
 | 
				
			||||||
|region= Worldwide
 | 
					|region= Worldwide
 | 
				
			||||||
|lang= ${languages}
 | 
					|lang= ${languages}
 | 
				
			||||||
|descr= A MapComplete theme: ${Translations.WT(layout.shortDescription)
 | 
					|descr= A MapComplete theme: ${Translations.T(layout.shortDescription)
 | 
				
			||||||
        .textFor("en")
 | 
					        .textFor("en")
 | 
				
			||||||
        .replace("<a href='", "[[")
 | 
					        .replace("<a href='", "[[")
 | 
				
			||||||
        .replace(/'>.*<\/a>/, "]]")
 | 
					        .replace(/'>.*<\/a>/, "]]")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue