Replace mapbox-gl-language with Diplomat#39
Conversation
| localizedNamePropertyFormat: "name_$1", | ||
| }); | ||
| localizeStyle(map, getLocales(), { | ||
| localizedNamePropertyFormat: "name_$1", |
There was a problem hiding this comment.
Unusually, the OHM tile schema’s format for localized name properties uses underscores instead of hyphens inside language tags, contrary to the IETF BCP 47 standard. Even other tilesets that use underscores, like Shortbread and Mapbox Streets, still use hyphens inside language tags.
There was a problem hiding this comment.
| localizeStyle(map, getLocales(), { | ||
| ...localizationOptions, | ||
| sourceLayers: ["place_points_centroids"], | ||
| glossLocalNames: true, | ||
| }); |
There was a problem hiding this comment.
I removed the local name glosses due to the stray control characters. We can restore the dual language labels once we address that issue in the font or remove the custom font in favor of a system font: OpenHistoricalMap/issues#1258.
|
Seem this PR works fine with the current changes in OpenHistoricalMap/ohm-deploy#757 |
|
I’ll go ahead and merge this PR. The lack of dual language labels is a real bummer, but there’s nothing we can do on the embed side until the styles are fixed: OpenHistoricalMap/issues#1258. OpenHistoricalMap/ohm-deploy#757 doesn’t seem to block anything. |
Replaced mapbox-gl-language with Diplomat for localizing labels into the user’s preferred language. Appended a gloss with the contemporary local language to any localized name.
This is blocked by maplibre/maplibre-gl-js#6903.
Also, Diplomat is designed to add the gloss only to populated places, but many administrative areas in OHM are still mapped redundantly as both boundary relations and place points, mimicking populated places. These redundant place points should be deleted. Until then, the display will be fairly cluttered.