From 8277f29c907ba3240fdd409b3da2c24b5466cb42 Mon Sep 17 00:00:00 2001 From: Marwin Hochfelsner <50826859+hlfan@users.noreply.github.com> Date: Thu, 20 Feb 2025 12:47:06 +0100 Subject: [PATCH 1/1] Split engine translations --- app/assets/javascripts/index/directions.js | 6 +++++- config/locales/en.yml | 18 ++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 240d987ba..6dbdedabc 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -310,7 +310,11 @@ OSM.Directions.engines = []; OSM.Directions.addEngine = function (engine, supportsHTTPS) { if (document.location.protocol === "http:" || supportsHTTPS) { engine.id = engine.provider + "_" + engine.mode; - engine.localeId = I18n.t("javascripts.directions.engines." + engine.id); + engine.localeId = `${ + I18n.t("site.search.modes." + engine.mode) + } (${ + I18n.t("site.search.providers." + engine.provider) + })`; OSM.Directions.engines.push(engine); } }; diff --git a/config/locales/en.yml b/config/locales/en.yml index dd7ae4033..3a82aab39 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2382,6 +2382,14 @@ en: where_am_i_title: Describe the current location using the search engine submit_text: "Go" reverse_directions_text: "Reverse Directions" + modes: + bicycle: "Bicycle" + car: "Car" + foot: "Foot" + providers: + fossgis_osrm: "OSRM" + graphhopper: "GraphHopper" + fossgis_valhalla: "Valhalla" key: table: entry: @@ -3227,16 +3235,6 @@ en: edit_help: Move the map and zoom in on a location you want to edit, then click here. directions: ascend: "Ascend" - engines: - fossgis_osrm_bike: "Bicycle (OSRM)" - fossgis_osrm_car: "Car (OSRM)" - fossgis_osrm_foot: "Foot (OSRM)" - graphhopper_bicycle: "Bicycle (GraphHopper)" - graphhopper_car: "Car (GraphHopper)" - graphhopper_foot: "Foot (GraphHopper)" - fossgis_valhalla_bicycle: "Bicycle (Valhalla)" - fossgis_valhalla_car: "Car (Valhalla)" - fossgis_valhalla_foot: "Foot (Valhalla)" descend: "Descend" directions: "Directions" distance: "Distance" -- 2.39.5