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

Commit

Permalink
Location sharing - add localised strings to map (#9025)
Browse files Browse the repository at this point in the history
* add localised strings to map

* fussy import ordering

* remove unused scale control strings from override
  • Loading branch information
Kerry authored Jul 8, 2022
1 parent 7fb48d2 commit cc8d78d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
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

0 comments on commit cc8d78d

Please sign in to comment.