Add localization for UI strings
This PR adds translations for UI strings we use in GL JS into multiple languages.
| Context | Screenshot |
|---|---|
ID: AttributionControl.ToggleAttributionEnglish: Toggle attributionContext: Tooltip text on AttributionControl hover |
![]() |
ID: AttributionControl.MapFeedbackEnglish: Map feedbackContext: Accessibility label for the Improve this map link in the expanded AttributionControl. That label can be read by assistive technology |
![]() |
ID: FullscreenControl.EnterEnglish: Enter fullscreenContext: Tooltip text on FullscreenControl hover when not in the fullscreen mode |
![]() |
ID: FullscreenControl.ExitEnglish: Exit fullscreenContext: Tooltip text on FullscreenControl hover when in the fullscreen mode |
![]() |
ID: GeolocateControl.FindMyLocationEnglish: Find my locationContext: Tooltip text on GeolocateControl hover |
![]() |
ID: GeolocateControl.LocationNotAvailableEnglish: Location not availableContext: Tooltip text on GeolocateControl hover when we can't locate user |
![]() |
ID: LogoControl.TitleEnglish: Mapbox logoContext: Accessibility label for the Mapbox logo image. That label can be read by assistive technology |
![]() |
ID: Map.TitleEnglish: MapContext: Accessibility label for the map canvas element on the webpage. That label can be read by assistive technology |
![]() |
ID: NavigationControl.ResetBearingEnglish: Reset bearing to northContext: Tooltip text on bearing button in NavigationControl |
![]() |
ID: NavigationControl.ZoomInEnglish: Zoom inContext: Tooltip text on plus button in NavigationControl |
![]() |
ID: NavigationControl.ZoomOutEnglish: Zoom outContext: Tooltip text on minus button in NavigationControl |
![]() |
ID: ScrollZoomBlocker.CtrlMessageEnglish: Use ctrl + scroll to zoom the mapContext: Text on map blocker alert when cooperative gestures are enabled |
![]() |
ID: ScrollZoomBlocker.CmdMessageEnglish: Use ⌘ + scroll to zoom the mapContext: Text on map blocker alert when cooperative gestures are enabled |
![]() |
ID: TouchPanBlocker.MessageEnglish: Use two fingers to move the mapContext: Text on map blocker alert when cooperative gestures are enabled |
![]() |
Personally, I use number-format for units. Not all locales follow the pattern of ${number} ${unit}
The effect of this PR on the bundle size:
before
948K dist/mapbox-gl.js
256K dist/mapbox-gl.js.br
256K dist/mapbox-gl.js.tar.gz
after
972K dist/mapbox-gl.js
256K dist/mapbox-gl.js.br
264K dist/mapbox-gl.js.tar.gz
Compressed with:
tar -cvzf dist/mapbox-gl.js.tar.gz dist/mapbox-gl.js
brotli -q 11 dist/mapbox-gl.js -o dist/mapbox-gl.js.br
The German texts sound a bit strange. There are informal texts like "Finde …" or "Setze …" and formal texts like "Verwenden Sie …". I always try to avoid this decision by using words that don't need it (mostly infinitive). Here are my suggestions:
"GeolocateControl.FindMyLocation": "Meinen Standort finden", // or: "Aktueller Standort"
"NavigationControl.ResetBearing": "Orientierung auf Norden zurücksetzen",
"ScrollZoomBlocker.CtrlMessage": "Zoomen der Karte mit gedrückter Strg-Taste", // makes clear it's a key and avoids jargon like "+"
"ScrollZoomBlocker.CmdMessage": "Zoomen der Karte mit gedrückter ⌘-Taste",
"TouchPanBlocker.Message": "Verschieben der Karte mit zwei Fingern"
I'd also suggest changing these English texts:
"ScrollZoomBlocker.CtrlMessage": "Hold the Ctrl key while scrolling to zoom the map",
"ScrollZoomBlocker.CmdMessage": "Hold the ⌘ key while scrolling to zoom the map",
Thanks for the contribution, @ygoe!
@melanieimfeld, @kkaefer, what do you think of these suggestions? https://github.com/mapbox/mapbox-gl-js/pull/11733#issuecomment-1195773934
The German texts sound a bit strange. There are informal texts like "Finde …" or "Setze …" and formal texts like "Verwenden Sie …". I always try to avoid this decision by using words that don't need it (mostly infinitive). Here are my suggestions:
"GeolocateControl.FindMyLocation": "Meinen Standort finden", // or: "Aktueller Standort" "NavigationControl.ResetBearing": "Orientierung auf Norden zurücksetzen", "ScrollZoomBlocker.CtrlMessage": "Zoomen der Karte mit gedrückter Strg-Taste", // makes clear it's a key and avoids jargon like "+" "ScrollZoomBlocker.CmdMessage": "Zoomen der Karte mit gedrückter ⌘-Taste", "TouchPanBlocker.Message": "Verschieben der Karte mit zwei Fingern"
Glad to see this is happening.
I support a customer who does Indonesian and Transitional Chinese (HK, TW) which aren't in this PR.
The translations we are using came from Lionbridge and differ a bit from those in this PR, not sure if you're interested in seeing those differences?
Hi @andrewharvey,
Yes, we already have PRs for Indonesian and Tranditional Chinese that needs to be verified, any contributions are welcome!
Verifications are still needed for Czech, Greek, Indonesian, Georgian, Malay, Norwegian and Norwegian Bokmål, Slovak, Slovenian, Thai, and Traditional Chinese.
I wonder if "Improve this map" could also be translated? So far I haven't seen any option to achieve this. Is it possible?












