Localize labels into preferred language #8
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By default, labels now show the user’s preferred language or the language specified in the URL, falling back to the contemporary local language (
name
). Only the styles on staging are supported while we wait for OpenHistoricalMap/issues#679 and OpenHistoricalMap/issues#775 to be deployed to production.This functionality currently relies on mapbox-gl-language as a stopgap, but with all the miserable workarounds I’ve had to put in this PR, such as mapbox/mapbox-gl-language#63 (comment), I’m eager for OSM Americana’s much more robust localization functionality to become available for reuse: osm-americana/openstreetmap-americana#914.
With label localization in place, it becomes much more important to avoid viciously mangling Arabic text and Hebrew ktiv menuqad. I’ve installed the mapbox-gl-rtl-text plugin, which was installed on the main site in OpenHistoricalMap/issues#359.
For example, if you run
npm install && npm start
, here’s Roman Egypt in 700 CE in Coptic:Working towards OpenHistoricalMap/issues#481 and OpenHistoricalMap/issues#854.