diff options
Diffstat (limited to 'src/frontend')
| -rw-r--r-- | src/frontend/app/i18n/locales/es-ES.json | 8 | ||||
| -rw-r--r-- | src/frontend/app/routes/planner.tsx | 21 |
2 files changed, 14 insertions, 15 deletions
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 ( <div className="bg-white dark:bg-slate-800 p-4 rounded-lg shadow mb-3 cursor-pointer hover:bg-gray-50 dark:hover:bg-slate-700 border border-gray-200 dark:border-slate-700" @@ -193,11 +186,15 @@ const ItinerarySummary = ({ <span className="flex items-center gap-3"> <span className="flex items-center gap-1 font-semibold text-slate-700 dark:text-slate-300"> <Coins className="w-4 h-4" /> - {formatCurrency(cashFare)} + {cashFare === "0.00" + ? t("planner.free") + : t("planner.fare", { amount: cashFare })} </span> <span className="flex items-center gap-1 text-slate-600 dark:text-slate-400"> <CreditCard className="w-4 h-4" /> - {t("planner.card_fare", { amount: cardFare })} + {cardFare === "0.00" + ? t("planner.free") + : t("planner.fare", { amount: cardFare })} </span> </span> </div> @@ -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; |
