From f9b504e225a4f96901d530247c1a27fe4b1868c1 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 30 Jul 2025 19:15:51 +0100 Subject: [PATCH] Use modal alert for geocoding failures --- app/assets/javascripts/index/directions-endpoint.js | 4 ++-- config/locales/en.yml | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/index/directions-endpoint.js b/app/assets/javascripts/index/directions-endpoint.js index 785613b7a..ffbb30322 100644 --- a/app/assets/javascripts/index/directions-endpoint.js +++ b/app/assets/javascripts/index/directions-endpoint.js @@ -109,8 +109,8 @@ OSM.DirectionsEndpoint = function Endpoint(map, input, marker, dragCallback, cha delete endpoint.geocodeRequest; if (json.length === 0) { input.addClass("is-invalid"); - // eslint-disable-next-line no-alert - alert(OSM.i18n.t("javascripts.directions.errors.no_place", { place: endpoint.value })); + OSM.showAlert(OSM.i18n.t("javascripts.directions.errors.no_place.title"), + OSM.i18n.t("javascripts.directions.errors.no_place.body", { place: endpoint.value })); return; } diff --git a/config/locales/en.yml b/config/locales/en.yml index b4d6ee3b4..93f13dd64 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -3474,7 +3474,9 @@ en: mi: "%{distance}mi" errors: no_route: "Couldn't find a route between those two places." - no_place: "Sorry - couldn't locate '%{place}'." + no_place: + title: "Search failed" + body: "Couldn't locate '%{place}'." instructions: continue_without_exit: Continue on %{name} slight_right_without_exit: Slight right onto %{name} -- 2.39.5