From c3363ee0e3808d826c4e4797ffa7207647435e08 Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero Date: Fri, 12 Dec 2025 18:40:12 +0100 Subject: feat: add comfort parameters to AppConfiguration and update OTP service for Madrid timezone handling --- src/frontend/app/i18n/locales/es-ES.json | 8 ++++---- src/frontend/app/routes/planner.tsx | 21 ++++++++++----------- 2 files changed, 14 insertions(+), 15 deletions(-) (limited to 'src/frontend') diff --git a/src/frontend/app/i18n/locales/es-ES.json b/src/frontend/app/i18n/locales/es-ES.json index d7c94ea..ab18c7b 100644 --- a/src/frontend/app/i18n/locales/es-ES.json +++ b/src/frontend/app/i18n/locales/es-ES.json @@ -120,8 +120,8 @@ "searching_ellipsis": "Buscando…", "results": "Resultados", "close": "Cerrar", - "results_title": "Results", - "clear": "Clear", + "results_title": "Resultados", + "clear": "Borrar", "no_routes_found": "No se encontraron rutas", "no_routes_message": "No pudimos encontrar una ruta para tu viaje. Intenta cambiar la hora o las ubicaciones.", "walk": "Caminar", @@ -129,8 +129,8 @@ "from_to": "De {{from}} a {{to}}", "itinerary_details": "Detalles del itinerario", "back": "← Atrás", - "cash_fare": "{{amount}} €", - "card_fare": "{{amount}} €" + "fare": "{{amount}} €", + "free": "Gratuito" }, "common": { "loading": "Cargando...", diff --git a/src/frontend/app/routes/planner.tsx b/src/frontend/app/routes/planner.tsx index 0f52fef..5121dce 100644 --- a/src/frontend/app/routes/planner.tsx +++ b/src/frontend/app/routes/planner.tsx @@ -104,10 +104,12 @@ const ItinerarySummary = ({ const startTime = new Date(itinerary.startTime).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", + timeZone: "Europe/Madrid", }); const endTime = new Date(itinerary.endTime).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", + timeZone: "Europe/Madrid", }); const walkTotals = sumWalkMetrics(itinerary.legs); @@ -121,15 +123,6 @@ const ItinerarySummary = ({ itinerary.cardFareEuro ?? busLegsCount * FARE_CARD_PER_BUS ).toFixed(2); - // Format currency based on locale (ES/GL: "1,50 €", EN: "€1.50") - const formatCurrency = (amount: string) => { - const isSpanishOrGalician = - i18n.language.startsWith("es") || i18n.language.startsWith("gl"); - return isSpanishOrGalician - ? t("planner.cash_fare", { amount }) - : t("planner.cash_fare", { amount }); - }; - return (
- {formatCurrency(cashFare)} + {cashFare === "0.00" + ? t("planner.free") + : t("planner.fare", { amount: cashFare })} - {t("planner.card_fare", { amount: cardFare })} + {cardFare === "0.00" + ? t("planner.free") + : t("planner.fare", { amount: cardFare })}
@@ -628,6 +625,7 @@ const ItineraryDetail = ({ {new Date(leg.startTime).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", + timeZone: "Europe/Madrid", })}{" "} -{" "} {( @@ -812,6 +810,7 @@ export default function PlannerPage() { ? new Date(searchTime).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", + timeZone: "Europe/Madrid", }) : null; -- cgit v1.3