Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

fix(trips): the journal link's toast and tab texts as literal keys

Maurice0751b3e8c935
diff --git a/client/src/components/Trips/useTripJournalLink.ts b/client/src/components/Trips/useTripJournalLink.ts
index 611c8cb82..b0fa10d04 100644
--- a/client/src/components/Trips/useTripJournalLink.ts
+++ b/client/src/components/Trips/useTripJournalLink.ts
@@ -193,7 +193,7 @@ export function useTripJournalLink(tripId: number) {
setBusy(true);
try {
await write();
- toast.success(t(done));
+ toast.success(done);
cancel();
} catch (err: unknown) {
fail(err);
@@ -201,20 +201,20 @@ export function useTripJournalLink(tripId: number) {
setBusy(false);
}
},
- [cancel, fail, t, toast]
+ [cancel, fail, toast]
);
const save = useCallback(async () => {
if (mode === 'pick' && pickedId != null) {
- await run(() => store().link(tripId, pickedId, chosenMembers), 'trip.journal.linked');
+ await run(() => store().link(tripId, pickedId, chosenMembers), t('trip.journal.linked'));
} else if (mode === 'members') {
- await run(() => store().setMembers(tripId, chosenMembers), 'trip.journal.membersSaved');
+ await run(() => store().setMembers(tripId, chosenMembers), t('trip.journal.membersSaved'));
}
- }, [mode, pickedId, run, store, tripId, chosenMembers]);
+ }, [mode, pickedId, run, store, tripId, chosenMembers, t]);
const unlink = useCallback(async () => {
- await run(() => store().unlink(tripId), 'trip.journal.unlinked');
- }, [run, store, tripId]);
+ await run(() => store().unlink(tripId), t('trip.journal.unlinked'));
+ }, [run, store, tripId, t]);
return {
/** The section shows at all: the addon is on and this person may link, or the trip has a journal they see. */
diff --git a/client/src/pages/tripPlanner/useTripPlanner.ts b/client/src/pages/tripPlanner/useTripPlanner.ts
index 4425106e2..3a0803a7b 100644
--- a/client/src/pages/tripPlanner/useTripPlanner.ts
+++ b/client/src/pages/tripPlanner/useTripPlanner.ts
@@ -215,7 +215,7 @@ export function useTripPlanner() {
...(enabledAddons.documents ? [{ id: 'dateien', label: t(TRIP_TAB_LABEL_KEYS.dateien), icon: FolderOpen }] : []),
...(enabledAddons.collab ? [{ id: 'collab', label: t(TRIP_TAB_LABEL_KEYS.collab), icon: Users }] : []),
// A journal from the Journey addon tied to this trip, for whoever the link lets in.
- ...(journal.openJournalId != null ? [{ id: 'journal', label: t(TRIP_TAB_LABEL_KEYS.journal), icon: LinkedJournalIcon }] : []),
+ ...(journal.openJournalId != null ? [{ id: 'journal', label: t('trip.tabs.journal'), icon: LinkedJournalIcon }] : []),
].filter(tab => tab.id === 'plan' || !replacedTabs.has(tab.id))
// Positioned plugin tabs splice in ascending order so two positions stay stable;
// the rest append, exactly as before this capability existed.