mapbox / mapbox/mapbox-gl-language
Cannot set the map language
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 204
- Forks
- 51
- PR merge metrics
- No merged PRs in 30d
Description
My website supports two languages: en, de. The currently selected language is set in the `` attribute. The user may choose the language they want out of these two. The map should follow that as well.
Without this plugin, my maps are always in German, no matter what I do.
With this plugin, the map follows the browser's first language (if supported, see #4) but not the page content's language from the above attribute.
I saw that there is a `setLanguage` method but it requires a parameter `style` which is not documented. I have no idea what I should pass to it. So I cannot consider that method. And then there's nothing left. The plugin cannot set the map language to the page language.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the plugin's setLanguage method and its browser-language handling, focusing on the undocumented style parameter and the page's html lang attribute. Done means the map language follows a supported page language such as en or de, with behavior covered by an appropriate test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, internationalization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100