From f2fca2dad8576a18629591e886e511912c1d99e9 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sat, 14 Sep 2024 20:40:32 +0200 Subject: [PATCH 01/17] Fix: fix #2142 --- src/UI/InputElement/Helpers/OpeningHours/OHTable.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/UI/InputElement/Helpers/OpeningHours/OHTable.svelte b/src/UI/InputElement/Helpers/OpeningHours/OHTable.svelte index a95f1d3832..9d845dafe2 100644 --- a/src/UI/InputElement/Helpers/OpeningHours/OHTable.svelte +++ b/src/UI/InputElement/Helpers/OpeningHours/OHTable.svelte @@ -220,8 +220,8 @@ {/if} {#each range(7) as wd} - startSelection(wd, h)} on:end={() => endSelection(wd, h)} - on:move={() => moved(wd, h)} on:clear={() => clearSelection()} /> + startSelection(wd, h + 0.5)} on:end={() => endSelection(wd, h + 0.5)} + on:move={() => moved(wd, h + 0.5)} on:clear={() => clearSelection()} /> {/each} From 9b82a5ef63913e54a0d971fbd9b950b6bdd3df2e Mon Sep 17 00:00:00 2001 From: danieldegroot2 Date: Sat, 14 Sep 2024 15:12:04 +0000 Subject: [PATCH 02/17] Translated using Weblate (English) Currently translated at 100.0% (682 of 682 strings) Translation: MapComplete/Core Translate-URL: https://hosted.weblate.org/projects/mapcomplete/core/en/ --- langs/en.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/langs/en.json b/langs/en.json index 7f468f8e3c..94170812d2 100644 --- a/langs/en.json +++ b/langs/en.json @@ -618,7 +618,7 @@ "#": "These texts are shown above the theme buttons when no theme is loaded", "about": "About MapComplete", "featuredThemeTitle": "Featured this week", - "intro": "Maps about various topics which you contribute to", + "intro": "Maps about various topics which you can contribute to", "learnMore": "Learn more", "logIn": "Log in to see other themes you previously visited", "pickTheme": "Pick a theme below to get started.", @@ -873,4 +873,4 @@ "startsWithQ": "A wikidata identifier starts with Q and is followed by a number" } } -} \ No newline at end of file +} From f4d306e3ed2294f288327d9bb914d5df4a092384 Mon Sep 17 00:00:00 2001 From: kjon Date: Fri, 13 Sep 2024 18:57:57 +0000 Subject: [PATCH 03/17] Translated using Weblate (German) Currently translated at 99.8% (681 of 682 strings) Translation: MapComplete/Core Translate-URL: https://hosted.weblate.org/projects/mapcomplete/core/de/ --- langs/de.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/langs/de.json b/langs/de.json index 984be656ca..17670ef1e3 100644 --- a/langs/de.json +++ b/langs/de.json @@ -194,7 +194,7 @@ "josmNotOpened": "JOSM konnte nicht erreicht werden. Bitte sicherstellen, dass das Programm geöffnet und Remote Control aktiviert ist", "josmOpened": "JOSM ist geöffnet", "madeBy": "Erstellt von {author}", - "mapContributionsBy": "Die angezeigten Daten wurden bearbeitet durch {contributors}", + "mapContributionsBy": "Angezeigte Daten wurden bearbeitet durch {contributors}", "mapContributionsByAndHidden": "Die angezeigten Daten wurden bearbeitet von {contributors} und {hiddenCount} weiteren Beitragenden", "mapDataByOsm": "Kartendaten: OpenStreetMap", "mapillaryHelp": "Mapillary ist ein Online-Dienst, der Straßenbilder sammelt und sie unter einer freien Lizenz anbietet. Mitwirkende dürfen diese Bilder verwenden, um OpenStreetMap zu verbessern", From 69094bb58f71328be9f388426d698718b82bd98c Mon Sep 17 00:00:00 2001 From: danieldegroot2 Date: Sat, 14 Sep 2024 15:12:05 +0000 Subject: [PATCH 04/17] Translated using Weblate (Spanish) Currently translated at 64.8% (442 of 682 strings) Translation: MapComplete/Core Translate-URL: https://hosted.weblate.org/projects/mapcomplete/core/es/ --- langs/es.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/langs/es.json b/langs/es.json index a749a08a71..8526a6eb04 100644 --- a/langs/es.json +++ b/langs/es.json @@ -592,4 +592,4 @@ "description": "Un identificador de Wikidata" } } -} \ No newline at end of file +} From 075363534cc895b28ea730ead311bfb3149f9587 Mon Sep 17 00:00:00 2001 From: danieldegroot2 Date: Sat, 14 Sep 2024 15:12:05 +0000 Subject: [PATCH 05/17] Translated using Weblate (Chinese (Traditional Han script)) Currently translated at 96.3% (657 of 682 strings) Translation: MapComplete/Core Translate-URL: https://hosted.weblate.org/projects/mapcomplete/core/zh_Hant/ --- langs/zh_Hant.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/langs/zh_Hant.json b/langs/zh_Hant.json index 2027183fcc..c8a747652c 100644 --- a/langs/zh_Hant.json +++ b/langs/zh_Hant.json @@ -848,4 +848,4 @@ "startsWithQ": "維基數據編號以 Q 開頭後面接數字" } } -} \ No newline at end of file +} From 085c087c26d880eb96edb588e73e7d6b17f3ffa9 Mon Sep 17 00:00:00 2001 From: danieldegroot2 Date: Sat, 14 Sep 2024 15:12:05 +0000 Subject: [PATCH 06/17] Translated using Weblate (Czech) Currently translated at 98.0% (669 of 682 strings) Translation: MapComplete/Core Translate-URL: https://hosted.weblate.org/projects/mapcomplete/core/cs/ --- langs/cs.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/langs/cs.json b/langs/cs.json index 121337b98e..e5294a30cb 100644 --- a/langs/cs.json +++ b/langs/cs.json @@ -859,4 +859,4 @@ "startsWithQ": "Identifikátor wikidat začíná písmenem Q a následuje za ním číslo" } } -} \ No newline at end of file +} From 7ca93034b437a6b783caf312026c9c03d39a7754 Mon Sep 17 00:00:00 2001 From: gallegonovato Date: Sat, 14 Sep 2024 16:06:58 +0000 Subject: [PATCH 07/17] Translated using Weblate (Spanish) Currently translated at 65.1% (444 of 682 strings) Translation: MapComplete/Core Translate-URL: https://hosted.weblate.org/projects/mapcomplete/core/es/ --- langs/es.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/langs/es.json b/langs/es.json index 8526a6eb04..e615ea35d5 100644 --- a/langs/es.json +++ b/langs/es.json @@ -420,7 +420,8 @@ "index": { "#": "Estos textos son mostrados sobre los botones del tema cuando no hay un tema cargado", "featuredThemeTitle": "Esta semana destacamos", - "intro": "Mapas sobre diversos temas a los que contribuye", + "intro": "Mapas sobre diversos temas a los que puedes contribuir", + "learnMore": "Más información", "logIn": "Inicia sesión para ver otros temas que visitaste anteriormente", "pickTheme": "Elige un tema de abajo para empezar.", "title": "MapComplete" From 2443717b56f0f54a6985ee5e5ad7dcb55ac62ab1 Mon Sep 17 00:00:00 2001 From: gallegonovato Date: Sat, 14 Sep 2024 16:07:45 +0000 Subject: [PATCH 08/17] Translated using Weblate (Spanish) Currently translated at 95.8% (434 of 453 strings) Translation: MapComplete/themes Translate-URL: https://hosted.weblate.org/projects/mapcomplete/themes/es/ --- langs/themes/es.json | 68 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/langs/themes/es.json b/langs/themes/es.json index ef19ec679a..f4e86d3519 100644 --- a/langs/themes/es.json +++ b/langs/themes/es.json @@ -808,6 +808,72 @@ "description": "Los faros son edificios altos con una luz en la parte superior para guiar el tráfico marítimo.", "title": "Faros" }, + "mapcomplete-changes": { + "description": "Este mapa muestra todos los cambios realizados con MapComplete", + "layers": { + "0": { + "description": "Muestra todos los cambios de MapComplete", + "filter": { + "0": { + "options": { + "0": { + "question": "El nombre contiene {search}" + } + } + }, + "1": { + "options": { + "0": { + "question": "El nombre del tema no contiene {search}" + } + } + }, + "10": { + "options": { + "0": { + "question": "Excluir el tema de la etimología" + } + } + }, + "2": { + "options": { + "0": { + "question": "Hecho por el colaborador {search}" + } + } + }, + "3": { + "options": { + "0": { + "question": "No realizado por el colaborador {search}" + } + } + }, + "4": { + "options": { + "0": { + "question": "Realizado antes de {search}" + } + } + }, + "5": { + "options": { + "0": { + "question": "Realizado después de {search}" + } + } + }, + "6": { + "options": { + "0": { + "question": "Idioma del usuario (código iso) {search}" + } + } + } + } + } + } + }, "maproulette": { "description": "Tema que muestra las tareas de MapRoulette, permitiendo buscarlas, filtrarlas y arreglarlas.", "title": "Tareas de MapRoulette" @@ -1347,4 +1413,4 @@ "shortDescription": "Un mapa con papeleras", "title": "Papeleras" } -} \ No newline at end of file +} From 6672fc87b4326db65289dfa31599ec0583d6c0f4 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sat, 14 Sep 2024 22:43:09 +0200 Subject: [PATCH 09/17] Fix: some fixes to make studio useable again, probably fixes #2139 --- .../CollapsedTagRenderingPreview.svelte | 4 +- src/UI/Studio/EditLayerState.ts | 3 + src/UI/Studio/SchemaBasedArray.svelte | 134 ++++++++++-------- src/Utils.ts | 13 ++ 4 files changed, 89 insertions(+), 65 deletions(-) diff --git a/src/UI/Studio/CollapsedTagRenderingPreview.svelte b/src/UI/Studio/CollapsedTagRenderingPreview.svelte index 9c21d82aeb..2552f66997 100644 --- a/src/UI/Studio/CollapsedTagRenderingPreview.svelte +++ b/src/UI/Studio/CollapsedTagRenderingPreview.svelte @@ -30,7 +30,7 @@ .getSchemaStartingWith(schema.path) .filter((part) => part.path.length - 1 === schema.path.length) - let usesOverride = value["builtin"] !== undefined + let usesOverride = value?.["builtin"] !== undefined function schemaForMultitype() { const sch = { ...schema } @@ -138,7 +138,7 @@ {:else if typeof value === "string"} Builtin: {value} - {:else if value["builtin"]} + {:else if value?.["builtin"]} reused tagrendering {JSON.stringify(value["builtin"])} {:else} diff --git a/src/UI/Studio/EditLayerState.ts b/src/UI/Studio/EditLayerState.ts index 3fb627a4e7..871b75f173 100644 --- a/src/UI/Studio/EditLayerState.ts +++ b/src/UI/Studio/EditLayerState.ts @@ -159,6 +159,9 @@ export abstract class EditJsonState { } public getSchemaStartingWith(path: string[]) { + if(path === undefined){ + return undefined + } return this.schema.filter( (sch) => !path.some((part, i) => !(sch.path.length > path.length && sch.path[i] === part)) diff --git a/src/UI/Studio/SchemaBasedArray.svelte b/src/UI/Studio/SchemaBasedArray.svelte index 21bd1259f6..ca874a262b 100644 --- a/src/UI/Studio/SchemaBasedArray.svelte +++ b/src/UI/Studio/SchemaBasedArray.svelte @@ -5,18 +5,23 @@ import { TrashIcon } from "@babeard/svelte-heroicons/mini" import ShowConversionMessage from "./ShowConversionMessage.svelte" import Markdown from "../Base/Markdown.svelte" - import type { QuestionableTagRenderingConfigJson } from "../../Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson" + import type { + QuestionableTagRenderingConfigJson + } from "../../Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson" import CollapsedTagRenderingPreview from "./CollapsedTagRenderingPreview.svelte" import { Accordion } from "flowbite-svelte" + import { Utils } from "../../Utils" export let state: EditJsonState export let path: (string | number)[] = [] let schema: ConfigMeta = state.getSchema(path)[0] + console.log("SBA got schema", schema, "for path", path) - let title = schema.path.at(-1) + + let title = schema?.path?.at(-1) let singular = title if (title?.endsWith("s")) { - singular = title.slice(0, title.length - 1) + singular = title?.slice(0, title.length - 1) } let article = "a" if (singular?.match(/^[aeoui]/)) { @@ -25,18 +30,20 @@ const isTagRenderingBlock = path.length === 1 && path[0] === "tagRenderings" - if (isTagRenderingBlock) { + if (isTagRenderingBlock && schema !== undefined) { schema = { ...schema } schema.description = undefined } const subparts: ConfigMeta[] = state - .getSchemaStartingWith(schema.path) - .filter((part) => part.path.length - 1 === schema.path.length) + .getSchemaStartingWith(schema?.path) + ?.filter((part) => part.path.length - 1 === schema?.path?.length) let messages = state.messagesFor(path) let datapath = path const currentValue = state.getStoreFor<(string | QuestionableTagRenderingConfigJson)[]>(datapath) + currentValue.set(Utils.DedupT(currentValue.data)) + console.log("Current value is", currentValue.data) if (currentValue.data === undefined) { currentValue.setData([]) } @@ -62,68 +69,69 @@ currentValue.ping() } +{#if schema !== undefined} +
+

{schema.path.at(-1)}

-
-

{schema.path.at(-1)}

- - {#if subparts.length > 0} - - {/if} - {#if $currentValue === undefined} - No array defined - {:else if !Array.isArray($currentValue)} - Not an array: {typeof $currentValue} - {JSON.stringify(path)} - {JSON.stringify($currentValue).slice(0, 120)} - {:else if $currentValue?.length === 0} - No values are defined - {#if $messages.length > 0} - {#each $messages as message} - - {/each} + {#if subparts.length > 0} + {/if} - {:else if subparts.length === 0} - - {#each $currentValue as value, i} -
- - -
- {/each} - {:else} - - {#each $currentValue as value, i (value)} - + > + + +
{/each} - - {/if} -
- - {#if path.length === 1 && path[0] === "tagRenderings"} - + {#if path.length === 1 && path[0] === "tagRenderings"} + - {/if} - + > + Add a builtin tagRendering + + {/if} + +
- +{/if} diff --git a/src/Utils.ts b/src/Utils.ts index 99674d926e..03fe948835 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -401,6 +401,19 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be return newArr } + public static DedupT(arr: T[]): T[]{ + if(!arr){ + return arr + } + const items = [] + for (const item of arr) { + if(items.indexOf(item) < 0){ + items.push(item) + } + } + return items + } + /** * Finds all duplicates in a list of strings * From a6b501706926b32098295ef6ae9ea16d93e0e2c5 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 15 Sep 2024 00:10:01 +0200 Subject: [PATCH 10/17] Tooling: move translations for "mapcomplete-changes" into .proto.json to add more stability --- .../mapcomplete-changes.proto.json | 97 +++++++++++++------ scripts/ScriptUtils.ts | 7 +- 2 files changed, 74 insertions(+), 30 deletions(-) diff --git a/assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json b/assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json index 4a55a1cf13..096d7c8fc3 100644 --- a/assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json +++ b/assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json @@ -1,13 +1,17 @@ { "id": "mapcomplete-changes", "title": { - "en": "Changes made with MapComplete" + "en": "Changes made with MapComplete", + "de": "Änderungen mit MapComplete" }, "shortDescription": { - "en": "Shows changes made by MapComplete" + "en": "Shows changes made by MapComplete", + "de": "Zeigt die von MapComplete vorgenommenen Änderungen an" }, "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", + "es": "Este mapa muestra todos los cambios realizados con MapComplete" }, "icon": "./assets/svg/logo.svg", "hideFromOverview": true, @@ -18,7 +22,8 @@ { "id": "mapcomplete-changes", "name": { - "en": "Changeset centers" + "en": "Changeset centers", + "de": "Changeset-Zentren" }, "minzoom": 0, "source": { @@ -28,41 +33,49 @@ }, "title": { "render": { - "en": "Changeset for {theme}" + "en": "Changeset for {theme}", + "de": "Änderungssatz für {theme}" } }, "description": { - "en": "Shows all MapComplete changes" + "en": "Shows all MapComplete changes", + "de": "Zeigt alle MapComplete-Änderungen", + "es": "Muestra todos los cambios de MapComplete" }, "tagRenderings": [ { "id": "show_changeset_id", "render": { - "en": "Changeset {id}" + "en": "Changeset {id}", + "de": "Änderungssatz {id}" } }, { "id": "contributor", "question": { - "en": "What contributor did make this change?" + "en": "What contributor did make this change?", + "de": "Wer hat zu dieser Änderung beigetragen?" }, "freeform": { "key": "user" }, "render": { - "en": "Change made by {user}" + "en": "Change made by {user}", + "de": "Änderung vorgenommen von {user}" } }, { "id": "theme-id", "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 diese Änderung verwendet?" }, "freeform": { "key": "theme" }, "render": { - "en": "Change with theme {theme}" + "en": "Change with theme {theme}", + "de": "Änderung mit Thema {theme}" } }, { @@ -71,19 +84,23 @@ "key": "locale" }, "question": { - "en": "What locale (language) was this change made in?" + "en": "What locale (language) was this change made in?", + "de": "In welcher Sprache (Locale) wurde diese Änderung vorgenommen?" }, "render": { - "en": "User locale is {locale}" + "en": "User locale is {locale}", + "de": "Die Benutzersprache ist {locale}" } }, { "id": "host", "render": { - "en": "Change with with {host}" + "en": "Change with with {host}", + "de": "Änderung mit {host}" }, "question": { - "en": "What host (website) was this change made with?" + "en": "What host (website) was this change made with?", + "de": "Bei welchem Host (Website) wurde diese Änderung vorgenommen?" }, "freeform": { "key": "host" @@ -104,10 +121,12 @@ { "id": "version", "question": { - "en": "What version of MapComplete was used to make this change?" + "en": "What version of MapComplete was used to make this change?", + "de": "Welche Version von MapComplete wurde verwendet, um diese Änderung vorzunehmen?" }, "render": { - "en": "Made with {editor}" + "en": "Made with {editor}", + "de": "Erstellt mit {editor}" }, "freeform": { "key": "editor" @@ -143,7 +162,9 @@ } ], "question": { - "en": "Themename contains {search}" + "en": "Themename contains {search}", + "de": "Themenname enthält {search}", + "es": "El nombre contiene {search}" } } ] @@ -159,7 +180,9 @@ } ], "question": { - "en": "Themename does not contain {search}" + "en": "Themename does not contain {search}", + "de": "Themename enthält nicht {search}", + "es": "El nombre del tema no contiene {search}" } } ] @@ -175,7 +198,9 @@ } ], "question": { - "en": "Made by contributor {search}" + "en": "Made by contributor {search}", + "de": "Erstellt von Mitwirkendem {search}", + "es": "Hecho por el colaborador {search}" } } ] @@ -191,7 +216,9 @@ } ], "question": { - "en": "Not made by contributor {search}" + "en": "Not made by contributor {search}", + "de": "Nicht erstellt von Mitwirkendem {search}", + "es": "No realizado por el colaborador {search}" } } ] @@ -208,7 +235,9 @@ } ], "question": { - "en": "Made before {search}" + "en": "Made before {search}", + "de": "Erstellt vor {search}", + "es": "Realizado antes de {search}" } } ] @@ -225,7 +254,9 @@ } ], "question": { - "en": "Made after {search}" + "en": "Made after {search}", + "de": "Erstellt nach {search}", + "es": "Realizado después de {search}" } } ] @@ -241,7 +272,9 @@ } ], "question": { - "en": "User language (iso-code) {search}" + "en": "User language (iso-code) {search}", + "de": "Benutzersprache (ISO-Code) {search}", + "es": "Idioma del usuario (código iso) {search}" } } ] @@ -257,7 +290,8 @@ } ], "question": { - "en": "Made with host {search}" + "en": "Made with host {search}", + "de": "Erstellt mit Host {search}" } } ] @@ -268,7 +302,8 @@ { "osmTags": "add-image>0", "question": { - "en": "Changeset added at least one image" + "en": "Changeset added at least one image", + "de": "Changeset hat mindestens ein Bild hinzugefügt" } } ] @@ -279,7 +314,8 @@ { "osmTags": "theme!=grb", "question": { - "en": "Exclude GRB theme" + "en": "Exclude GRB theme", + "de": "GRB-Thema ausschließen" } } ] @@ -290,7 +326,9 @@ { "osmTags": "theme!=etymology", "question": { - "en": "Exclude etymology theme" + "en": "Exclude etymology theme", + "de": "Etymologie-Thema ausschließen", + "es": "Excluir el tema de la etimología" } } ] @@ -305,7 +343,8 @@ { "id": "link_to_more", "render": { - "en": "More statistics can be found here" + "en": "More statistics can be found here", + "de": "Weitere Statistiken findest du hier" } }, { diff --git a/scripts/ScriptUtils.ts b/scripts/ScriptUtils.ts index d006e8740f..2db71de76d 100644 --- a/scripts/ScriptUtils.ts +++ b/scripts/ScriptUtils.ts @@ -95,9 +95,14 @@ export default class ScriptUtils { } public static getThemePaths(): string[] { - return ScriptUtils.readDirRecSync("./assets/themes") + const blacklist = ["assets/themes/mapcomplete-changes/mapcomplete-changes.json"] + const normalFiles = ScriptUtils.readDirRecSync("./assets/themes") .filter((path) => path.endsWith(".json") && !path.endsWith(".proto.json")) .filter((path) => path.indexOf("license_info.json") < 0) + .filter(path => !blacklist.some(black => path.endsWith(black))) + const specialfiles = ["./assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json"] + return normalFiles.concat(specialfiles) + } public static getThemeFiles(): { parsed: LayoutConfigJson; path: string; raw: string }[] { From 7d809c35099a5e396a57c55dc86641f866db93e8 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 15 Sep 2024 00:14:01 +0200 Subject: [PATCH 11/17] Chore: add some missing translations --- .../mapcomplete-changes/mapcomplete-changes.proto.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json b/assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json index 096d7c8fc3..54b92aeaf4 100644 --- a/assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json +++ b/assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json @@ -11,7 +11,9 @@ "description": { "en": "This maps shows all the changes made with MapComplete", "de": "Diese Karte zeigt alle mit MapComplete vorgenommenen Änderungen", - "es": "Este mapa muestra todos los cambios realizados con MapComplete" + "es": "Este mapa muestra todos los cambios realizados con MapComplete", + "pl": "Ta mapa pokazuje wszystkie zmiany wprowadzone za pomocą MapComplete" + }, "icon": "./assets/svg/logo.svg", "hideFromOverview": true, @@ -164,7 +166,8 @@ "question": { "en": "Themename contains {search}", "de": "Themenname enthält {search}", - "es": "El nombre contiene {search}" + "es": "El nombre contiene {search}", + "pl": "Nazwa tematu zawiera {search}" } } ] From 72135c41418ec0f8b2e294dc17b425bbd056b7bd Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 15 Sep 2024 00:17:03 +0200 Subject: [PATCH 12/17] chore(release): 0.46.9 --- CHANGELOG.md | 16 ++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c01a70c57..7eb16a3e6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,22 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [0.46.9](https://github.com/USERNAME/REPOSITORY_NAME/compare/v0.46.8...v0.46.9) (2024-09-14) + + +### Bug Fixes + +* fix [#2142](https://github.com/pietervdvn/MapComplete/issues/2142) ([f2fca2d](https://github.com/USERNAME/REPOSITORY_NAME/commitsf2fca2dad8576a18629591e886e511912c1d99e9)) +* nobrand= is actually applied when using the Name suggestion index ([c3bb0cb](https://github.com/USERNAME/REPOSITORY_NAME/commitsc3bb0cb83787c299ee4a92e8df6046aa448d77c8)) +* scroll horizontal images into view ([0397863](https://github.com/USERNAME/REPOSITORY_NAME/commits03978631ebd1e61abd13dd7a53bdb400c3d0f059)) +* some fixes to make studio useable again, probably fixes [#2139](https://github.com/pietervdvn/MapComplete/issues/2139) ([6672fc8](https://github.com/USERNAME/REPOSITORY_NAME/commits6672fc87b4326db65289dfa31599ec0583d6c0f4)) + + +### Theme improvements + +* **disaster_respone:** add a police station layer, add this and more layers to disaster_response theme ([418a4a7](https://github.com/USERNAME/REPOSITORY_NAME/commits418a4a71af5824487e4aa6754701e5d14371beae)) +* **disaster_response:** add defibrillators and logical zoom levels ([65fceb9](https://github.com/USERNAME/REPOSITORY_NAME/commits65fceb9434294051c8f565d89f42443c6afe3fb8)) + ### [0.46.8](https://github.com/USERNAME/REPOSITORY_NAME/compare/v0.46.7...v0.46.8) (2024-09-13) diff --git a/package-lock.json b/package-lock.json index a42d04cf48..be13f6370c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "mapcomplete", - "version": "0.46.8", + "version": "0.46.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "mapcomplete", - "version": "0.46.8", + "version": "0.46.9", "license": "GPL-3.0-or-later", "dependencies": { "@comunica/core": "^3.0.1", diff --git a/package.json b/package.json index c8ca8d9c93..fae4bdf1a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mapcomplete", - "version": "0.46.8", + "version": "0.46.9", "repository": "https://github.com/pietervdvn/MapComplete", "description": "A small website to edit OSM easily", "bugs": "https://github.com/pietervdvn/MapComplete/issues", From 89aaae427dde500f7d4c363d7051c8d91aa84316 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 15 Sep 2024 00:19:39 +0200 Subject: [PATCH 13/17] Tooling: automatically push --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fae4bdf1a4..0bdfe22db0 100644 --- a/package.json +++ b/package.json @@ -121,7 +121,7 @@ "reuse-compliance": "reuse lint", "housekeeping": "git pull && npx update-browserslist-db@latest && npm run weblate:merge-heavy && npm run generate && npm run generate:docs && npm run generate:schemas && npm run generate:contributor-list && vite-node scripts/fetchLanguages.ts && vite-node scripts/generateSunnyUnlabeled.ts && npm run format && git add assets/ langs/ Docs/ **/*.ts Docs/* src/* && git commit -m 'chore: automated housekeeping...'", "###": "MICROSERVICES AND SERVER MAINTAINENCE", - "release": "standard-version", + "release": "standard-version && git push --follow-tags", "release:minor": "standard-version --release-as minor", "release:patch": "standard-version --release-as patch", "release:major": "standard-version --release-as major", From bf38d09032141f40e2b2c8026bc547057979307d Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 15 Sep 2024 00:56:39 +0200 Subject: [PATCH 14/17] Chore: translation sync --- langs/cs.json | 2 +- langs/de.json | 2 +- langs/en.json | 2 +- langs/es.json | 2 +- langs/layers/en.json | 44 ++++++++++++++++++++++++++++++++++++++++++++ langs/themes/de.json | 2 +- langs/themes/es.json | 2 +- langs/themes/pl.json | 16 ++++++++++++++++ langs/zh_Hant.json | 2 +- 9 files changed, 67 insertions(+), 7 deletions(-) diff --git a/langs/cs.json b/langs/cs.json index e5294a30cb..121337b98e 100644 --- a/langs/cs.json +++ b/langs/cs.json @@ -859,4 +859,4 @@ "startsWithQ": "Identifikátor wikidat začíná písmenem Q a následuje za ním číslo" } } -} +} \ No newline at end of file diff --git a/langs/de.json b/langs/de.json index 17670ef1e3..3d4932ead6 100644 --- a/langs/de.json +++ b/langs/de.json @@ -873,4 +873,4 @@ "startsWithQ": "Ein Wikidata-Identifikator beginnt mit Q und wird von einer Zahl gefolgt" } } -} +} \ No newline at end of file diff --git a/langs/en.json b/langs/en.json index 94170812d2..e4e1cbda72 100644 --- a/langs/en.json +++ b/langs/en.json @@ -873,4 +873,4 @@ "startsWithQ": "A wikidata identifier starts with Q and is followed by a number" } } -} +} \ No newline at end of file diff --git a/langs/es.json b/langs/es.json index e615ea35d5..07f6f6e7d3 100644 --- a/langs/es.json +++ b/langs/es.json @@ -593,4 +593,4 @@ "description": "Un identificador de Wikidata" } } -} +} \ No newline at end of file diff --git a/langs/layers/en.json b/langs/layers/en.json index 1115d81bf4..5dc29a970e 100644 --- a/langs/layers/en.json +++ b/langs/layers/en.json @@ -7697,6 +7697,50 @@ "render": "Playground device" } }, + "police": { + "description": "Many types of police facilities ", + "name": "Police stations", + "presets": { + "0": { + "description": "A police office where the general public can enter for inquiries", + "title": "a police office" + }, + "1": { + "description": "A place where police performs checks on travelling people", + "title": "a police checkpoint" + }, + "2": { + "description": "An administrative police office without services for the general public.", + "title": "an administrative, police backoffice" + }, + "3": { + "description": "A jail run by the police without public services. People are detained here for a short time (at most a few days), e.g. for small misdemeanors, disturbance of the public order or awaiting a trial" + }, + "4": { + "description": "A naval or maritime base for the maritime police; often with a pier and police boats nearby" + } + }, + "tagRenderings": { + "4_z2nrdhy6tyyh4fd": { + "mappings": { + "0": { + "then": "This police office has some cells to detain people" + }, + "1": { + "then": "This police office does not have cells to detain people" + } + }, + "question": "Does this police office have detention facilities?" + }, + "police_name": { + "question": "What is the name of this police facility?", + "render": "{name}" + } + }, + "title": { + "render": "{name}" + } + }, "postboxes": { "description": "The layer showing postboxes.", "name": "Postboxes", diff --git a/langs/themes/de.json b/langs/themes/de.json index d7e258cc74..afd7a11144 100644 --- a/langs/themes/de.json +++ b/langs/themes/de.json @@ -1474,4 +1474,4 @@ "shortDescription": "Eine Karte mit Abfalleimern", "title": "Abfalleimer" } -} +} \ No newline at end of file diff --git a/langs/themes/es.json b/langs/themes/es.json index f4e86d3519..ae9284db15 100644 --- a/langs/themes/es.json +++ b/langs/themes/es.json @@ -1413,4 +1413,4 @@ "shortDescription": "Un mapa con papeleras", "title": "Papeleras" } -} +} \ No newline at end of file diff --git a/langs/themes/pl.json b/langs/themes/pl.json index e3be5755f4..347bf3fdd9 100644 --- a/langs/themes/pl.json +++ b/langs/themes/pl.json @@ -644,6 +644,22 @@ }, "title": "Krawężniki i przejścia" }, + "mapcomplete-changes": { + "description": "Ta mapa pokazuje wszystkie zmiany wprowadzone za pomocą MapComplete", + "layers": { + "0": { + "filter": { + "0": { + "options": { + "0": { + "question": "Nazwa tematu zawiera {search}" + } + } + } + } + } + } + }, "maproulette": { "description": "Temat pokazujący zadania MapRoulette, umożliwiający ich wyszukiwanie, filtrowanie i naprawianie.", "title": "Zadania MapRoulette" diff --git a/langs/zh_Hant.json b/langs/zh_Hant.json index c8a747652c..2027183fcc 100644 --- a/langs/zh_Hant.json +++ b/langs/zh_Hant.json @@ -848,4 +848,4 @@ "startsWithQ": "維基數據編號以 Q 開頭後面接數字" } } -} +} \ No newline at end of file From 114f484faf34a39cad032ce1caf7ae3558af1602 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 15 Sep 2024 00:57:38 +0200 Subject: [PATCH 15/17] Chore: Fix build --- .../mapcomplete-changes.json | 99 +++++++++++++------ .../mapcomplete-changes.proto.json | 1 - scripts/ScriptUtils.ts | 31 ++++-- scripts/generateTranslations.ts | 4 +- 4 files changed, 93 insertions(+), 42 deletions(-) diff --git a/assets/themes/mapcomplete-changes/mapcomplete-changes.json b/assets/themes/mapcomplete-changes/mapcomplete-changes.json index 7873f6b663..67501aaefb 100644 --- a/assets/themes/mapcomplete-changes/mapcomplete-changes.json +++ b/assets/themes/mapcomplete-changes/mapcomplete-changes.json @@ -1,13 +1,18 @@ { "id": "mapcomplete-changes", "title": { - "en": "Changes made with MapComplete" + "en": "Changes made with MapComplete", + "de": "Änderungen mit MapComplete" }, "shortDescription": { - "en": "Shows changes made by MapComplete" + "en": "Shows changes made by MapComplete", + "de": "Zeigt die von MapComplete vorgenommenen Änderungen an" }, "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", + "es": "Este mapa muestra todos los cambios realizados con MapComplete", + "pl": "Ta mapa pokazuje wszystkie zmiany wprowadzone za pomocą MapComplete" }, "icon": "./assets/svg/logo.svg", "hideFromOverview": true, @@ -18,7 +23,8 @@ { "id": "mapcomplete-changes", "name": { - "en": "Changeset centers" + "en": "Changeset centers", + "de": "Changeset-Zentren" }, "minzoom": 0, "source": { @@ -28,41 +34,49 @@ }, "title": { "render": { - "en": "Changeset for {theme}" + "en": "Changeset for {theme}", + "de": "Änderungssatz für {theme}" } }, "description": { - "en": "Shows all MapComplete changes" + "en": "Shows all MapComplete changes", + "de": "Zeigt alle MapComplete-Änderungen", + "es": "Muestra todos los cambios de MapComplete" }, "tagRenderings": [ { "id": "show_changeset_id", "render": { - "en": "Changeset {id}" + "en": "Changeset {id}", + "de": "Änderungssatz {id}" } }, { "id": "contributor", "question": { - "en": "What contributor did make this change?" + "en": "What contributor did make this change?", + "de": "Wer hat zu dieser Änderung beigetragen?" }, "freeform": { "key": "user" }, "render": { - "en": "Change made by {user}" + "en": "Change made by {user}", + "de": "Änderung vorgenommen von {user}" } }, { "id": "theme-id", "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 diese Änderung verwendet?" }, "freeform": { "key": "theme" }, "render": { - "en": "Change with theme {theme}" + "en": "Change with theme {theme}", + "de": "Änderung mit Thema {theme}" } }, { @@ -71,19 +85,23 @@ "key": "locale" }, "question": { - "en": "What locale (language) was this change made in?" + "en": "What locale (language) was this change made in?", + "de": "In welcher Sprache (Locale) wurde diese Änderung vorgenommen?" }, "render": { - "en": "User locale is {locale}" + "en": "User locale is {locale}", + "de": "Die Benutzersprache ist {locale}" } }, { "id": "host", "render": { - "en": "Change with with {host}" + "en": "Change with with {host}", + "de": "Änderung mit {host}" }, "question": { - "en": "What host (website) was this change made with?" + "en": "What host (website) was this change made with?", + "de": "Bei welchem Host (Website) wurde diese Änderung vorgenommen?" }, "freeform": { "key": "host" @@ -104,10 +122,12 @@ { "id": "version", "question": { - "en": "What version of MapComplete was used to make this change?" + "en": "What version of MapComplete was used to make this change?", + "de": "Welche Version von MapComplete wurde verwendet, um diese Änderung vorzunehmen?" }, "render": { - "en": "Made with {editor}" + "en": "Made with {editor}", + "de": "Erstellt mit {editor}" }, "freeform": { "key": "editor" @@ -505,7 +525,10 @@ } ], "question": { - "en": "Themename contains {search}" + "en": "Themename contains {search}", + "de": "Themenname enthält {search}", + "es": "El nombre contiene {search}", + "pl": "Nazwa tematu zawiera {search}" } } ] @@ -521,7 +544,9 @@ } ], "question": { - "en": "Themename does not contain {search}" + "en": "Themename does not contain {search}", + "de": "Themename enthält nicht {search}", + "es": "El nombre del tema no contiene {search}" } } ] @@ -537,7 +562,9 @@ } ], "question": { - "en": "Made by contributor {search}" + "en": "Made by contributor {search}", + "de": "Erstellt von Mitwirkendem {search}", + "es": "Hecho por el colaborador {search}" } } ] @@ -553,7 +580,9 @@ } ], "question": { - "en": "Not made by contributor {search}" + "en": "Not made by contributor {search}", + "de": "Nicht erstellt von Mitwirkendem {search}", + "es": "No realizado por el colaborador {search}" } } ] @@ -570,7 +599,9 @@ } ], "question": { - "en": "Made before {search}" + "en": "Made before {search}", + "de": "Erstellt vor {search}", + "es": "Realizado antes de {search}" } } ] @@ -587,7 +618,9 @@ } ], "question": { - "en": "Made after {search}" + "en": "Made after {search}", + "de": "Erstellt nach {search}", + "es": "Realizado después de {search}" } } ] @@ -603,7 +636,9 @@ } ], "question": { - "en": "User language (iso-code) {search}" + "en": "User language (iso-code) {search}", + "de": "Benutzersprache (ISO-Code) {search}", + "es": "Idioma del usuario (código iso) {search}" } } ] @@ -619,7 +654,8 @@ } ], "question": { - "en": "Made with host {search}" + "en": "Made with host {search}", + "de": "Erstellt mit Host {search}" } } ] @@ -630,7 +666,8 @@ { "osmTags": "add-image>0", "question": { - "en": "Changeset added at least one image" + "en": "Changeset added at least one image", + "de": "Changeset hat mindestens ein Bild hinzugefügt" } } ] @@ -641,7 +678,8 @@ { "osmTags": "theme!=grb", "question": { - "en": "Exclude GRB theme" + "en": "Exclude GRB theme", + "de": "GRB-Thema ausschließen" } } ] @@ -652,7 +690,9 @@ { "osmTags": "theme!=etymology", "question": { - "en": "Exclude etymology theme" + "en": "Exclude etymology theme", + "de": "Etymologie-Thema ausschließen", + "es": "Excluir el tema de la etimología" } } ] @@ -667,7 +707,8 @@ { "id": "link_to_more", "render": { - "en": "More statistics can be found here" + "en": "More statistics can be found here", + "de": "Weitere Statistiken findest du hier" } }, { diff --git a/assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json b/assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json index 54b92aeaf4..cde6afad78 100644 --- a/assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json +++ b/assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json @@ -13,7 +13,6 @@ "de": "Diese Karte zeigt alle mit MapComplete vorgenommenen Änderungen", "es": "Este mapa muestra todos los cambios realizados con MapComplete", "pl": "Ta mapa pokazuje wszystkie zmiany wprowadzone za pomocą MapComplete" - }, "icon": "./assets/svg/logo.svg", "hideFromOverview": true, diff --git a/scripts/ScriptUtils.ts b/scripts/ScriptUtils.ts index 2db71de76d..7eb369a3a0 100644 --- a/scripts/ScriptUtils.ts +++ b/scripts/ScriptUtils.ts @@ -94,19 +94,28 @@ export default class ScriptUtils { }) } - public static getThemePaths(): string[] { - const blacklist = ["assets/themes/mapcomplete-changes/mapcomplete-changes.json"] + public static getThemePaths(useTranslationPaths = false): string[] { const normalFiles = ScriptUtils.readDirRecSync("./assets/themes") .filter((path) => path.endsWith(".json") && !path.endsWith(".proto.json")) .filter((path) => path.indexOf("license_info.json") < 0) - .filter(path => !blacklist.some(black => path.endsWith(black))) + + if (!useTranslationPaths) { + return normalFiles + } const specialfiles = ["./assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json"] - return normalFiles.concat(specialfiles) + const blacklist = ["assets/themes/mapcomplete-changes/mapcomplete-changes.json"] + + const filtered = normalFiles.filter(path => !blacklist.some(black => path.endsWith(black))) + return filtered.concat(specialfiles) } - public static getThemeFiles(): { parsed: LayoutConfigJson; path: string; raw: string }[] { - return this.getThemePaths().map((path) => { + public static getThemeFiles(useTranslationPaths = false): { + parsed: LayoutConfigJson; + path: string; + raw: string + }[] { + return this.getThemePaths(useTranslationPaths).map((path) => { try { const contents = readFileSync(path, { encoding: "utf8" }) if (contents === "") { @@ -153,6 +162,7 @@ export default class ScriptUtils { const data = await ScriptUtils.Download(url, headers) return JSON.parse(data["content"]) } + public static async DownloadFetch( url: string, headers?: any @@ -163,6 +173,7 @@ export default class ScriptUtils { console.log("Fetched", url, data) return { content: data } } + public static Download( url: string, headers?: any @@ -198,17 +209,17 @@ export default class ScriptUtils { path: urlObj.pathname + urlObj.search, port: urlObj.port, - headers: headers, + headers: headers }, (res) => { const parts: string[] = [] res.setEncoding("utf8") - res.on("data", function (chunk) { + res.on("data", function(chunk) { // @ts-ignore parts.push(chunk) }) - res.addListener("end", function () { + res.addListener("end", function() { if (res.statusCode === 301 || res.statusCode === 302) { console.log("Got a redirect:", res.headers.location) resolve({ redirect: res.headers.location }) @@ -226,7 +237,7 @@ export default class ScriptUtils { }) } ) - request.on("error", function (e) { + request.on("error", function(e) { reject(e) }) } catch (e) { diff --git a/scripts/generateTranslations.ts b/scripts/generateTranslations.ts index 8521188c93..0bde6e9eea 100644 --- a/scripts/generateTranslations.ts +++ b/scripts/generateTranslations.ts @@ -670,7 +670,7 @@ function removeNonEnglishTranslations(object: any) { * Load the translations into the theme files */ function mergeThemeTranslations(englishOnly: boolean = false) { - const themeFiles = ScriptUtils.getThemeFiles() + const themeFiles = ScriptUtils.getThemeFiles(true) for (const themeFile of themeFiles) { let config = themeFile.parsed mergeLayerTranslation(config, themeFile.path, loadTranslationFilesFrom("themes")) @@ -723,7 +723,7 @@ class GenerateTranslations extends Script { { const l1 = generateTranslationsObjectFrom(ScriptUtils.getLayerFiles(), "layers") const l2 = generateTranslationsObjectFrom( - ScriptUtils.getThemeFiles().filter( + ScriptUtils.getThemeFiles(true).filter( (th) => th.parsed.mustHaveLanguage === undefined ), "themes" From a867379cd4e598184d89603e58720d06f350b432 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 15 Sep 2024 01:12:24 +0200 Subject: [PATCH 16/17] Chore: fix build --- scripts/generateLayerOverview.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/generateLayerOverview.ts b/scripts/generateLayerOverview.ts index 30cd921164..81fade8070 100644 --- a/scripts/generateLayerOverview.ts +++ b/scripts/generateLayerOverview.ts @@ -426,7 +426,8 @@ class LayerOverviewUtils extends Script { priviliged.delete("summary") priviliged.delete("last_click") - if (priviliged.size > 0) { + const isBoostrapping = AllSharedLayers.getSharedLayersConfigs().size == 0 + if (!isBoostrapping && priviliged.size > 0) { throw ( "Priviliged layer " + Array.from(priviliged).join(", ") + From de699b6ea30fc452e7bfd38d72784fd6eaae6a2e Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 15 Sep 2024 01:16:09 +0200 Subject: [PATCH 17/17] Merge translations --- langs/layers/de.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/langs/layers/de.json b/langs/layers/de.json index 3884c53d4d..378413c6b2 100644 --- a/langs/layers/de.json +++ b/langs/layers/de.json @@ -5176,6 +5176,9 @@ "4": { "then": "Sandwichladen" }, + "5": { + "then": "Burgerrestaurant" + }, "6": { "then": "Hier wird Sushi serviert" }, @@ -12228,4 +12231,4 @@ "render": "Windrad" } } -} \ No newline at end of file +}