Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Location sharing - add localised strings to map #9025

Merged
merged 6 commits into from
Jul 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,16 @@
"Unknown App": "Unknown App",
"This homeserver is not configured to display maps.": "This homeserver is not configured to display maps.",
"This homeserver is not configured correctly to display maps, or the configured map server may be unreachable.": "This homeserver is not configured correctly to display maps, or the configured map server may be unreachable.",
"Toggle attribution": "Toggle attribution",
"Map feedback": "Map feedback",
"Enter fullscreen": "Enter fullscreen",
"Exit fullscreen": "Exit fullscreen",
"Find my location": "Find my location",
"Location not available": "Location not available",
"Mapbox logo": "Mapbox logo",
"Reset bearing to north": "Reset bearing to north",
"Zoom in": "Zoom in",
"Zoom out": "Zoom out",
"Are you sure you want to exit during this export?": "Are you sure you want to exit during this export?",
"Generating a ZIP": "Generating a ZIP",
"Fetched %(count)s events out of %(total)s|other": "Fetched %(count)s events out of %(total)s",
Expand Down Expand Up @@ -2198,8 +2208,6 @@
"My live location": "My live location",
"Drop a Pin": "Drop a Pin",
"What location type do you want to share?": "What location type do you want to share?",
"Zoom in": "Zoom in",
"Zoom out": "Zoom out",
"Frequently Used": "Frequently Used",
"Smileys & People": "Smileys & People",
"Animals & Nature": "Animals & Nature",
Expand Down
13 changes: 13 additions & 0 deletions src/utils/location/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { MatrixEvent } from "matrix-js-sdk/src/matrix";
import { M_LOCATION } from "matrix-js-sdk/src/@types/location";
import { logger } from "matrix-js-sdk/src/logger";

import { _t } from "../../languageHandler";
import { parseGeoUri } from "./parseGeoUri";
import { findMapStyleUrl } from "./findMapStyleUrl";
import { LocationShareError } from "./LocationShareErrors";
Expand All @@ -37,6 +38,18 @@ export const createMap = (
zoom: 15,
interactive,
attributionControl: false,
locale: {
'AttributionControl.ToggleAttribution': _t('Toggle attribution'),
'AttributionControl.MapFeedback': _t('Map feedback'),
'FullscreenControl.Enter': _t('Enter fullscreen'),
'FullscreenControl.Exit': _t('Exit fullscreen'),
'GeolocateControl.FindMyLocation': _t('Find my location'),
'GeolocateControl.LocationNotAvailable': _t('Location not available'),
'LogoControl.Title': _t('Mapbox logo'),
'NavigationControl.ResetBearing': _t('Reset bearing to north'),
'NavigationControl.ZoomIn': _t('Zoom in'),
'NavigationControl.ZoomOut': _t('Zoom out'),
},
});
map.addControl(new maplibregl.AttributionControl(), 'top-right');

Expand Down