From 3d9a8c056a568e2d8a69901a43e5369014e66a08 Mon Sep 17 00:00:00 2001 From: Igor Eliezer Date: Fri, 9 Mar 2018 18:20:40 -0300 Subject: [PATCH 01/16] Update pt-br.json Updating Brazilian Portuguese translation for OpenStreetBrowser. --- lang/pt-br.json | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/lang/pt-br.json b/lang/pt-br.json index ed9ab5dc..5ef7a45e 100644 --- a/lang/pt-br.json +++ b/lang/pt-br.json @@ -1,27 +1,30 @@ { - "back": "", - "category-info-tooltip": "", - "closed": "", - "default": "", - "error": "", - "facilities": "", - "images": "", - "main:options": "", + "back": "voltar", + "category-info-tooltip": "Info & Legenda", + "closed": "fechado", + "default": "padrão", + "error": { + "message": "Erro", + "!=1": "Erros" + }, + "facilities": "Instalações", + "images": "Imagens", + "main:options": "Opções", "more": "mais", - "more_categories": "", - "more_categories_gitea": "", - "open": "", - "options:data_lang": "", - "options:data_lang:desc": "", - "options:data_lang:local": "", - "options:overpassUrl": "", - "options:preferredBaseMap": "", - "options:ui_lang": "", - "other": "", + "more_categories": "Mais categorias", + "more_categories_gitea": "Criar & melhorar categorias você mesmo!", + "open": "abrir", + "options:data_lang": "Língua dos dados", + "options:data_lang:desc": "Muitos elementos do mapa possuem seus nomes (e outras etiquetas) traduzidas para línguas diferentes (p.ex. com 'name:en', 'name:de'). Especificar qual língua deve ser usada para exibição, ou 'Língua local' de forma que sempre os valores não tranduzidos (p.ex. 'name') sejam usados.", + "options:data_lang:local": "Língua local", + "options:overpassUrl": "URL do OverpassAPI", + "options:preferredBaseMap": "Mapa-base preferido", + "options:ui_lang": "Língua da interface", + "other": "Outro", "save": "Salvar", - "show details": "", - "toggle_fullscreen": "", - "unknown": "", + "show details": "mostrar detalhes", + "toggle_fullscreen": "Alternar modo tela cheira", + "unknown": "desconhecido", "unnamed": "sem nome", - "wikipedia:no-url-parse": "" + "wikipedia:no-url-parse": "Não se pôde analisar URL da Wikipédia" } From 416ee2b492857077db4c2ed1eaa688b822cc210d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sat, 10 Mar 2018 15:25:11 +0100 Subject: [PATCH 02/16] Found some strings which need to be translated - incl. translation for de, en --- lang/ast.json | 7 ++++++- lang/ca.json | 7 ++++++- lang/cs.json | 7 ++++++- lang/da.json | 7 ++++++- lang/de.json | 7 ++++++- lang/el.json | 7 ++++++- lang/en.json | 7 ++++++- lang/es.json | 7 ++++++- lang/et.json | 7 ++++++- lang/fr.json | 7 ++++++- lang/hu.json | 7 ++++++- lang/it.json | 7 ++++++- lang/ja.json | 7 ++++++- lang/nl.json | 7 ++++++- lang/pl.json | 7 ++++++- lang/pt-br.json | 7 ++++++- lang/ro.json | 7 ++++++- lang/ru.json | 7 ++++++- lang/sr.json | 7 ++++++- lang/template.json | 7 ++++++- lang/uk.json | 7 ++++++- src/CategoryOverpass.js | 6 +++--- src/index.js | 6 +++--- 23 files changed, 132 insertions(+), 27 deletions(-) diff --git a/lang/ast.json b/lang/ast.json index fc4cd28b..4ca40ef9 100644 --- a/lang/ast.json +++ b/lang/ast.json @@ -5,7 +5,10 @@ "default": "", "error": "", "facilities": "", + "header:attributes": "", + "header:osm_meta": "", "images": "", + "loading": "", "main:options": "Opciones", "more": "más", "more_categories": "Más categoríes", @@ -23,5 +26,7 @@ "toggle_fullscreen": "", "unknown": "", "unnamed": "ensin nome", - "wikipedia:no-url-parse": "" + "wikipedia:no-url-parse": "", + "zoom_in_appear": "", + "zoom_in_more": "" } diff --git a/lang/ca.json b/lang/ca.json index e9162f62..aea8c0ec 100644 --- a/lang/ca.json +++ b/lang/ca.json @@ -5,7 +5,10 @@ "default": "", "error": "", "facilities": "", + "header:attributes": "", + "header:osm_meta": "", "images": "", + "loading": "", "main:options": "Opcions", "more": "més", "more_categories": "Més categories", @@ -23,5 +26,7 @@ "toggle_fullscreen": "", "unknown": "", "unnamed": "", - "wikipedia:no-url-parse": "" + "wikipedia:no-url-parse": "", + "zoom_in_appear": "", + "zoom_in_more": "" } diff --git a/lang/cs.json b/lang/cs.json index dbebdfa7..b2960b3a 100644 --- a/lang/cs.json +++ b/lang/cs.json @@ -5,7 +5,10 @@ "default": "", "error": "", "facilities": "", + "header:attributes": "", + "header:osm_meta": "", "images": "", + "loading": "", "main:options": "Nastavení", "more": "více", "more_categories": "Více kategorií", @@ -23,5 +26,7 @@ "toggle_fullscreen": "", "unknown": "", "unnamed": "nepojmenováno", - "wikipedia:no-url-parse": "" + "wikipedia:no-url-parse": "", + "zoom_in_appear": "", + "zoom_in_more": "" } diff --git a/lang/da.json b/lang/da.json index e1126f46..887da9a0 100644 --- a/lang/da.json +++ b/lang/da.json @@ -5,7 +5,10 @@ "default": "", "error": "", "facilities": "", + "header:attributes": "", + "header:osm_meta": "", "images": "", + "loading": "", "main:options": "Indstillinger", "more": "mere", "more_categories": "Flere kategorier", @@ -23,5 +26,7 @@ "toggle_fullscreen": "", "unknown": "", "unnamed": "unavngivet", - "wikipedia:no-url-parse": "" + "wikipedia:no-url-parse": "", + "zoom_in_appear": "", + "zoom_in_more": "" } diff --git a/lang/de.json b/lang/de.json index 91cebd1b..a6f66402 100644 --- a/lang/de.json +++ b/lang/de.json @@ -8,7 +8,10 @@ "!=1": "Fehler" }, "facilities": "Einrichtungen", + "header:attributes": "Attribute", + "header:osm_meta": "OSM Meta", "images": "Bilder", + "loading": "Laden ...", "main:options": "Optionen", "more": "mehr", "more_categories": "Mehr Kategorien", @@ -26,5 +29,7 @@ "toggle_fullscreen": "(De-)aktiviere Vollbildmodus", "unknown": "unbekannt", "unnamed": "Namenlos", - "wikipedia:no-url-parse": "Konnte Wikipedia Adresse nicht erkennen" + "wikipedia:no-url-parse": "Konnte Wikipedia Adresse nicht erkennen", + "zoom_in_appear": "Zoome hinein um Kartenobjekte zu sehen", + "zoom_in_more": "Zoome hinein für weitere Kartenobjekte" } diff --git a/lang/el.json b/lang/el.json index aec2a1a8..b871e0c4 100644 --- a/lang/el.json +++ b/lang/el.json @@ -5,7 +5,10 @@ "default": "", "error": "", "facilities": "", + "header:attributes": "", + "header:osm_meta": "", "images": "", + "loading": "", "main:options": "Επιλογές", "more": "περισσότερα", "more_categories": "Περισσότερες κατηγορίες", @@ -23,5 +26,7 @@ "toggle_fullscreen": "", "unknown": "", "unnamed": "ανώνυμο", - "wikipedia:no-url-parse": "" + "wikipedia:no-url-parse": "", + "zoom_in_appear": "", + "zoom_in_more": "" } diff --git a/lang/en.json b/lang/en.json index ec56263b..483601d2 100644 --- a/lang/en.json +++ b/lang/en.json @@ -8,7 +8,10 @@ "!=1": "Errors" }, "facilities": "Facilities", + "header:attributes": "Attributes", + "header:osm_meta": "OSM Meta", "images": "Images", + "loading": "Loading ...", "main:options": "Options", "more": "more", "more_categories": "More categories", @@ -26,5 +29,7 @@ "toggle_fullscreen": "Toggle full screen mode", "unknown": "unknown", "unnamed": "unnamed", - "wikipedia:no-url-parse": "Could not parse Wikipedia URL" + "wikipedia:no-url-parse": "Could not parse Wikipedia URL", + "zoom_in_appear": "zoom in for map features to appear", + "zoom_in_more": "zoom in for more map features" } diff --git a/lang/es.json b/lang/es.json index 79933900..d909c601 100644 --- a/lang/es.json +++ b/lang/es.json @@ -5,7 +5,10 @@ "default": "", "error": "", "facilities": "", + "header:attributes": "", + "header:osm_meta": "", "images": "", + "loading": "", "main:options": "Opciones", "more": "más", "more_categories": "Más categorías", @@ -23,5 +26,7 @@ "toggle_fullscreen": "", "unknown": "", "unnamed": "", - "wikipedia:no-url-parse": "" + "wikipedia:no-url-parse": "", + "zoom_in_appear": "", + "zoom_in_more": "" } diff --git a/lang/et.json b/lang/et.json index 4082cbf9..c512322d 100644 --- a/lang/et.json +++ b/lang/et.json @@ -5,7 +5,10 @@ "default": "", "error": "", "facilities": "", + "header:attributes": "", + "header:osm_meta": "", "images": "", + "loading": "", "main:options": "Valikud", "more": "lisaks", "more_categories": "Rohkem kategooriaid", @@ -23,5 +26,7 @@ "toggle_fullscreen": "", "unknown": "", "unnamed": "nimeta", - "wikipedia:no-url-parse": "" + "wikipedia:no-url-parse": "", + "zoom_in_appear": "", + "zoom_in_more": "" } diff --git a/lang/fr.json b/lang/fr.json index 73d585be..bd8ca8c4 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -5,7 +5,10 @@ "default": "", "error": "", "facilities": "", + "header:attributes": "", + "header:osm_meta": "", "images": "", + "loading": "", "main:options": "Options", "more": "plus", "more_categories": "Plus de catégories", @@ -23,5 +26,7 @@ "toggle_fullscreen": "", "unknown": "Inconnue", "unnamed": "sans nom", - "wikipedia:no-url-parse": "" + "wikipedia:no-url-parse": "", + "zoom_in_appear": "", + "zoom_in_more": "" } diff --git a/lang/hu.json b/lang/hu.json index 975b0c96..5a40fc19 100644 --- a/lang/hu.json +++ b/lang/hu.json @@ -5,7 +5,10 @@ "default": "", "error": "", "facilities": "", + "header:attributes": "", + "header:osm_meta": "", "images": "", + "loading": "", "main:options": "Beállítások", "more": "több", "more_categories": "Több kategória", @@ -23,5 +26,7 @@ "toggle_fullscreen": "", "unknown": "", "unnamed": "", - "wikipedia:no-url-parse": "" + "wikipedia:no-url-parse": "", + "zoom_in_appear": "", + "zoom_in_more": "" } diff --git a/lang/it.json b/lang/it.json index eb8f9116..f12357d1 100644 --- a/lang/it.json +++ b/lang/it.json @@ -5,7 +5,10 @@ "default": "", "error": "", "facilities": "", + "header:attributes": "", + "header:osm_meta": "", "images": "", + "loading": "", "main:options": "Opzioni", "more": "altri", "more_categories": "Altre categorie", @@ -23,5 +26,7 @@ "toggle_fullscreen": "", "unknown": "", "unnamed": "privo di nome", - "wikipedia:no-url-parse": "" + "wikipedia:no-url-parse": "", + "zoom_in_appear": "", + "zoom_in_more": "" } diff --git a/lang/ja.json b/lang/ja.json index e59c190b..673916b9 100644 --- a/lang/ja.json +++ b/lang/ja.json @@ -5,7 +5,10 @@ "default": "", "error": "", "facilities": "", + "header:attributes": "", + "header:osm_meta": "", "images": "", + "loading": "", "main:options": "オプション設定", "more": "もっと", "more_categories": "カテゴリを一覧から追加", @@ -23,5 +26,7 @@ "toggle_fullscreen": "", "unknown": "", "unnamed": "nameなし", - "wikipedia:no-url-parse": "" + "wikipedia:no-url-parse": "", + "zoom_in_appear": "", + "zoom_in_more": "" } diff --git a/lang/nl.json b/lang/nl.json index 856320fd..2b24c2b1 100644 --- a/lang/nl.json +++ b/lang/nl.json @@ -5,7 +5,10 @@ "default": "", "error": "", "facilities": "", + "header:attributes": "", + "header:osm_meta": "", "images": "", + "loading": "", "main:options": "Opties", "more": "meer", "more_categories": "Meer categorieën", @@ -23,5 +26,7 @@ "toggle_fullscreen": "", "unknown": "", "unnamed": "naamloos", - "wikipedia:no-url-parse": "" + "wikipedia:no-url-parse": "", + "zoom_in_appear": "", + "zoom_in_more": "" } diff --git a/lang/pl.json b/lang/pl.json index af06944c..102167c3 100644 --- a/lang/pl.json +++ b/lang/pl.json @@ -5,7 +5,10 @@ "default": "", "error": "", "facilities": "", + "header:attributes": "", + "header:osm_meta": "", "images": "", + "loading": "", "main:options": "Opcje", "more": "więcej", "more_categories": "Więcej kategorii", @@ -23,5 +26,7 @@ "toggle_fullscreen": "", "unknown": "", "unnamed": "nienazwane", - "wikipedia:no-url-parse": "" + "wikipedia:no-url-parse": "", + "zoom_in_appear": "", + "zoom_in_more": "" } diff --git a/lang/pt-br.json b/lang/pt-br.json index 5ef7a45e..a4ea2b0f 100644 --- a/lang/pt-br.json +++ b/lang/pt-br.json @@ -9,6 +9,9 @@ }, "facilities": "Instalações", "images": "Imagens", + "header:attributes": "", + "header:osm_meta": "", + "loading": "", "main:options": "Opções", "more": "mais", "more_categories": "Mais categorias", @@ -26,5 +29,7 @@ "toggle_fullscreen": "Alternar modo tela cheira", "unknown": "desconhecido", "unnamed": "sem nome", - "wikipedia:no-url-parse": "Não se pôde analisar URL da Wikipédia" + "wikipedia:no-url-parse": "Não se pôde analisar URL da Wikipédia", + "zoom_in_appear": "", + "zoom_in_more": "" } diff --git a/lang/ro.json b/lang/ro.json index 69130b02..379045bf 100644 --- a/lang/ro.json +++ b/lang/ro.json @@ -5,7 +5,10 @@ "default": "", "error": "", "facilities": "", + "header:attributes": "", + "header:osm_meta": "", "images": "", + "loading": "", "main:options": "Optiuni", "more": "Mai mult", "more_categories": "Mai multe categorii", @@ -23,5 +26,7 @@ "toggle_fullscreen": "", "unknown": "", "unnamed": "anonim", - "wikipedia:no-url-parse": "" + "wikipedia:no-url-parse": "", + "zoom_in_appear": "", + "zoom_in_more": "" } diff --git a/lang/ru.json b/lang/ru.json index 55358747..6975b404 100644 --- a/lang/ru.json +++ b/lang/ru.json @@ -5,7 +5,10 @@ "default": "", "error": "", "facilities": "", + "header:attributes": "", + "header:osm_meta": "", "images": "", + "loading": "", "main:options": "Настройки", "more": "Ещё", "more_categories": "Больше категорий", @@ -23,5 +26,7 @@ "toggle_fullscreen": "", "unknown": "", "unnamed": "безымянный", - "wikipedia:no-url-parse": "" + "wikipedia:no-url-parse": "", + "zoom_in_appear": "", + "zoom_in_more": "" } diff --git a/lang/sr.json b/lang/sr.json index 7004a800..0b6086bc 100644 --- a/lang/sr.json +++ b/lang/sr.json @@ -5,7 +5,10 @@ "default": "", "error": "", "facilities": "", + "header:attributes": "", + "header:osm_meta": "", "images": "", + "loading": "", "main:options": "Опције", "more": "још", "more_categories": "Више категорија", @@ -23,5 +26,7 @@ "toggle_fullscreen": "", "unknown": "", "unnamed": "без имена", - "wikipedia:no-url-parse": "" + "wikipedia:no-url-parse": "", + "zoom_in_appear": "", + "zoom_in_more": "" } diff --git a/lang/template.json b/lang/template.json index 69c8559c..5fed86ae 100644 --- a/lang/template.json +++ b/lang/template.json @@ -5,7 +5,10 @@ "default": "", "error": "", "facilities": "", + "header:attributes": "", + "header:osm_meta": "", "images": "", + "loading": "", "main:options": "", "more": "", "more_categories": "", @@ -23,5 +26,7 @@ "toggle_fullscreen": "", "unknown": "", "unnamed": "", - "wikipedia:no-url-parse": "" + "wikipedia:no-url-parse": "", + "zoom_in_appear": "", + "zoom_in_more": "" } diff --git a/lang/uk.json b/lang/uk.json index a697ae44..b84f6266 100644 --- a/lang/uk.json +++ b/lang/uk.json @@ -5,7 +5,10 @@ "default": "", "error": "", "facilities": "", + "header:attributes": "", + "header:osm_meta": "", "images": "", + "loading": "", "main:options": "Налаштування", "more": "Ще", "more_categories": "Більше категорій", @@ -23,5 +26,7 @@ "toggle_fullscreen": "", "unknown": "", "unnamed": "безіменний", - "wikipedia:no-url-parse": "" + "wikipedia:no-url-parse": "", + "zoom_in_appear": "", + "zoom_in_more": "" } diff --git a/src/CategoryOverpass.js b/src/CategoryOverpass.js index da0305ec..0aed8710 100644 --- a/src/CategoryOverpass.js +++ b/src/CategoryOverpass.js @@ -128,7 +128,7 @@ function CategoryOverpass (options, data) { p = document.createElement('div') p.className = 'loadingIndicator' - p.innerHTML = 'Loading...' + p.innerHTML = '' + lang('loading') + '' this.dom.appendChild(p) p = document.createElement('div') @@ -223,12 +223,12 @@ CategoryOverpass.prototype.updateStatus = function () { if (typeof this.data.query === 'object') { var highestZoom = Object.keys(this.data.query).reverse()[0] if (this.map.getZoom() < highestZoom) { - this.domStatus.innerHTML = 'zoom in for more map features' + this.domStatus.innerHTML = lang('zoom_in_more') } } if ('minZoom' in this.data && this.map.getZoom() < this.data.minZoom) { - this.domStatus.innerHTML = 'zoom in for map features to appear' + this.domStatus.innerHTML = lang('zoom_in_appear') } } diff --git a/src/index.js b/src/index.js index 4af743c2..bee2ceb1 100644 --- a/src/index.js +++ b/src/index.js @@ -186,7 +186,7 @@ function show (id, options, callback) { if (options.showDetails) { call_hooks('hide-' + document.getElementById('content').className) document.getElementById('content').className = 'details' - document.getElementById('contentDetails').innerHTML = 'Loading ...' + document.getElementById('contentDetails').innerHTML = lang('loading') } var m = id.match(/^(.*)\/([nwr]\d+)(\/details)?$/) @@ -269,7 +269,7 @@ window.showDetails = function (data, category) { ) h = document.createElement('h3') - h.innerHTML = 'Attributes' + h.innerHTML = lang('header:attributes') dom.appendChild(h) div = document.createElement('dl') @@ -286,7 +286,7 @@ window.showDetails = function (data, category) { dom.appendChild(div) h = document.createElement('h3') - h.innerHTML = 'OSM Meta' + h.innerHTML = lang('header:osm_meta') dom.appendChild(h) div = document.createElement('dl') From da73ecd5b899f24b8502c800d697472c85d00354 Mon Sep 17 00:00:00 2001 From: Cybereric Date: Tue, 20 Mar 2018 16:41:58 +0100 Subject: [PATCH 03/16] OpenStreetBrowser UI Translation --- lang/fr.json | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/lang/fr.json b/lang/fr.json index bd8ca8c4..7db585e8 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -1,32 +1,32 @@ { - "back": "", - "category-info-tooltip": "", - "closed": "", - "default": "", - "error": "", - "facilities": "", - "header:attributes": "", - "header:osm_meta": "", - "images": "", - "loading": "", + "back": "Retour", + "category-info-tooltip": "Info & Légende", + "closed": "Fermé", + "default": "Par défaut", + "error": "Erreur", + "facilities": "Aménagements", + "header:attributes": "Attributs", + "header:osm_meta": "Métadonnées OSM", + "images": "Images", + "loading": "Chargement...", "main:options": "Options", "more": "plus", "more_categories": "Plus de catégories", - "more_categories_gitea": "", - "open": "", + "more_categories_gitea": "Créez et améliorez vous-mêmes les catégories!", + "open": "ouvrir", "options:data_lang": "Langue des données", - "options:data_lang:desc": "", + "options:data_lang:desc": "Beaucoup d'éléments de la carte ont leur nom (et d'autres tags) traduits en différentes langues (exemple avec 'name:en', 'name:de'). Spécifiez quelle langue devrait être utilisée pour l'affichage, ou 'Langue locale' pour que la valeur non traduite (ex 'name') soit toujours utilisée.", "options:data_lang:local": "Langue locale", - "options:overpassUrl": "", - "options:preferredBaseMap": "", + "options:overpassUrl": "URL OverpassAPI", + "options:preferredBaseMap": "Carte de base préférée", "options:ui_lang": "Langue de l'interface", "other": "Autres", "save": "Sauvegarder", - "show details": "", - "toggle_fullscreen": "", - "unknown": "Inconnue", + "show details": "montrer les détails", + "toggle_fullscreen": "Basculer en plein écran", + "unknown": "inconnu.e", "unnamed": "sans nom", - "wikipedia:no-url-parse": "", - "zoom_in_appear": "", - "zoom_in_more": "" + "wikipedia:no-url-parse": "Impossible de parser l'URL de Wikipédia", + "zoom_in_appear": "zoomez pour que les éléments de la carte apparaissent", + "zoom_in_more": "zoomez pour afficher plus d'éléments de la carte" } From 757c4b3d14e255a21d8698dc6449c41b7b51b826 Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Tue, 20 Mar 2018 21:55:05 +0000 Subject: [PATCH 04/16] Create pt-pt.json --- lang/pt-pt.json | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 lang/pt-pt.json diff --git a/lang/pt-pt.json b/lang/pt-pt.json new file mode 100644 index 00000000..52e7982f --- /dev/null +++ b/lang/pt-pt.json @@ -0,0 +1,35 @@ +{ + "back": "voltar", + "category-info-tooltip": "Info & Legenda", + "closed": "fechado", + "default": "padrão", + "error": { + "message": "Erro", + "!=1": "Erros" + }, + "facilities": "Instalações", + "images": "Imagens", + "header:attributes": "Atributos", + "header:osm_meta": "", + "loading": "A carregar...", + "main:options": "Opções", + "more": "mais", + "more_categories": "Mais categorias", + "more_categories_gitea": "Criar & melhorar categorias você mesmo!", + "open": "abrir", + "options:data_lang": "Língua dos dados", + "options:data_lang:desc": "Muitos elementos do mapa possuem seus nomes (e outras etiquetas) traduzidas para línguas diferentes (p.ex. com 'name:en', 'name:de'). Especificar qual língua deve ser usada para exibição, ou 'Língua local' de forma que sempre os valores não tranduzidos (p.ex. 'name') sejam usados.", + "options:data_lang:local": "Língua local", + "options:overpassUrl": "URL do OverpassAPI", + "options:preferredBaseMap": "Mapa-base preferido", + "options:ui_lang": "Língua da interface", + "other": "Outro", + "save": "Guardar", + "show details": "mostrar detalhes", + "toggle_fullscreen": "Alternar modo ecrã inteiro", + "unknown": "desconhecido", + "unnamed": "sem nome", + "wikipedia:no-url-parse": "Não foi possível analisar URL da Wikipédia", + "zoom_in_appear": "Faça zoom in para detalhes do mapa aparecerem", + "zoom_in_more": "Faça zoom in para mostrar mais detalhes no mapa" +} From f0cf8146f330ccb50b85a6ee41fbda68896f1ab8 Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Tue, 20 Mar 2018 21:56:35 +0000 Subject: [PATCH 05/16] pt-br: fix typo "tela cheira" --> "tela cheia" --- lang/pt-br.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/pt-br.json b/lang/pt-br.json index a4ea2b0f..98ba97c2 100644 --- a/lang/pt-br.json +++ b/lang/pt-br.json @@ -26,7 +26,7 @@ "other": "Outro", "save": "Salvar", "show details": "mostrar detalhes", - "toggle_fullscreen": "Alternar modo tela cheira", + "toggle_fullscreen": "Alternar modo tela cheia", "unknown": "desconhecido", "unnamed": "sem nome", "wikipedia:no-url-parse": "Não se pôde analisar URL da Wikipédia", From 820e00436b22acc91a324a36376fe31c1195f5fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Thu, 22 Mar 2018 13:53:09 +0100 Subject: [PATCH 06/16] index.php: if parameter 'lang' is supplied, use this language --- index.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.php b/index.php index b351ed03..74cd756b 100644 --- a/index.php +++ b/index.php @@ -17,6 +17,10 @@ elseif (isset($config['categoriesDir'])) { } } +if (isset($_GET['lang'])) { + $_SESSION['ui_lang'] = $_GET['lang']; +} + if (sizeof($_GET)) { Header('Location: .#' . http_build_query($_GET)); exit(0); From 59b5e5fc81e7362e9e8b4b9de20e6a2cd5921b6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Thu, 22 Mar 2018 13:54:59 +0100 Subject: [PATCH 07/16] Update submodules --- lib/modulekit/base | 2 +- lib/modulekit/form | 2 +- lib/modulekit/lang | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/modulekit/base b/lib/modulekit/base index 279863bd..8adaf00d 160000 --- a/lib/modulekit/base +++ b/lib/modulekit/base @@ -1 +1 @@ -Subproject commit 279863bd46c9ee04b34c4a97cdfaee74f92172d5 +Subproject commit 8adaf00d0ec3472784802522f90c875ef2ce04ba diff --git a/lib/modulekit/form b/lib/modulekit/form index 4a94f64c..c26a06bd 160000 --- a/lib/modulekit/form +++ b/lib/modulekit/form @@ -1 +1 @@ -Subproject commit 4a94f64c11d3f16b01a5aec6afd5cfb4b7257572 +Subproject commit c26a06bdac5ba37a1ef020dd62a53de7ccce61d1 diff --git a/lib/modulekit/lang b/lib/modulekit/lang index 80118dbc..3688eae1 160000 --- a/lib/modulekit/lang +++ b/lib/modulekit/lang @@ -1 +1 @@ -Subproject commit 80118dbcaafa9ab95298be95548126071efc069f +Subproject commit 3688eae14c7cd2b7aa2f54ed23ffaa5e1c7b8338 From d63ae9b070c6391f1e8d98f340869bbb14827289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Thu, 22 Mar 2018 13:59:03 +0100 Subject: [PATCH 08/16] Rename pt-pt to pt --- lang/{pt-pt.json => pt.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lang/{pt-pt.json => pt.json} (100%) diff --git a/lang/pt-pt.json b/lang/pt.json similarity index 100% rename from lang/pt-pt.json rename to lang/pt.json From af5ce727d528c7116903ac0262d137e22387c77e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Thu, 22 Mar 2018 13:59:22 +0100 Subject: [PATCH 09/16] Make language 'pt' available --- conf.php-dist | 1 + 1 file changed, 1 insertion(+) diff --git a/conf.php-dist b/conf.php-dist index d0339532..59e7035f 100644 --- a/conf.php-dist +++ b/conf.php-dist @@ -97,6 +97,7 @@ $languages = array( "ja", // Japanese "nl", // Dutch "pl", // Polish + "pt", // Portugese "pt-br", // Portugese (Brazil) "ro", // Romanian "ru", // Russian From b04b173db43e9f631fc99c4009d3d5821a3fca1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Thu, 22 Mar 2018 14:11:44 +0100 Subject: [PATCH 10/16] Make 'en' the default language in config --- conf.php-dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.php-dist b/conf.php-dist index 59e7035f..7e706f41 100644 --- a/conf.php-dist +++ b/conf.php-dist @@ -82,13 +82,13 @@ $config['baseMaps'] = array( // List of available user interface languages $languages = array( + "en", // English "ast", // Asturian "ca", // Catalan "cs", // Czech "da", // Danish "de", // German "el", // Greek - "en", // English "es", // Spanish "et", // Estonian "fr", // French From a4cc3b710b412588f53a4491165e6d133a4af1a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Wed, 28 Mar 2018 15:27:26 +0200 Subject: [PATCH 11/16] Popup Footer: use a list for links --- src/CategoryOverpass.js | 6 +++--- style.css | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/CategoryOverpass.js b/src/CategoryOverpass.js index 0aed8710..19018688 100644 --- a/src/CategoryOverpass.js +++ b/src/CategoryOverpass.js @@ -391,9 +391,9 @@ CategoryOverpass.prototype.updatePopupContent = function (object, popup) { popupBody.innerHTML = this.popupBodyTemplate.render(data) } - var footer = document.createElement('div') - footer.className = 'footer' - var footerContent = '' + lang('show details') + '' + var footer = document.createElement('ul') + footer.className = 'popup-footer' + var footerContent = '
  • ' + lang('show details') + '
  • ' footer.innerHTML = footerContent popup._contentNode.appendChild(footer) diff --git a/style.css b/style.css index 3fab58f5..2442f96a 100644 --- a/style.css +++ b/style.css @@ -109,11 +109,13 @@ a:active { margin-left: 0; } -#content a.showDetails { - display: none; +.leaflet-popup-content ul.popup-footer { + padding: 0; } -a.showDetails { - display: block; +.leaflet-popup-content ul.popup-footer li { + display: inline-block; + list-style: none; + padding-right: 1em; } /* Footer */ From 752c33cb7a74cbfd2aa3d8f21907796ba644d98b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Wed, 28 Mar 2018 15:29:00 +0200 Subject: [PATCH 12/16] Popup Footer: add link to id Editor --- lang/de.json | 1 + lang/en.json | 1 + src/CategoryOverpass.js | 1 + 3 files changed, 3 insertions(+) diff --git a/lang/de.json b/lang/de.json index a6f66402..5b9d4659 100644 --- a/lang/de.json +++ b/lang/de.json @@ -3,6 +3,7 @@ "category-info-tooltip": "Info & Legende", "closed": "geschlossen", "default": "Standard", + "edit": "bearbeiten", "error": { "message": "Fehler", "!=1": "Fehler" diff --git a/lang/en.json b/lang/en.json index 483601d2..56ac93ae 100644 --- a/lang/en.json +++ b/lang/en.json @@ -3,6 +3,7 @@ "category-info-tooltip": "Info & Map key", "closed": "closed", "default": "default", + "edit": "edit", "error": { "message": "Error", "!=1": "Errors" diff --git a/src/CategoryOverpass.js b/src/CategoryOverpass.js index 19018688..42fe1165 100644 --- a/src/CategoryOverpass.js +++ b/src/CategoryOverpass.js @@ -394,6 +394,7 @@ CategoryOverpass.prototype.updatePopupContent = function (object, popup) { var footer = document.createElement('ul') footer.className = 'popup-footer' var footerContent = '
  • ' + lang('show details') + '
  • ' + footerContent += '
  • ' + lang('edit') + '
  • ' footer.innerHTML = footerContent popup._contentNode.appendChild(footer) From 319720bc7ca48340327741b1fae86ba9674703b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Thu, 29 Mar 2018 21:22:02 +0200 Subject: [PATCH 13/16] httpGet: accept 2nd parameter options --- src/httpGet.js | 2 +- src/wikidata.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/httpGet.js b/src/httpGet.js index dcc0cb8f..82a552a5 100644 --- a/src/httpGet.js +++ b/src/httpGet.js @@ -1,4 +1,4 @@ -function httpGet (url, callback) { +function httpGet (url, options, callback) { var xhr = new XMLHttpRequest() xhr.open('get', url, true) xhr.responseType = 'text' diff --git a/src/wikidata.js b/src/wikidata.js index 55c5f678..fe7da3ab 100644 --- a/src/wikidata.js +++ b/src/wikidata.js @@ -13,7 +13,7 @@ function wikidataLoad (id, callback) { } loadClash[id] = [] - httpGet('https://www.wikidata.org/wiki/Special:EntityData/' + id + '.json', function (err, result) { + httpGet('https://www.wikidata.org/wiki/Special:EntityData/' + id + '.json', {}, function (err, result) { if (err) { return callback(err, null) } From c6fa5b1f3947cf38ecbcc9abc561fdfd38d4dbe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Thu, 29 Mar 2018 21:24:24 +0200 Subject: [PATCH 14/16] httpGet: fallback to load-via-server; option 'forceServerLoad' --- httpGet.php | 2 ++ src/httpGet.js | 36 +++++++++++++++++++++++++++++++----- 2 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 httpGet.php diff --git a/httpGet.php b/httpGet.php new file mode 100644 index 00000000..88a75be1 --- /dev/null +++ b/httpGet.php @@ -0,0 +1,2 @@ + Date: Thu, 29 Mar 2018 21:30:33 +0200 Subject: [PATCH 15/16] Image: use preview image from Wikimedia Commons File page - fixes #41 --- src/image.js | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/image.js b/src/image.js index 5ac6be88..3d5e07d8 100644 --- a/src/image.js +++ b/src/image.js @@ -1,3 +1,4 @@ +var httpGet = require('./httpGet') var ImageLoader = require('./ImageLoader') var showTimer @@ -9,17 +10,25 @@ function showImage (image, dom) { } function showWikimediaImage (image, dom) { - var size = 400 - if ('width' in image && image.width < size) { - size = image.width - } + httpGet( + 'https://commons.wikimedia.org/wiki/File:' + encodeURIComponent(image.id), + { + forceServerLoad: true + }, + function (err, result) { + if (!result) { + return + } - var url = 'https://commons.wikimedia.org/w/thumb.php?f=' + encodeURIComponent(image.id) + '&w=' + size + let m = result.body.match('img .* src="([^"]+)" .* data-file-width="([0-9]+)" data-file-height="([0-9]+)"') + let src = m[1] - var div = document.createElement('div') - div.innerHTML = '' + var div = document.createElement('div') + div.innerHTML = '' - dom.appendChild(div) + dom.appendChild(div) + } + ) } // feature: { id: 'File:xxx.jpg', type: 'wikimedia|url', url: 'https://...' } From ceb027beed13fa825917b24e7b62a2e0f0c4af84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Thu, 29 Mar 2018 21:31:38 +0200 Subject: [PATCH 16/16] categories-to-lang: not translated -> add empty string (instead of null) --- bin/categories-to-lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/categories-to-lang b/bin/categories-to-lang index 551e9009..ba386983 100755 --- a/bin/categories-to-lang +++ b/bin/categories-to-lang @@ -103,7 +103,7 @@ function writeTranslationFiles () { let data = {} allIds.forEach(function (id) { - data[id] = null + data[id] = '' }) let keys = Object.keys(all[lang])