Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add localization for UI strings #11733

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open

Add localization for UI strings #11733

wants to merge 44 commits into from

Conversation

stepankuzmin
Copy link
Contributor

@stepankuzmin stepankuzmin commented Apr 12, 2022

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
Screenshot 2022-04-12 at 12 22 53
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
Screenshot 2022-04-11 at 21 40 33
ID: FullscreenControl.Enter
English: Enter fullscreen
Context: Tooltip text on FullscreenControl hover when not in the fullscreen mode
Screenshot 2022-04-12 at 12 31 49
ID: FullscreenControl.Exit
English: Exit fullscreen
Context: Tooltip text on FullscreenControl hover when in the fullscreen mode
Screenshot 2022-04-12 at 12 31 58
ID: GeolocateControl.FindMyLocation
English: Find my location
Context: Tooltip text on GeolocateControl hover
Screenshot 2022-04-12 at 12 34 57
ID: GeolocateControl.LocationNotAvailable
English: Location not available
Context: Tooltip text on GeolocateControl hover when we can't locate user
Screenshot 2022-04-12 at 12 35 08
ID: LogoControl.Title
English: Mapbox logo
Context: Accessibility label for the Mapbox logo image. That label can be read by assistive technology
Screenshot 2022-04-12 at 12 38 52
ID: Map.Title
English: Map
Context: Accessibility label for the map canvas element on the webpage. That label can be read by assistive technology
Screenshot 2022-04-12 at 12 42 03
ID: NavigationControl.ResetBearing
English: Reset bearing to north
Context: Tooltip text on bearing button in NavigationControl
Screenshot 2022-04-12 at 12 45 06
ID: NavigationControl.ZoomIn
English: Zoom in
Context: Tooltip text on plus button in NavigationControl
Screenshot 2022-04-12 at 12 45 56
ID: NavigationControl.ZoomOut
English: Zoom out
Context: Tooltip text on minus button in NavigationControl
Screenshot 2022-04-12 at 12 46 02
ID: ScrollZoomBlocker.CtrlMessage
English: Use ctrl + scroll to zoom the map
Context: Text on map blocker alert when cooperative gestures are enabled
Screenshot 2022-04-12 at 13 08 03
ID: ScrollZoomBlocker.CmdMessage
English: Use ⌘ + scroll to zoom the map
Context: Text on map blocker alert when cooperative gestures are enabled
Screenshot 2022-04-12 at 13 08 03
ID: TouchPanBlocker.Message
English: Use two fingers to move the map
Context: Text on map blocker alert when cooperative gestures are enabled
IMG_A42AFAB7325C-1

@varna
Copy link
Contributor

varna commented May 19, 2022

Personally, I use number-format for units. Not all locales follow the pattern of ${number} ${unit}

@stepankuzmin stepankuzmin marked this pull request as ready for review May 20, 2022 15:52
stepankuzmin and others added 19 commits May 24, 2022 12:38
Few changes:

- Use `ft` for feet (https://pt.wikipedia.org/wiki/P%C3%A9_(unidade))
- Use `feedback`, commonly used by other map providers.
- Use common computer anglicisms (zoom, mouse scroll)
- Do not gender Mapbox as there is not yet a consensus :-)
@stepankuzmin
Copy link
Contributor Author

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

@ygoe
Copy link

ygoe commented Jul 26, 2022

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",

@stepankuzmin
Copy link
Contributor Author

Thanks for the contribution, @ygoe!

@melanieimfeld, @kkaefer, what do you think of these suggestions? #11733 (comment)

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"

@andrewharvey
Copy link
Collaborator

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?

@stepankuzmin
Copy link
Contributor Author

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.

stepankuzmin and others added 2 commits August 26, 2022 11:55
…nwbsn, @minons1, and @ardiantovn)

* Add localization for UI strings in Indonesian

Co-authored-by: Salim <55347970+minons1@users.noreply.github.com>
Co-authored-by: Christian Wibisono <christian.wibisono7@gmail.com>
Co-authored-by: ardiantovn <vendi2012@gmail.com>
@stepankuzmin stepankuzmin requested a review from a team as a code owner November 24, 2022 11:58
* Add localization for UI strings in Czech

* Update cs.js

* Update cs.js
@gregholst
Copy link

I wonder if "Improve this map" could also be translated? So far I haven't seen any option to achieve this. Is it possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip changelog Used for PRs that do not need a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants