From a21bf16e7342f4ec1d0ca751c65e9ed37b820c57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ullrich=20Sch=C3=A4fer?= Date: Fri, 10 Apr 2026 23:59:27 +0200 Subject: [PATCH] Fix i18n: use planner namespace in sidebar components WaypointSidebar and DayBreakdown were calling useTranslation() without the "planner" namespace, then using fully qualified keys like "planner.multiDay.overnight". Fixed to use useTranslation("planner") and drop the prefix from all t() calls. Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/planner/app/components/DayBreakdown.tsx | 4 ++-- apps/planner/app/components/WaypointSidebar.tsx | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/planner/app/components/DayBreakdown.tsx b/apps/planner/app/components/DayBreakdown.tsx index 9632531..58cfa9c 100644 --- a/apps/planner/app/components/DayBreakdown.tsx +++ b/apps/planner/app/components/DayBreakdown.tsx @@ -8,7 +8,7 @@ interface DayBreakdownProps { } export function DayBreakdown({ days, children }: DayBreakdownProps) { - const { t } = useTranslation(); + const { t } = useTranslation("planner"); const [expandedDay, setExpandedDay] = useState(1); return ( @@ -22,7 +22,7 @@ export function DayBreakdown({ days, children }: DayBreakdownProps) { className="flex w-full items-center gap-2 border-b border-gray-100 px-4 py-2 text-left hover:bg-gray-50" > - {t("planner.multiDay.dayLabel", { n: day.dayNumber })} + {t("multiDay.dayLabel", { n: day.dayNumber })} {day.startName && day.endName diff --git a/apps/planner/app/components/WaypointSidebar.tsx b/apps/planner/app/components/WaypointSidebar.tsx index 7e40d42..f238e18 100644 --- a/apps/planner/app/components/WaypointSidebar.tsx +++ b/apps/planner/app/components/WaypointSidebar.tsx @@ -33,7 +33,7 @@ interface WaypointSidebarProps { } export function WaypointSidebar({ yjs, routeStats, days }: WaypointSidebarProps) { - const { t } = useTranslation(); + const { t } = useTranslation("planner"); const [waypoints, setWaypoints] = useState([]); useEffect(() => { @@ -97,7 +97,7 @@ export function WaypointSidebar({ yjs, routeStats, days }: WaypointSidebarProps) {wp.overnight && ( - {t("planner.multiDay.overnight")} + {t("multiDay.overnight")} )}
@@ -106,7 +106,7 @@ export function WaypointSidebar({ yjs, routeStats, days }: WaypointSidebarProps) @@ -145,13 +145,13 @@ export function WaypointSidebar({ yjs, routeStats, days }: WaypointSidebarProps) {/* Header with route summary */}

- {t("planner.sidebar.waypoints")} ({waypoints.length}) + {t("sidebar.waypoints")} ({waypoints.length})

{routeStats && routeStats.distance !== undefined && (

{(routeStats.distance / 1000).toFixed(1)} km {routeStats.elevationGain !== undefined && ` · ↑${routeStats.elevationGain} m`} - {hasMultipleDays && ` · ${t("planner.multiDay.dayCount", { count: days.length })}`} + {hasMultipleDays && ` · ${t("multiDay.dayCount", { count: days.length })}`}

)}
@@ -185,14 +185,14 @@ export function WaypointSidebar({ yjs, routeStats, days }: WaypointSidebarProps)

{(routeStats.distance / 1000).toFixed(1)} km

-

{t("planner.multiDay.distance")}

+

{t("multiDay.distance")}

{routeStats.elevationGain !== undefined && (

↑ {routeStats.elevationGain} m

-

{t("planner.multiDay.ascent")}

+

{t("multiDay.ascent")}

)} {routeStats.elevationLoss !== undefined && ( @@ -200,7 +200,7 @@ export function WaypointSidebar({ yjs, routeStats, days }: WaypointSidebarProps)

↓ {routeStats.elevationLoss} m

-

{t("planner.multiDay.descent")}

+

{t("multiDay.descent")}

)}