mapbox / mapbox/mapbox-gl-language
Localize expressions
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 204
- Forks
- 51
- PR merge metrics
- No merged PRs in 30d
Description
adaptPropertyLanguage() should attempt to localize expressions used as text-fields. Currently, it only works for constant strings and style functions.
mapbox/mapbox-gl-js#6197 is a proposal to make label localization a built-in feature of the style specification. In the meantime, mapbox/mapbox-gl-native#11651 has a comprehensive implementation of label localization in Objective-C. While that implementation targets NSExpression’s syntax, the same logic should more or less apply when working with style JSON objects.
/cc @lukasmartinelli @tristen @anandthakker
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 with adaptPropertyLanguage() in index.js lines 126-140 and review the linked mapbox-gl-native Objective-C implementation for label localization. Extend the behavior to expressions used as text-fields, then verify that constant strings, style functions, and expression-based labels are localized.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- localization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100