Skip to content

Localize labels based on language code only - #292

Merged
erictheise merged 2 commits into
stagingfrom
1ec5-language-basic-code-1068
Jun 12, 2025
Merged

erictheise merged 2 commits into
stagingfrom
1ec5-language-basic-code-1068

Conversation

@1ec5

@1ec5 1ec5 commented May 27, 2025

Copy link
Copy Markdown
Member

Strip any country and script codes from the locale code when localizing map labels. Since most user agents supply country codes, this will have the effect of making localized labels much more prevalent by default. However, it will regress Chinese and Serbian labels, since script codes are more or less expected for those languages. A proper fix will require either mapbox/mapbox-gl-language#4 or osm-americana/openstreetmap-americana#914.

Before After
en-US preference, en-US labels en-US preference, en labels

Addresses the issue reported in OpenHistoricalMap/issues#1068 (comment) but not the broader issue.

@erictheise
erictheise merged commit 0063e22 into staging Jun 12, 2025
@github-project-automation github-project-automation Bot moved this from In Progress to In Production in OpenHistoricalMap Dev Planning Jun 12, 2025
@1ec5
1ec5 deleted the 1ec5-language-basic-code-1068 branch July 24, 2025 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update Javascript code

Projects

Status: In Production

Development

Successfully merging this pull request may close these issues.

2 participants