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

Commit cc8d78d

Browse files
author
Kerry
authored
Location sharing - add localised strings to map (#9025)
* add localised strings to map * fussy import ordering * remove unused scale control strings from override
1 parent 7fb48d2 commit cc8d78d

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

src/i18n/strings/en_EN.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,16 @@
726726
"Unknown App": "Unknown App",
727727
"This homeserver is not configured to display maps.": "This homeserver is not configured to display maps.",
728728
"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.",
729+
"Toggle attribution": "Toggle attribution",
730+
"Map feedback": "Map feedback",
731+
"Enter fullscreen": "Enter fullscreen",
732+
"Exit fullscreen": "Exit fullscreen",
733+
"Find my location": "Find my location",
734+
"Location not available": "Location not available",
735+
"Mapbox logo": "Mapbox logo",
736+
"Reset bearing to north": "Reset bearing to north",
737+
"Zoom in": "Zoom in",
738+
"Zoom out": "Zoom out",
729739
"Are you sure you want to exit during this export?": "Are you sure you want to exit during this export?",
730740
"Generating a ZIP": "Generating a ZIP",
731741
"Fetched %(count)s events out of %(total)s|other": "Fetched %(count)s events out of %(total)s",
@@ -2198,8 +2208,6 @@
21982208
"My live location": "My live location",
21992209
"Drop a Pin": "Drop a Pin",
22002210
"What location type do you want to share?": "What location type do you want to share?",
2201-
"Zoom in": "Zoom in",
2202-
"Zoom out": "Zoom out",
22032211
"Frequently Used": "Frequently Used",
22042212
"Smileys & People": "Smileys & People",
22052213
"Animals & Nature": "Animals & Nature",

src/utils/location/map.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { MatrixEvent } from "matrix-js-sdk/src/matrix";
1919
import { M_LOCATION } from "matrix-js-sdk/src/@types/location";
2020
import { logger } from "matrix-js-sdk/src/logger";
2121

22+
import { _t } from "../../languageHandler";
2223
import { parseGeoUri } from "./parseGeoUri";
2324
import { findMapStyleUrl } from "./findMapStyleUrl";
2425
import { LocationShareError } from "./LocationShareErrors";
@@ -37,6 +38,18 @@ export const createMap = (
3738
zoom: 15,
3839
interactive,
3940
attributionControl: false,
41+
locale: {
42+
'AttributionControl.ToggleAttribution': _t('Toggle attribution'),
43+
'AttributionControl.MapFeedback': _t('Map feedback'),
44+
'FullscreenControl.Enter': _t('Enter fullscreen'),
45+
'FullscreenControl.Exit': _t('Exit fullscreen'),
46+
'GeolocateControl.FindMyLocation': _t('Find my location'),
47+
'GeolocateControl.LocationNotAvailable': _t('Location not available'),
48+
'LogoControl.Title': _t('Mapbox logo'),
49+
'NavigationControl.ResetBearing': _t('Reset bearing to north'),
50+
'NavigationControl.ZoomIn': _t('Zoom in'),
51+
'NavigationControl.ZoomOut': _t('Zoom out'),
52+
},
4053
});
4154
map.addControl(new maplibregl.AttributionControl(), 'top-right');
4255

0 commit comments

Comments
 (0)