diff --git a/webapp/locales/de.json b/webapp/locales/de.json index e37280a42..d26b0b23d 100644 --- a/webapp/locales/de.json +++ b/webapp/locales/de.json @@ -523,6 +523,11 @@ "title": "{APPLICATION_NAME} befindet sich in der Wartung" }, "map": { + "markerTypes": { + "group": "Gruppe", + "theUser": "deine Position", + "user": "Benutzer" + }, "pageTitle": "Karte", "styles": { "dark": "Dunkel", diff --git a/webapp/locales/en.json b/webapp/locales/en.json index 5635b4e4b..fc7601569 100644 --- a/webapp/locales/en.json +++ b/webapp/locales/en.json @@ -523,6 +523,11 @@ "title": "{APPLICATION_NAME} is under maintenance" }, "map": { + "markerTypes": { + "group": "group", + "theUser": "your position", + "user": "user" + }, "pageTitle": "Map", "styles": { "dark": "Dark", diff --git a/webapp/pages/map.vue b/webapp/pages/map.vue index 74c982ed6..febdd6488 100644 --- a/webapp/pages/map.vue +++ b/webapp/pages/map.vue @@ -189,7 +189,7 @@ export default { }), ) - // example: https://docs.mapbox.com/mapbox-gl-js/example/popup-on-hover/ + // example for popup: https://docs.mapbox.com/mapbox-gl-js/example/popup-on-hover/ // create a popup, but don't add it to the map yet this.markers.popup = new mapboxgl.Popup({ closeButton: false, @@ -197,7 +197,7 @@ export default { }) this.map.on('mouseenter', 'markers', (e) => { - // if (e.features[0].properties.type !== 'the-user') {} + // if (e.features[0].properties.type !== 'theUser') {} if (this.markers.popup.isOpen()) { this.map.getCanvas().style.cursor = '' this.markers.popup.remove() @@ -210,38 +210,33 @@ export default { const coordinates = e.features[0].geometry.coordinates.slice() const markerTypeLabel = e.features[0].properties.type === 'group' - ? 'Gruppe' + ? this.$t('map.markerTypes.group') : e.features[0].properties.type === 'user' - ? 'Benutzer' - : 'Deine Position' - const markerAboutLabel = e.features[0].properties.type === 'group' ? 'Ziel' : 'Über' - const markerProfileLinkLabel = 'Profil besuchen' - const markerProfileLinkTitle = `@${e.features[0].properties.slug}` + ? this.$t('map.markerTypes.user') + : this.$t('map.markerTypes.theUser') + const markerProfileLinkTitle = + (e.features[0].properties.type === 'group' ? '&' : '@') + e.features[0].properties.slug const markerProfileLink = (e.features[0].properties.type === 'group' ? '/group' : '/profile') + `/${e.features[0].properties.id}/${e.features[0].properties.slug}` let description = `