diff --git a/src/controls/geoposition.js b/src/controls/geoposition.js index b86c40f4e..d24599194 100644 --- a/src/controls/geoposition.js +++ b/src/controls/geoposition.js @@ -21,6 +21,11 @@ const Geoposition = function Geoposition(options = {}) { let positionButton; let markerOverlay; let geolocation; + const localization = options.localization; + + function localize(key) { + return localization.getStringByKeys({ targetParentKey: 'geoposition', targetKey: key }); + } const centerPosition = () => { if (geolocation.getTracking()) { @@ -137,7 +142,7 @@ const Geoposition = function Geoposition(options = {}) { toggleState(); }, icon: geolocationIcon, - tooltipText: 'Visa din nuvarande position i kartan', + tooltipText: localize('positionButtonTooltip'), tooltipPlacement: 'east', methods: { active: onActive, diff --git a/src/controls/home.js b/src/controls/home.js index b468e256b..3abf96e6a 100644 --- a/src/controls/home.js +++ b/src/controls/home.js @@ -42,7 +42,7 @@ const Home = function Home(options = {}) { zoomToHome(); }, icon: '#ic_home_24px', - tooltipText: localize('zoomHomeButton'), + tooltipText: localize('zoomHomeButtonTooltip'), tooltipPlacement: 'east' }); }, diff --git a/src/controls/zoom.js b/src/controls/zoom.js index c8eba6fe8..b6d02c64c 100644 --- a/src/controls/zoom.js +++ b/src/controls/zoom.js @@ -48,7 +48,7 @@ const Zoom = function Zoom(options = {}) { zoomByDelta(delta); }, icon: '#ic_add_24px', - tooltipText: localize('zoomInButton'), + tooltipText: localize('zoomInButtonTooltip'), tooltipPlacement: 'east' }); zoomOut = Button({ @@ -57,7 +57,7 @@ const Zoom = function Zoom(options = {}) { zoomByDelta(-delta); }, icon: '#ic_remove_24px', - tooltipText: localize('zoomOutButton'), + tooltipText: localize('zoomOutButtonTooltip'), tooltipPlacement: 'east' }); }, diff --git a/src/loc/en_US.json b/src/loc/en_US.json index a45eaeda6..de75dd789 100644 --- a/src/loc/en_US.json +++ b/src/loc/en_US.json @@ -107,11 +107,14 @@ "drawFreehand": "Freehand" }, "zoom": { - "zoomInButton": "Zoom into the map", - "zoomOutButton": "Zoom out in the map" + "zoomInButtonTooltip": "Zoom into the map", + "zoomOutButtonTooltip": "Zoom out in the map" }, "home": { - "zoomHomeButton": "Zoom to the entire map" + "zoomHomeButtonTooltip": "Zoom to the entire map" + }, + "geoposition": { + "positionButtonTooltip": "Show your current position on the map" } }, "style": { diff --git a/src/loc/sv_SE.json b/src/loc/sv_SE.json index ef98bca1e..02b4daab2 100644 --- a/src/loc/sv_SE.json +++ b/src/loc/sv_SE.json @@ -107,11 +107,14 @@ "drawFreehand": "Frihand" }, "zoom": { - "zoomInButton": "Zooma in i kartan", - "zoomOutButton": "Zooma ut i kartan" + "zoomInButtonTooltip": "Zooma in i kartan", + "zoomOutButtonTooltip": "Zooma ut i kartan" }, "home": { - "zoomHomeButton": "Zooma till hela kartan" + "zoomHomeButtonTooltip": "Zooma till hela kartan" + }, + "geoposition": { + "positionButtonTooltip": "Visa din nuvarande position i kartan" } }, "style": {