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

Automatically localize to user preferred language #36

Closed
1ec5 opened this issue Nov 20, 2016 · 5 comments
Closed

Automatically localize to user preferred language #36

1ec5 opened this issue Nov 20, 2016 · 5 comments

Comments

@1ec5
Copy link
Contributor

1ec5 commented Nov 20, 2016

We should have an example that localizes a Mapbox Streets–sourced style on the fly according to the user’s preferred language. It’d be similar to the code added in mapbox/mapbox-gl-native#6819, except that a hard-coded list of layers would be unnecessary because we’d iterate over all the symbol layers.

Requires v3.4.0 for the runtime styling API. mapbox/mapbox-gl-native#7031 would completely obviate this example.

/cc @friedbunny

@1ec5 1ec5 added this to the ios-v3.4.0 milestone Nov 20, 2016
@1ec5
Copy link
Contributor Author

1ec5 commented Nov 20, 2016

This example is needed for parity with this GL JS example. Unlike the GL JS example, there won’t be any UI component, because we’d grab the preferred language from UILocale.

@friedbunny
Copy link
Contributor

If the goal of this example is to show how to localize labels, I feel like this effort would be better spent implementing mapbox/mapbox-gl-native#7031 and providing a friendly API for everyone.

If, on the other hand, it’s meant as a runtime styling example, then I think we should skip the automatic localization in the name of code clarity. If they want localization, we could link to mapbox/mapbox-gl-native#6819 in the accompanying text.

@1ec5
Copy link
Contributor Author

1ec5 commented Nov 23, 2016

Automatically matching the user’s preferred language (or the application’s current UI language) is a real world use case. Forcing a specific language would make for a contrived example, although that’s precisely what we have for GL JS.

You’re right that this example would lay bare the need for mapbox/mapbox-gl-native#7031, but that issue is currently blocked by mapbox/mapbox-gl-native#6584, which definitely won’t make it into v3.4.0.

@friedbunny
Copy link
Contributor

This will be a feature in v3.6.2, via mapbox/mapbox-gl-native#9582.

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

No branches or pull requests

2 participants