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 diff --git a/i18n/de.js b/i18n/de.js index 8c6299eb..22038b26 100644 --- a/i18n/de.js +++ b/i18n/de.js @@ -16,5 +16,8 @@ module.exports = { 'Bike': 'Fahrrad', 'Car': 'Auto', 'Foot': 'Fussgänger', - 'About': 'Informationen zu diesem Service' + 'About': 'Informationen zu diesem Service', + 'OpenStreetMap contributors': 'OpenStreetMap Mitwirkende', + 'Imagery': 'Bilddaten', + 'Data': 'Daten' }; diff --git a/i18n/en.js b/i18n/en.js index 2bf00b9f..bc2acc50 100644 --- a/i18n/en.js +++ b/i18n/en.js @@ -16,5 +16,5 @@ module.exports = { 'Bike': 'Bike', 'Car': 'Car', 'Foot': 'Foot', - 'About': 'About this service' + 'About': 'About this service', }; diff --git a/i18n/es.js b/i18n/es.js index 3d4eb59e..0750b9ba 100644 --- a/i18n/es.js +++ b/i18n/es.js @@ -13,5 +13,8 @@ module.exports = { 'Bike': 'Bicicleta', 'Car': 'Coche', 'Foot': 'Peatón', - 'About': 'Sobre este servicio' + 'About': 'Sobre este servicio', + 'OpenStreetMap contributors': 'Colaboradores de OpenStreetMap', + 'Imagery': 'Imágenes', + 'Data': 'Datos' }; diff --git a/i18n/fr.js b/i18n/fr.js index 1d41e6ff..2ee8c29b 100644 --- a/i18n/fr.js +++ b/i18n/fr.js @@ -13,5 +13,8 @@ module.exports = { 'Bike': 'Vélo', 'Car': 'Voiture', 'Foot': 'Piéton', - 'About': 'Sur ce service' + 'About': 'Sur ce service', + 'OpenStreetMap contributors': 'les contributeurs d’OpenStreetMap', + 'Imagery': 'Imagerie', + 'Data': 'Les données' }; diff --git a/i18n/ru.js b/i18n/ru.js index a274983a..59c91804 100644 --- a/i18n/ru.js +++ b/i18n/ru.js @@ -13,5 +13,8 @@ module.exports = { 'Bike': 'велосипе́д', 'Car': 'автомоби́ль', 'Foot': 'пешехо́д', - 'About': 'информа́ция' + 'About': 'информа́ция', + 'OpenStreetMap contributors': 'Участники OpenStreetMap', + 'Imagery': 'образность', + 'Data': 'Данные' }; diff --git a/i18n/sv.js b/i18n/sv.js index 9e012697..de544a48 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..6b7c4d9e 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..a8bd904a 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: 'Karte hergestellt aus OpenStreetMap-Daten | Lizenz: Open Database License (ODbL)' + format: 'image/png', + attribution: osmAttrImagery }), standard = L.tileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { - attribution: '© OpenStreetMap contributors' + format: 'image/png', + attribution: osmAttrImagery }), 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: {