Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Feature: Dynamically localize compass text #949

Closed
wants to merge 1 commit into from
Closed

Feature: Dynamically localize compass text #949

wants to merge 1 commit into from

Conversation

friedbunny
Copy link
Contributor

Draw the compass text dynamically based on the user's device language. This adds CompassBlank.png at the three necessary scales.

I don't know what the localization plans are (and being pre-beta it's surely not a high priority), so this hardcodes the different localized strings rather than messing with anything more involved. Once localization gets on the roadmap this will have to be revisited.

Japanese/Chinese

Mapbox GL in Japanese

English/Default

Mapbox GL in English

Apple Maps in Japanese

Apple Maps in Japanese

... not sure why I've been so fixated on compasses, but hopefully this is useful. I also tossed in Compass@3x.png for the hell of it.

@friedbunny
Copy link
Contributor Author

Oh, and this doesn't work in the simulator — I believe language is (mistakenly) always taken from the system, not from the iOS simulator.

@incanus
Copy link
Contributor

incanus commented Mar 6, 2015

Oh, interesting... So this hasn't come up in past with our iOS SDK. The image is actually cribbed from MapKit by use of UIKit-Artwork-Extractor. I'm going to close here for now, but the PR will stick around and we can revisit. Do you have a good sense @friedbunny what Maps.app does here?

@incanus incanus closed this Mar 6, 2015
@friedbunny
Copy link
Contributor Author

iOS 8 Maps follows this strategy (AFAIK) — I took the blanks from MapKit.framework. 😅

@incanus
Copy link
Contributor

incanus commented Mar 6, 2015

Cool, much appreciated and ❤️ the attention to detail. We don't yet have localization on the roadmap, but it will become increasingly important, including at the GL labels level. We'll always have this here, but I think closing for now rather than leaving open is a good move.

I WON'T FORGET U LOCALIZED COMPASS

@friedbunny
Copy link
Contributor Author

Sure thing, this is definitely not a priority. Just one of those little touches that puts a twinkle in my eye and doesn't trod anybody's toes too terribly.

And since I'm at it, perhaps I'll add the missing @3x resources in another PR — if those aren't going to be revamped.

@incanus
Copy link
Contributor

incanus commented Mar 6, 2015

And since I'm at it, perhaps I'll add the missing @3x resources in another PR — if those aren't going to be revamped.

If you have them from Apple, yeah. Per #843 we are going to do our style sprites differently but if we're copying Apple resources, I'm all for grabbing their @3x versions as well.

@1ec5
Copy link
Contributor

1ec5 commented Jun 28, 2016

#4783 made the compass text localizable using a similar strategy as in this PR (but slightly more robust). However, no actual localizations have been added yet.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants