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

Change language on maps through Mapbox #3371

Closed
misaugstad opened this issue Aug 21, 2023 · 4 comments · Fixed by #3383
Closed

Change language on maps through Mapbox #3371

misaugstad opened this issue Aug 21, 2023 · 4 comments · Fixed by #3383
Assignees

Comments

@misaugstad
Copy link
Member

Brief description of problem/feature

Looks like our maps that we get through Mapbox are still using English by default. I'm sure that there is a setting for this. Note that almost all of our maps are using the old "Mapbox.js", but we are using the newer "Mapbox GL JS" in RouteBuilder.

@misaugstad
Copy link
Member Author

For the new version of Mapbox (Mapbox GL JS) which only RouteBuilder and (soon) Gallery use, the update is pretty easy. We just need to use the .setLayoutProperty() method, as described here.

For the old version of Mapbox (Mapbox.js), which most of our maps use (for now), the process is a bit more annoying. It's still manageable though!

  • Head to https://studio.mapbox.com/
  • Create a copy of the "light-zh-TW" or "streets-zh-TW" map
  • Edit all of the *-labels layers. For almost all of them there is a field that has something like coalesce(name_en, name), and you should edit the one with the language code to the desired code.
  • You can then edit the name of the layer in the top-left, name it using the language code
  • Publish the style

Then I'll probably add the different layer names as "translations" in the common.json file.

@jonfroehlich
Copy link
Member

jonfroehlich commented Aug 24, 2023 via email

@misaugstad
Copy link
Member Author

I do think that we should do and it's worth it! The issue is #2194

We're doing these first few maps with the newer version of Mapbox to get a feel for it before making a migration, but I think that we should do it.

That being said, making new layers for the old version of mapbox will take less than an hour, so I still think it's worth it to make this update for the old version of Mapbox in the interim.

@jonfroehlich
Copy link
Member

Nice. OK!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: done / on test servers
Development

Successfully merging a pull request may close this issue.

2 participants