]> git.openstreetmap.org Git - rails.git/commit
Avoid regexp not supported in old browsers
authorPablo Brasero <pablo@pablobm.com>
Tue, 22 Sep 2026 12:30:14 +0000 (13:30 +0100)
committerPablo Brasero <pablo@pablobm.com>
Thu, 24 Sep 2026 08:34:25 +0000 (09:34 +0100)
commit324b8d41c6ff92e1ee99e7524bc99b678dca55d7
tree58eaae86ccca42f72b28602c2581fd6ca0ad05b4
parent4bf80151e9a6597a28cb772302f39b53787b7f76
Avoid regexp not supported in old browsers

This comes after a user reported that the slippy map doesn't work on iOS 15,
which we have been able to reproduce with an old iPhone.

MapLibre's translation string keys are in CapitalisedCamelCase, as opposed to
our usual snake_case. This also conflicts with Leaflet's keys which are
also in snake_case. This creates a weird scenario where a translation key
is duplicated: `GeolocateControl` for MapLibre and `geolocate_control` for
leaflet.

The original translation strings can be seen at:
- https://github.com/maplibre/maplibre-gl-js/blob/8ebe6a085e934f1b136ead624a92abdf6399f7e2/src/ui/default_locale.ts
- https://github.com/domoritz/leaflet-locatecontrol/blob/a122fb1bfe1ad39d20382e1545eaa8cb367c48fd/src/L.Control.Locate.js
app/assets/javascripts/leaflet.locate.js
app/assets/javascripts/leaflet.zoom.js
app/assets/javascripts/maplibre/map.js
config/locales/en.yml