diff --git a/Models/ThemeConfig/Conversion/Validation.ts b/Models/ThemeConfig/Conversion/Validation.ts index 916c9b7814..a1e5bf889f 100644 --- a/Models/ThemeConfig/Conversion/Validation.ts +++ b/Models/ThemeConfig/Conversion/Validation.ts @@ -163,10 +163,19 @@ class ValidateTheme extends DesugaringStep { errors.push(...checked.errors) } if (!json.hideFromOverview && theme.id !== "personal") { + + // The first key in the the title-field must be english, otherwise the title in the loading page will be the different language + const targetLanguage = theme.title.SupportedLanguages()[0] + if(targetLanguage !== "en"){ + warnings.push(`TargetLanguage is not 'en' for public theme ${theme.id}, it is ${targetLanguage}. Move 'en' up in the title of the theme and set it as the first key`) + } + // Official, public themes must have a full english translation const checked = new ValidateLanguageCompleteness("en") .convert(theme, theme.id) errors.push(...checked.errors) + + } } catch (e) { diff --git a/assets/layers/food/food.json b/assets/layers/food/food.json index 85190394c4..9c4bfd2f29 100644 --- a/assets/layers/food/food.json +++ b/assets/layers/food/food.json @@ -1,8 +1,8 @@ { "id": "food", "name": { - "nl": "Eetgelegenheden", "en": "Restaurants and fast food", + "nl": "Eetgelegenheden", "de": "Restaurants und Imbisse", "da": "Restauranter og fastfood", "es": "Restaurantes y comida rápida" diff --git a/assets/layers/maxspeed/maxspeed.json b/assets/layers/maxspeed/maxspeed.json index de44ecf6a9..96a9c30c93 100644 --- a/assets/layers/maxspeed/maxspeed.json +++ b/assets/layers/maxspeed/maxspeed.json @@ -1,9 +1,9 @@ { "id": "maxspeed", "name": { + "en": "Maxspeed", "es": "Velocidad", - "ca": "Velocitat", - "en": "Maxspeed" + "ca": "Velocitat" }, "source": { "osmTags": { diff --git a/assets/layers/playground/playground.json b/assets/layers/playground/playground.json index d4e6c77e71..5334088cb5 100644 --- a/assets/layers/playground/playground.json +++ b/assets/layers/playground/playground.json @@ -1,8 +1,8 @@ { "id": "playground", "name": { - "nl": "Speeltuinen", "en": "Playgrounds", + "nl": "Speeltuinen", "ru": "Детские площадки", "de": "Spielplätze", "it": "Campi da gioco", diff --git a/assets/themes/cafes_and_pubs/cafes_and_pubs.json b/assets/themes/cafes_and_pubs/cafes_and_pubs.json index 2d44d22378..8d018ccf77 100644 --- a/assets/themes/cafes_and_pubs/cafes_and_pubs.json +++ b/assets/themes/cafes_and_pubs/cafes_and_pubs.json @@ -1,8 +1,8 @@ { "id": "cafes_and_pubs", "title": { - "nl": "Cafés", "en": "Cafés and pubs", + "nl": "Cafés", "de": "Cafés und Kneipen", "it": "Caffè e pub", "nb_NO": "Kafeer og kneiper", diff --git a/assets/themes/climbing/climbing.json b/assets/themes/climbing/climbing.json index a60a2a80b3..4160a477ba 100644 --- a/assets/themes/climbing/climbing.json +++ b/assets/themes/climbing/climbing.json @@ -1,9 +1,9 @@ { "id": "climbing", "title": { + "en": "Open Climbing Map", "nl": "Open klimkaart", "de": "Offene Kletterkarte", - "en": "Open Climbing Map", "ru": "Открытая карта скалолазания", "ja": "登山地図を開く", "zh_Hant": "開放攀爬地圖", diff --git a/assets/themes/cyclestreets/cyclestreets.json b/assets/themes/cyclestreets/cyclestreets.json index 955cf20a09..c896b08e94 100644 --- a/assets/themes/cyclestreets/cyclestreets.json +++ b/assets/themes/cyclestreets/cyclestreets.json @@ -2,8 +2,8 @@ "id": "cyclestreets", "version": "2020-08-30", "title": { - "nl": "Fietsstraten", "en": "Cyclestreets", + "nl": "Fietsstraten", "ja": "Cyclestreets", "zh_Hant": "單車街道", "de": "Fahrradstraßen", diff --git a/assets/themes/facadegardens/facadegardens.json b/assets/themes/facadegardens/facadegardens.json index d1d8780e4a..ed2d1f51e1 100644 --- a/assets/themes/facadegardens/facadegardens.json +++ b/assets/themes/facadegardens/facadegardens.json @@ -1,8 +1,8 @@ { "id": "facadegardens", "title": { - "nl": "Straatgeveltuintjes", "en": "Facade gardens", + "nl": "Straatgeveltuintjes", "ja": "ファサード庭園", "zh_Hant": "立面花園", "it": "Giardini verticali", diff --git a/assets/themes/food/food.json b/assets/themes/food/food.json index b49c9b71d8..ec3d0a2556 100644 --- a/assets/themes/food/food.json +++ b/assets/themes/food/food.json @@ -1,8 +1,8 @@ { "id": "food", "title": { - "nl": "Eetgelegenheden", "en": "Restaurants and fast food", + "nl": "Eetgelegenheden", "de": "Restaurants und Schnellimbisse", "it": "Ristoranti e fast food", "nb_NO": "Restauranter og søppelmat", diff --git a/assets/themes/fritures/fritures.json b/assets/themes/fritures/fritures.json index d6b46e2106..e4db8ef2fe 100644 --- a/assets/themes/fritures/fritures.json +++ b/assets/themes/fritures/fritures.json @@ -1,8 +1,8 @@ { "id": "fritures", "title": { - "nl": "Friturenkaart", "en": "Fries shops", + "nl": "Friturenkaart", "fr": "Carte des friteries", "de": "Pommes-frites-Läden", "ca": "Botigues de patates" diff --git a/assets/themes/mapcomplete-changes/mapcomplete-changes.json b/assets/themes/mapcomplete-changes/mapcomplete-changes.json index c909ddf2e6..996bd4deb4 100644 --- a/assets/themes/mapcomplete-changes/mapcomplete-changes.json +++ b/assets/themes/mapcomplete-changes/mapcomplete-changes.json @@ -1,24 +1,13 @@ { "id": "mapcomplete-changes", "title": { - "en": "Changes made with MapComplete", - "de": "Änderungen mit MapComplete", - "es": "Cambios hechos con MapComplete", - "nb_NO": "Endringer utført med MapComplete", - "nl": "Wijzigingen gemaakt met MapComplete" + "en": "Changes made with MapComplete" }, "shortDescription": { - "en": "Shows changes made by MapComplete", - "de": "Zeigt Änderungen von MapComplete", - "es": "Muestra los cambios hechos por MapComplete", - "nb_NO": "Vis endringer utført med MapComplete", - "nl": "Toont wijzigingen gemaakt met MapComplete" + "en": "Shows changes made by MapComplete" }, "description": { - "en": "This maps shows all the changes made with MapComplete", - "de": "Diese Karte zeigt alle Änderungen die mit MapComplete gemacht wurden", - "es": "Este mapa muestra todos los cambios hechos con MapComplete", - "nl": "Deze kaart toont alle wijzigingen die met MapComplete werden gemaakt" + "en": "This maps shows all the changes made with MapComplete" }, "maintainer": "", "icon": "./assets/svg/logo.svg", @@ -33,10 +22,7 @@ { "id": "mapcomplete-changes", "name": { - "en": "Changeset centers", - "de": "Schwerpunkte von Änderungssätzen", - "es": "Centros de conjuntos de cambios", - "nb_NO": "Endringssettsenter" + "en": "Changeset centers" }, "minzoom": 0, "source": { @@ -50,55 +36,35 @@ ], "title": { "render": { - "en": "Changeset for {theme}", - "de": "Änderungen für {theme}", - "es": "Conjunto de cambios para {theme}", - "nb_NO": "Endringssett for {theme}", - "nl": "Wijzigingset voor {theme}" + "en": "Changeset for {theme}" } }, "description": { - "en": "Shows all MapComplete changes", - "de": "Zeigt alle MapComplete Änderungen", - "es": "Muestra todos los cambios de MapComplete", - "nl": "Toont alle wijzigingen met MapComplete" + "en": "Shows all MapComplete changes" }, "tagRenderings": [ { "id": "render_id", "render": { - "en": "Changeset {id}", - "de": "Änderung {id}", - "es": "Conjunto de cambios {id}", - "nb_NO": "Endringssett {id}", - "nl": "Wijzigingset {id}" + "en": "Changeset {id}" } }, { "id": "contributor", "render": { - "en": "Change made by {_last_edit:contributor}", - "de": "Änderung wurde von {_last_edit:contributor} gemacht", - "es": "Cambio hecho por {_last_edit:contributor}", - "nl": "Wijziging gemaakt door {_last_edit:contributor}" + "en": "Change made by {_last_edit:contributor}" } }, { "id": "theme", "render": { - "en": "Change with theme {theme}", - "de": "Änderung mit Thema {theme}", - "es": "Cambio con tema {theme}", - "nl": "Wijziging met thema {theme}" + "en": "Change with theme {theme}" }, "mappings": [ { "if": "theme~http.*", "then": { - "en": "Change with unofficial theme {theme}", - "de": "Änderung mit inoffiziellem Thema {theme}", - "es": "Cambio con tema no oficial {theme}", - "nl": "Wijziging met officieus thema {theme}" + "en": "Change with unofficial theme {theme}" } } ] @@ -374,11 +340,7 @@ } ], "question": { - "en": "Themename contains {search}", - "de": "Themenname enthält {search}", - "es": "Nombre del tema contiene {search}", - "nb_NO": "Temanavn inneholder {search}", - "nl": "Themanaam bevat {search}" + "en": "Themename contains {search}" } } ] @@ -394,10 +356,7 @@ } ], "question": { - "en": "Made by contributor {search}", - "de": "Erstellt von {search}", - "es": "Hecho por contributor/a {search}", - "nl": "Gemaakt door bijdrager {search}" + "en": "Made by contributor {search}" } } ] @@ -413,10 +372,7 @@ } ], "question": { - "en": "Not made by contributor {search}", - "de": "Nicht erstellt von {search}", - "es": "No hecho por contributor/a {search}", - "nl": "Niet gemaakt door bijdrager {search}" + "en": "Not made by contributor {search}" } } ] @@ -431,10 +387,7 @@ { "id": "link_to_more", "render": { - "en": "More statistics can be found here", - "de": "Weitere Statistiken finden Sie hier", - "es": "Se pueden encontrar más estadísticas aquí", - "nl": "Meer statistieken kunnen hier gevonden worden" + "en": "More statistics can be found here" } }, { diff --git a/assets/themes/maxspeed/maxspeed.json b/assets/themes/maxspeed/maxspeed.json index 9b7edbf3a1..1d08e627db 100644 --- a/assets/themes/maxspeed/maxspeed.json +++ b/assets/themes/maxspeed/maxspeed.json @@ -1,9 +1,9 @@ { "id": "maxspeed", "title": { + "en": "Maxspeed", "es": "Velocidad", - "ca": "Velocitat", - "en": "Maxspeed" + "ca": "Velocitat" }, "shortDescription": { "en": "This map shows the legally allowed maximum speed on every road." diff --git a/assets/themes/parkings/parkings.json b/assets/themes/parkings/parkings.json index 1a09bd0bbf..ae5caab1cd 100644 --- a/assets/themes/parkings/parkings.json +++ b/assets/themes/parkings/parkings.json @@ -1,8 +1,8 @@ { "id": "parkings", "title": { - "nl": "Parking", "en": "Parking", + "nl": "Parking", "de": "Parkplatzkarte", "it": "Parcheggio", "nb_NO": "Parkering", diff --git a/assets/themes/playgrounds/playgrounds.json b/assets/themes/playgrounds/playgrounds.json index 7c0ca27dfa..064027389d 100644 --- a/assets/themes/playgrounds/playgrounds.json +++ b/assets/themes/playgrounds/playgrounds.json @@ -1,8 +1,8 @@ { "id": "playgrounds", "title": { - "nl": "Speelplekken", "en": "Playgrounds", + "nl": "Speelplekken", "fr": "Aires de jeux", "ja": "遊び場", "zh_Hant": "遊樂場", diff --git a/assets/themes/sport_pitches/sport_pitches.json b/assets/themes/sport_pitches/sport_pitches.json index 023f28af70..d2b7b4809d 100644 --- a/assets/themes/sport_pitches/sport_pitches.json +++ b/assets/themes/sport_pitches/sport_pitches.json @@ -1,9 +1,9 @@ { "id": "sport_pitches", "title": { + "en": "Sport pitches", "nl": "Sportvelden", "fr": "Terrains de sport", - "en": "Sport pitches", "ja": "スポーツ競技場", "zh_Hant": "運動場地", "ru": "Спортивные площадки", diff --git a/assets/themes/trees/trees.json b/assets/themes/trees/trees.json index 393e0cadb1..0ba47ea1ff 100644 --- a/assets/themes/trees/trees.json +++ b/assets/themes/trees/trees.json @@ -1,8 +1,8 @@ { "id": "trees", "title": { - "nl": "Bomen", "en": "Trees", + "nl": "Bomen", "fr": "Arbres", "it": "Alberi", "ru": "Деревья", diff --git a/scripts/generateLayerOverview.ts b/scripts/generateLayerOverview.ts index a87b3ade51..81a67a69a5 100644 --- a/scripts/generateLayerOverview.ts +++ b/scripts/generateLayerOverview.ts @@ -19,7 +19,6 @@ import {PrepareLayer} from "../Models/ThemeConfig/Conversion/PrepareLayer"; import {PrepareTheme} from "../Models/ThemeConfig/Conversion/PrepareTheme"; import {DesugaringContext} from "../Models/ThemeConfig/Conversion/Conversion"; import {Utils} from "../Utils"; -import {And} from "../Logic/Tags/And"; // This scripts scans 'assets/layers/*.json' for layer definition files and 'assets/themes/*.json' for theme definition files. // It spits out an overview of those to be used to load them @@ -262,6 +261,7 @@ class LayerOverviewUtils { tagRenderings: this.getSharedTagRenderings(knownImagePaths), publicLayers } + const nonDefaultLanguages : {theme: string, language: string}[] = [] for (const themeInfo of themeFiles) { let themeFile = themeInfo.parsed const themePath = themeInfo.path