mapbox-gl-js
mapbox-gl-js copied to clipboard
Add localization for UI strings
This PR adds translations for UI strings we use in GL JS into multiple languages.
Context | Screenshot |
---|---|
ID: AttributionControl.ToggleAttribution English: Toggle attribution Context: Tooltip text on AttributionControl hover |
![]() |
ID: AttributionControl.MapFeedback English: Map feedback Context: Accessibility label for the Improve this map link in the expanded AttributionControl . That label can be read by assistive technology |
![]() |
ID: FullscreenControl.Enter English: Enter fullscreen Context: Tooltip text on FullscreenControl hover when not in the fullscreen mode |
![]() |
ID: FullscreenControl.Exit English: Exit fullscreen Context: Tooltip text on FullscreenControl hover when in the fullscreen mode |
![]() |
ID: GeolocateControl.FindMyLocation English: Find my location Context: Tooltip text on GeolocateControl hover |
![]() |
ID: GeolocateControl.LocationNotAvailable English: Location not available Context: Tooltip text on GeolocateControl hover when we can't locate user |
![]() |
ID: LogoControl.Title English: Mapbox logo Context: Accessibility label for the Mapbox logo image. That label can be read by assistive technology |
![]() |
ID: Map.Title English: Map Context: Accessibility label for the map canvas element on the webpage. That label can be read by assistive technology |
![]() |
ID: NavigationControl.ResetBearing English: Reset bearing to north Context: Tooltip text on bearing button in NavigationControl |
![]() |
ID: NavigationControl.ZoomIn English: Zoom in Context: Tooltip text on plus button in NavigationControl |
![]() |
ID: NavigationControl.ZoomOut English: Zoom out Context: Tooltip text on minus button in NavigationControl |
![]() |
ID: ScrollZoomBlocker.CtrlMessage English: Use ctrl + scroll to zoom the map Context: Text on map blocker alert when cooperative gestures are enabled |
![]() |
ID: ScrollZoomBlocker.CmdMessage English: Use ⌘ + scroll to zoom the map Context: Text on map blocker alert when cooperative gestures are enabled |
![]() |
ID: TouchPanBlocker.Message English: Use two fingers to move the map Context: 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?