Skip to content

Conversation

@1ec5
Copy link
Member

@1ec5 1ec5 commented Nov 29, 2025

Replaced localizeLayers() with a more encapsulated localizeStyle() that can automatically manipulate all the layers and upgrade unlocalizable layers. Added the rest of the country code conversion functionality from OSM Americana that the documentation teased about.

This PR includes the following backwards-incompatible changes compared to v0.1.0:

  • Replaced maplibregl.Map.prototype.localizeLayers() with maplibregl.Map.prototype.localizeStyle(). The raw maplibre.Diplomat.localizeLayers() remains available for more fine-grained control.
  • Removed the undocumented countryNamesByCode global variable in favor of maplibregl.Diplomat.getGlobalStateForLocalization() for setting up country name localization and maplibregl.Diplomat.getLocalizedCountryNameExpression() for getting an expression for getting a country name.

Fixes #3.

Replaced localizeLayers with a more encapsulated localizeStyle that can automatically manipulate all the layers and upgrade unlocalizable layers. Added the rest of the country code conversion functionality from OSM Americana.
@1ec5 1ec5 self-assigned this Nov 29, 2025
@1ec5 1ec5 merged commit 29545e5 into main Nov 29, 2025
3 checks passed
@1ec5 1ec5 deleted the 1ec5-auto-upgrade-3 branch November 29, 2025 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatically prepare text-field expressions for localization

2 participants