Make sure that landing pages are in english

This commit is contained in:
pietervdvn 2022-06-23 12:31:47 +02:00
parent b8e5800df3
commit 1305e0c2db
17 changed files with 40 additions and 78 deletions

View file

@ -163,10 +163,19 @@ class ValidateTheme extends DesugaringStep<LayoutConfigJson> {
errors.push(...checked.errors) errors.push(...checked.errors)
} }
if (!json.hideFromOverview && theme.id !== "personal") { 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 // Official, public themes must have a full english translation
const checked = new ValidateLanguageCompleteness("en") const checked = new ValidateLanguageCompleteness("en")
.convert(theme, theme.id) .convert(theme, theme.id)
errors.push(...checked.errors) errors.push(...checked.errors)
} }
} catch (e) { } catch (e) {

View file

@ -1,8 +1,8 @@
{ {
"id": "food", "id": "food",
"name": { "name": {
"nl": "Eetgelegenheden",
"en": "Restaurants and fast food", "en": "Restaurants and fast food",
"nl": "Eetgelegenheden",
"de": "Restaurants und Imbisse", "de": "Restaurants und Imbisse",
"da": "Restauranter og fastfood", "da": "Restauranter og fastfood",
"es": "Restaurantes y comida rápida" "es": "Restaurantes y comida rápida"

View file

@ -1,9 +1,9 @@
{ {
"id": "maxspeed", "id": "maxspeed",
"name": { "name": {
"en": "Maxspeed",
"es": "Velocidad", "es": "Velocidad",
"ca": "Velocitat", "ca": "Velocitat"
"en": "Maxspeed"
}, },
"source": { "source": {
"osmTags": { "osmTags": {

View file

@ -1,8 +1,8 @@
{ {
"id": "playground", "id": "playground",
"name": { "name": {
"nl": "Speeltuinen",
"en": "Playgrounds", "en": "Playgrounds",
"nl": "Speeltuinen",
"ru": "Детские площадки", "ru": "Детские площадки",
"de": "Spielplätze", "de": "Spielplätze",
"it": "Campi da gioco", "it": "Campi da gioco",

View file

@ -1,8 +1,8 @@
{ {
"id": "cafes_and_pubs", "id": "cafes_and_pubs",
"title": { "title": {
"nl": "Cafés",
"en": "Cafés and pubs", "en": "Cafés and pubs",
"nl": "Cafés",
"de": "Cafés und Kneipen", "de": "Cafés und Kneipen",
"it": "Caffè e pub", "it": "Caffè e pub",
"nb_NO": "Kafeer og kneiper", "nb_NO": "Kafeer og kneiper",

View file

@ -1,9 +1,9 @@
{ {
"id": "climbing", "id": "climbing",
"title": { "title": {
"en": "Open Climbing Map",
"nl": "Open klimkaart", "nl": "Open klimkaart",
"de": "Offene Kletterkarte", "de": "Offene Kletterkarte",
"en": "Open Climbing Map",
"ru": "Открытая карта скалолазания", "ru": "Открытая карта скалолазания",
"ja": "登山地図を開く", "ja": "登山地図を開く",
"zh_Hant": "開放攀爬地圖", "zh_Hant": "開放攀爬地圖",

View file

@ -2,8 +2,8 @@
"id": "cyclestreets", "id": "cyclestreets",
"version": "2020-08-30", "version": "2020-08-30",
"title": { "title": {
"nl": "Fietsstraten",
"en": "Cyclestreets", "en": "Cyclestreets",
"nl": "Fietsstraten",
"ja": "Cyclestreets", "ja": "Cyclestreets",
"zh_Hant": "單車街道", "zh_Hant": "單車街道",
"de": "Fahrradstraßen", "de": "Fahrradstraßen",

View file

@ -1,8 +1,8 @@
{ {
"id": "facadegardens", "id": "facadegardens",
"title": { "title": {
"nl": "Straatgeveltuintjes",
"en": "Facade gardens", "en": "Facade gardens",
"nl": "Straatgeveltuintjes",
"ja": "ファサード庭園", "ja": "ファサード庭園",
"zh_Hant": "立面花園", "zh_Hant": "立面花園",
"it": "Giardini verticali", "it": "Giardini verticali",

View file

@ -1,8 +1,8 @@
{ {
"id": "food", "id": "food",
"title": { "title": {
"nl": "Eetgelegenheden",
"en": "Restaurants and fast food", "en": "Restaurants and fast food",
"nl": "Eetgelegenheden",
"de": "Restaurants und Schnellimbisse", "de": "Restaurants und Schnellimbisse",
"it": "Ristoranti e fast food", "it": "Ristoranti e fast food",
"nb_NO": "Restauranter og søppelmat", "nb_NO": "Restauranter og søppelmat",

View file

@ -1,8 +1,8 @@
{ {
"id": "fritures", "id": "fritures",
"title": { "title": {
"nl": "Friturenkaart",
"en": "Fries shops", "en": "Fries shops",
"nl": "Friturenkaart",
"fr": "Carte des friteries", "fr": "Carte des friteries",
"de": "Pommes-frites-Läden", "de": "Pommes-frites-Läden",
"ca": "Botigues de patates" "ca": "Botigues de patates"

View file

@ -1,24 +1,13 @@
{ {
"id": "mapcomplete-changes", "id": "mapcomplete-changes",
"title": { "title": {
"en": "Changes made with MapComplete", "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"
}, },
"shortDescription": { "shortDescription": {
"en": "Shows changes made by MapComplete", "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"
}, },
"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",
"es": "Este mapa muestra todos los cambios hechos con MapComplete",
"nl": "Deze kaart toont alle wijzigingen die met MapComplete werden gemaakt"
}, },
"maintainer": "", "maintainer": "",
"icon": "./assets/svg/logo.svg", "icon": "./assets/svg/logo.svg",
@ -33,10 +22,7 @@
{ {
"id": "mapcomplete-changes", "id": "mapcomplete-changes",
"name": { "name": {
"en": "Changeset centers", "en": "Changeset centers"
"de": "Schwerpunkte von Änderungssätzen",
"es": "Centros de conjuntos de cambios",
"nb_NO": "Endringssettsenter"
}, },
"minzoom": 0, "minzoom": 0,
"source": { "source": {
@ -50,55 +36,35 @@
], ],
"title": { "title": {
"render": { "render": {
"en": "Changeset for {theme}", "en": "Changeset for {theme}"
"de": "Änderungen für {theme}",
"es": "Conjunto de cambios para {theme}",
"nb_NO": "Endringssett for {theme}",
"nl": "Wijzigingset voor {theme}"
} }
}, },
"description": { "description": {
"en": "Shows all MapComplete changes", "en": "Shows all MapComplete changes"
"de": "Zeigt alle MapComplete Änderungen",
"es": "Muestra todos los cambios de MapComplete",
"nl": "Toont alle wijzigingen met MapComplete"
}, },
"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>",
"es": "Conjunto de cambios <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>",
"nb_NO": "Endringssett <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>",
"nl": "Wijzigingset <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",
"es": "Cambio hecho por <a href='https://openstreetmap.org/user/{_last_edit:contributor}' target='_blank'>{_last_edit:contributor}</a>",
"nl": "Wijziging gemaakt door <a href='https://openstreetmap.org/user/{_last_edit:contributor}' target='_blank'>{_last_edit:contributor}</a>"
} }
}, },
{ {
"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>",
"es": "Cambio con tema <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>",
"nl": "Wijziging met 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>",
"es": "Cambio con tema <b>no oficial</b> <a href='https://mapcomplete.osm.be/theme.html?userlayout={theme}'>{theme}</a>",
"nl": "Wijziging met <b>officieus</b> thema <a href='https://mapcomplete.osm.be/theme.html?userlayout={theme}'>{theme}</a>"
} }
} }
] ]
@ -374,11 +340,7 @@
} }
], ],
"question": { "question": {
"en": "Themename contains {search}", "en": "Themename contains {search}"
"de": "Themenname enthält {search}",
"es": "Nombre del tema contiene {search}",
"nb_NO": "Temanavn inneholder {search}",
"nl": "Themanaam bevat {search}"
} }
} }
] ]
@ -394,10 +356,7 @@
} }
], ],
"question": { "question": {
"en": "Made by contributor {search}", "en": "Made by contributor {search}"
"de": "Erstellt von {search}",
"es": "Hecho por contributor/a {search}",
"nl": "Gemaakt door bijdrager {search}"
} }
} }
] ]
@ -413,10 +372,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}",
"es": "<b>No</b> hecho por contributor/a {search}",
"nl": "<b>Niet</b> gemaakt door bijdrager {search}"
} }
} }
] ]
@ -431,10 +387,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>",
"es": "Se pueden encontrar más estadísticas <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>aquí</a>",
"nl": "Meer statistieken kunnen <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>hier</a> gevonden worden"
} }
}, },
{ {

View file

@ -1,9 +1,9 @@
{ {
"id": "maxspeed", "id": "maxspeed",
"title": { "title": {
"en": "Maxspeed",
"es": "Velocidad", "es": "Velocidad",
"ca": "Velocitat", "ca": "Velocitat"
"en": "Maxspeed"
}, },
"shortDescription": { "shortDescription": {
"en": "This map shows the legally allowed maximum speed on every road." "en": "This map shows the legally allowed maximum speed on every road."

View file

@ -1,8 +1,8 @@
{ {
"id": "parkings", "id": "parkings",
"title": { "title": {
"nl": "Parking",
"en": "Parking", "en": "Parking",
"nl": "Parking",
"de": "Parkplatzkarte", "de": "Parkplatzkarte",
"it": "Parcheggio", "it": "Parcheggio",
"nb_NO": "Parkering", "nb_NO": "Parkering",

View file

@ -1,8 +1,8 @@
{ {
"id": "playgrounds", "id": "playgrounds",
"title": { "title": {
"nl": "Speelplekken",
"en": "Playgrounds", "en": "Playgrounds",
"nl": "Speelplekken",
"fr": "Aires de jeux", "fr": "Aires de jeux",
"ja": "遊び場", "ja": "遊び場",
"zh_Hant": "遊樂場", "zh_Hant": "遊樂場",

View file

@ -1,9 +1,9 @@
{ {
"id": "sport_pitches", "id": "sport_pitches",
"title": { "title": {
"en": "Sport pitches",
"nl": "Sportvelden", "nl": "Sportvelden",
"fr": "Terrains de sport", "fr": "Terrains de sport",
"en": "Sport pitches",
"ja": "スポーツ競技場", "ja": "スポーツ競技場",
"zh_Hant": "運動場地", "zh_Hant": "運動場地",
"ru": "Спортивные площадки", "ru": "Спортивные площадки",

View file

@ -1,8 +1,8 @@
{ {
"id": "trees", "id": "trees",
"title": { "title": {
"nl": "Bomen",
"en": "Trees", "en": "Trees",
"nl": "Bomen",
"fr": "Arbres", "fr": "Arbres",
"it": "Alberi", "it": "Alberi",
"ru": "Деревья", "ru": "Деревья",

View file

@ -19,7 +19,6 @@ import {PrepareLayer} from "../Models/ThemeConfig/Conversion/PrepareLayer";
import {PrepareTheme} from "../Models/ThemeConfig/Conversion/PrepareTheme"; import {PrepareTheme} from "../Models/ThemeConfig/Conversion/PrepareTheme";
import {DesugaringContext} from "../Models/ThemeConfig/Conversion/Conversion"; import {DesugaringContext} from "../Models/ThemeConfig/Conversion/Conversion";
import {Utils} from "../Utils"; 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. // 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 // It spits out an overview of those to be used to load them
@ -262,6 +261,7 @@ class LayerOverviewUtils {
tagRenderings: this.getSharedTagRenderings(knownImagePaths), tagRenderings: this.getSharedTagRenderings(knownImagePaths),
publicLayers publicLayers
} }
const nonDefaultLanguages : {theme: string, language: string}[] = []
for (const themeInfo of themeFiles) { for (const themeInfo of themeFiles) {
let themeFile = themeInfo.parsed let themeFile = themeInfo.parsed
const themePath = themeInfo.path const themePath = themeInfo.path