From 1ec86540976c55381be80bf715ccb28c16b9079d Mon Sep 17 00:00:00 2001 From: R Klemm Date: Sun, 16 Feb 2020 19:55:13 +0100 Subject: [PATCH 1/4] change osm copyright attribution and add OpenStreetMap Contribution Keys --- i18n/de.js | 3 ++- i18n/en.js | 3 ++- i18n/es.js | 3 ++- i18n/fr.js | 3 ++- i18n/ru.js | 3 ++- i18n/sv.js | 3 ++- i18n/vi.js | 3 ++- src/leaflet_options.js | 2 +- 8 files changed, 15 insertions(+), 8 deletions(-) diff --git a/i18n/de.js b/i18n/de.js index 8c6299eb..6031cc81 100644 --- a/i18n/de.js +++ b/i18n/de.js @@ -16,5 +16,6 @@ module.exports = { 'Bike': 'Fahrrad', 'Car': 'Auto', 'Foot': 'Fussgänger', - 'About': 'Informationen zu diesem Service' + 'About': 'Informationen zu diesem Service', + 'OpenStreetMap-contributors': 'OpenStreetMap Mitwirkende' }; diff --git a/i18n/en.js b/i18n/en.js index 2bf00b9f..bbc43a5f 100644 --- a/i18n/en.js +++ b/i18n/en.js @@ -16,5 +16,6 @@ module.exports = { 'Bike': 'Bike', 'Car': 'Car', 'Foot': 'Foot', - 'About': 'About this service' + 'About': 'About this service', + 'OpenStreetMap-contributors': 'OpenStreetMap contributors' }; diff --git a/i18n/es.js b/i18n/es.js index 3d4eb59e..f8397e4c 100644 --- a/i18n/es.js +++ b/i18n/es.js @@ -13,5 +13,6 @@ module.exports = { 'Bike': 'Bicicleta', 'Car': 'Coche', 'Foot': 'Peatón', - 'About': 'Sobre este servicio' + 'About': 'Sobre este servicio', + 'OpenStreetMap-contributors': 'Colaboradores de OpenStreetMap' }; diff --git a/i18n/fr.js b/i18n/fr.js index 1d41e6ff..469ba755 100644 --- a/i18n/fr.js +++ b/i18n/fr.js @@ -13,5 +13,6 @@ module.exports = { 'Bike': 'Vélo', 'Car': 'Voiture', 'Foot': 'Piéton', - 'About': 'Sur ce service' + 'About': 'Sur ce service', + 'OpenStreetMap-contributors': 'les contributeurs d’OpenStreetMap' }; diff --git a/i18n/ru.js b/i18n/ru.js index a274983a..53ed541a 100644 --- a/i18n/ru.js +++ b/i18n/ru.js @@ -13,5 +13,6 @@ module.exports = { 'Bike': 'велосипе́д', 'Car': 'автомоби́ль', 'Foot': 'пешехо́д', - 'About': 'информа́ция' + 'About': 'информа́ция', + 'OpenStreetMap-contributors': 'Участники OpenStreetMap' }; diff --git a/i18n/sv.js b/i18n/sv.js index 9e012697..44995c5b 100644 --- a/i18n/sv.js +++ b/i18n/sv.js @@ -13,5 +13,6 @@ module.exports = { 'Bike': 'Bike', 'Car': 'Car', 'Foot': 'Foot', - 'About': 'About this service' + 'About': 'About this service', + 'OpenStreetMap-contributors': 'OpenStreetMaps bidragsgivare' }; diff --git a/i18n/vi.js b/i18n/vi.js index b32ef474..af5b429b 100644 --- a/i18n/vi.js +++ b/i18n/vi.js @@ -13,5 +13,6 @@ module.exports = { 'Bike': 'Bike', 'Car': 'Car', 'Foot': 'Foot', - 'About': 'About this service' + 'About': 'About this service', + 'OpenStreetMap-contributors': 'những người đóng góp vào OpenStreetMap' }; diff --git a/src/leaflet_options.js b/src/leaflet_options.js index 35420ec0..0b1ddd43 100644 --- a/src/leaflet_options.js +++ b/src/leaflet_options.js @@ -3,7 +3,7 @@ var L = require('leaflet'); var de = L.tileLayer('//{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png', { - attribution: 'Karte hergestellt aus OpenStreetMap-Daten | Lizenz: Open Database License (ODbL)' + attribution: ':copyright: OpenStreetMap-contributors | Lizenz: Open Database License (ODbL)' }), standard = L.tileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors' From 1de660d2982104c87447d61bd89c900d0c876115 Mon Sep 17 00:00:00 2001 From: R Klemm Date: Sun, 16 Feb 2020 19:55:47 +0100 Subject: [PATCH 2/4] add idea folder to gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 46a9b2d1..6b213145 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ node_modules/ *.swp bundle*raw* bundle*map + +.idea \ No newline at end of file From b886fb9afb86f4bae4dcfebb4c62b854316155b2 Mon Sep 17 00:00:00 2001 From: R Klemm Date: Mon, 17 Feb 2020 01:29:01 +0100 Subject: [PATCH 3/4] add translation of attribution params and change attribution for tile layers --- i18n/de.js | 4 +++- i18n/en.js | 1 - i18n/es.js | 4 +++- i18n/fr.js | 4 +++- i18n/ru.js | 4 +++- i18n/sv.js | 2 +- i18n/vi.js | 2 +- src/leaflet_options.js | 20 +++++++++++++++++--- 8 files changed, 31 insertions(+), 10 deletions(-) diff --git a/i18n/de.js b/i18n/de.js index 6031cc81..22038b26 100644 --- a/i18n/de.js +++ b/i18n/de.js @@ -17,5 +17,7 @@ module.exports = { 'Car': 'Auto', 'Foot': 'Fussgänger', 'About': 'Informationen zu diesem Service', - 'OpenStreetMap-contributors': 'OpenStreetMap Mitwirkende' + 'OpenStreetMap contributors': 'OpenStreetMap Mitwirkende', + 'Imagery': 'Bilddaten', + 'Data': 'Daten' }; diff --git a/i18n/en.js b/i18n/en.js index bbc43a5f..bc2acc50 100644 --- a/i18n/en.js +++ b/i18n/en.js @@ -17,5 +17,4 @@ module.exports = { 'Car': 'Car', 'Foot': 'Foot', 'About': 'About this service', - 'OpenStreetMap-contributors': 'OpenStreetMap contributors' }; diff --git a/i18n/es.js b/i18n/es.js index f8397e4c..0750b9ba 100644 --- a/i18n/es.js +++ b/i18n/es.js @@ -14,5 +14,7 @@ module.exports = { 'Car': 'Coche', 'Foot': 'Peatón', 'About': 'Sobre este servicio', - 'OpenStreetMap-contributors': 'Colaboradores de OpenStreetMap' + 'OpenStreetMap contributors': 'Colaboradores de OpenStreetMap', + 'Imagery': 'Imágenes', + 'Data': 'Datos' }; diff --git a/i18n/fr.js b/i18n/fr.js index 469ba755..2ee8c29b 100644 --- a/i18n/fr.js +++ b/i18n/fr.js @@ -14,5 +14,7 @@ module.exports = { 'Car': 'Voiture', 'Foot': 'Piéton', 'About': 'Sur ce service', - 'OpenStreetMap-contributors': 'les contributeurs d’OpenStreetMap' + 'OpenStreetMap contributors': 'les contributeurs d’OpenStreetMap', + 'Imagery': 'Imagerie', + 'Data': 'Les données' }; diff --git a/i18n/ru.js b/i18n/ru.js index 53ed541a..59c91804 100644 --- a/i18n/ru.js +++ b/i18n/ru.js @@ -14,5 +14,7 @@ module.exports = { 'Car': 'автомоби́ль', 'Foot': 'пешехо́д', 'About': 'информа́ция', - 'OpenStreetMap-contributors': 'Участники OpenStreetMap' + 'OpenStreetMap contributors': 'Участники OpenStreetMap', + 'Imagery': 'образность', + 'Data': 'Данные' }; diff --git a/i18n/sv.js b/i18n/sv.js index 44995c5b..de544a48 100644 --- a/i18n/sv.js +++ b/i18n/sv.js @@ -14,5 +14,5 @@ module.exports = { 'Car': 'Car', 'Foot': 'Foot', 'About': 'About this service', - 'OpenStreetMap-contributors': 'OpenStreetMaps bidragsgivare' + 'OpenStreetMap contributors': 'OpenStreetMaps bidragsgivare' }; diff --git a/i18n/vi.js b/i18n/vi.js index af5b429b..6b7c4d9e 100644 --- a/i18n/vi.js +++ b/i18n/vi.js @@ -14,5 +14,5 @@ module.exports = { 'Car': 'Car', 'Foot': 'Foot', 'About': 'About this service', - 'OpenStreetMap-contributors': 'những người đóng góp vào OpenStreetMap' + 'OpenStreetMap contributors': 'những người đóng góp vào OpenStreetMap' }; diff --git a/src/leaflet_options.js b/src/leaflet_options.js index 0b1ddd43..ba90d181 100644 --- a/src/leaflet_options.js +++ b/src/leaflet_options.js @@ -1,16 +1,30 @@ 'use strict'; var L = require('leaflet'); +var _localization = require('./localization'); +var _links = require('./links'); +var _parsedOptions = _links.parse(window.location.search.slice(1)); +var _local = _localization.get(_parsedOptions.language); + +// translate and check variables +var dataTrans = _local['Data']? _local['Data'] :'Data'; +var imageryTrans = _local['Imagery']? _local['Imagery'] :'Imagery'; + +// set attribution string +var osmAttrImagery = imageryTrans +' © '+_local['OpenStreetMap contributors']+''; +var osmAttrData = dataTrans+' © Open Database License (ODbL)'; var de = L.tileLayer('//{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png', { - attribution: ':copyright: OpenStreetMap-contributors | Lizenz: Open Database License (ODbL)' + format: 'image/png', + attribution: osmAttrImagery + ' | ' + osmAttrData }), standard = L.tileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { - attribution: '© OpenStreetMap contributors' + format: 'image/png', + attribution: osmAttrImagery + ' | ' + osmAttrData }), hiking = L.tileLayer('//tile.waymarkedtrails.org/hiking/{z}/{x}/{y}.png', {}), - bike = L.tileLayer('//tile.waymarkedtrails.org/cycling/{z}/{x}/{y}.png', {}) + bike = L.tileLayer('//tile.waymarkedtrails.org/cycling/{z}/{x}/{y}.png', {}); module.exports = { defaultState: { From 19fe8c785e63cf791fa19dcc5ec73b822e1da7d8 Mon Sep 17 00:00:00 2001 From: R Klemm Date: Mon, 17 Feb 2020 21:36:44 +0100 Subject: [PATCH 4/4] remove Data lizenz from TileLayer --- src/leaflet_options.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/leaflet_options.js b/src/leaflet_options.js index ba90d181..a8bd904a 100644 --- a/src/leaflet_options.js +++ b/src/leaflet_options.js @@ -16,11 +16,11 @@ var osmAttrData = dataTrans+' ©