mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-02 17:26:24 +00:00
2e1dca9fe9
Settings, Integrations, wanderer gains an optional background check of the trails you imported, off until you switch it on. While on, TREK reads the short record of each such trail at most once a day (never its GPX file) and leaves a hint when the trail may have moved on: "may have changed" when only wanderer's change time moved, "changed" when its name or description proves it, and "not checkable" when the trail is gone, no longer yours or carries no change time. Nothing is ever said to be unchanged. A new hint arrives as a notification that opens the tour (a new ?place= link in the planner); the tour's provenance shows it with the source check right beside it, and the card lists all open hints in a dialog, each leading to its tour. The check reads the source in full as before and spends the hint; taking a change in stays the confirmed reimport. No tour is ever changed or deleted. The check only asks through your own connection, only about trails your account imported into trips you can still open, and stops when you switch it off, remove the connection, wanderer refuses the token (until a test passes or a new token is saved) or the admin switches wanderer off; hints and snapshots stay. A run asks at most 25 connections for at most 10 records each, one after another, and an instance that fails (an outage, a rate limit) is left alone for an hour, doubling up to two days. Server: migration 046120 adds the switch and the run bookkeeping to wanderer_connections and the tour_source_hints table (one row per snapshot, for its importer, gone with it). WandererWatchService and an hourly wanderer-watch job on the CronRegistrar live in the tours domain and read through WandererService; GET and PUT /api/integrations/wanderer/watch and GET /api/trips/:tripId/tours/wanderer/sources/:placeId/hint (place_edit, like the check) answer with @trek/shared contracts. A new user notification event, wanderer_source_hint, can be muted per channel. Saving a new token now clears what the last check said about the old one. There is no MCP tool, as for the rest of the personal wanderer connection. All 27 locales carry the strings, and the admin wiki page says what the check does.
94 lines
3.9 KiB
TypeScript
94 lines
3.9 KiB
TypeScript
import type { NotificationLocale } from '../externalNotifications/types';
|
||
import { pluralForm } from '../plural';
|
||
|
||
const zhTW: NotificationLocale = {
|
||
email: {
|
||
footer: '您收到這封郵件是因為您在 TREK 中啟用了通知。',
|
||
manage: '管理偏好設定',
|
||
madeWith: 'Made with',
|
||
openTrek: '開啟 TREK',
|
||
},
|
||
events: {
|
||
trip_invite: (p) => ({
|
||
title: `邀請加入「${p.trip}」`,
|
||
body: `${p.actor} 邀請了 ${p.invitee || '成員'} 加入行程「${p.trip}」。`,
|
||
}),
|
||
booking_change: (p) => ({
|
||
title: `新預訂:${p.booking}`,
|
||
body: `${p.actor} 在「${p.trip}」中新增了預訂「${p.booking}」(${p.type})。`,
|
||
}),
|
||
trip_reminder: (p) => ({
|
||
title: `行程提醒:${p.trip}`,
|
||
body: `您的行程「${p.trip}」即將開始!`,
|
||
}),
|
||
todo_due: (p) => ({
|
||
title: `待辦事項即將到期:${p.todo}`,
|
||
body: `「${p.trip}」中的「${p.todo}」將於 ${p.due} 到期。`,
|
||
}),
|
||
vacay_invite: (p) => ({
|
||
title: 'Vacay 融合邀請',
|
||
body: `${p.actor} 邀請您合併假期計畫。開啟 TREK 以接受或拒絕。`,
|
||
}),
|
||
vacay_share: (p) => ({
|
||
title: 'Vacay 日曆已共享',
|
||
body: `${p.actor} 與您共享了假期日曆。開啟 TREK 以檢視。`,
|
||
}),
|
||
collection_invite: (p) => ({
|
||
title: '收藏邀請',
|
||
body: `${p.actor} 邀請您共享收藏。開啟 TREK 以接受或拒絕。`,
|
||
}),
|
||
photos_shared: (p) => ({
|
||
title: pluralForm(p.count, 'zh-TW', { other: `已分享 ${p.count} 張照片` }),
|
||
body: pluralForm(p.count, 'zh-TW', { other: `${p.actor} 在「${p.trip}」中分享了 ${p.count} 張照片。` }),
|
||
}),
|
||
collab_message: (p) => ({
|
||
title: `「${p.trip}」中的新訊息`,
|
||
body: `${p.actor}:${p.preview}`,
|
||
}),
|
||
packing_tagged: (p) => ({
|
||
title: `打包清單:${p.category}`,
|
||
body: `${p.actor} 已將您指派到「${p.trip}」中的「${p.category}」分類。`,
|
||
}),
|
||
version_available: (p) => ({
|
||
title: '新版 TREK 可用',
|
||
body: `TREK ${p.version} 現已可用。請前往管理面板進行更新。`,
|
||
}),
|
||
replica_failure: (p) => ({
|
||
title: '儲存複本故障',
|
||
body:
|
||
`寫入複本 '${p.backend}' 失敗:${p.op} / ${p.key} — ${p.error}。` +
|
||
(p.suppressed !== '0'
|
||
? pluralForm(p.suppressed, 'zh-TW', { other: `自上次通知以來,另有 ${p.suppressed} 次失敗未個別通知。` })
|
||
: ''),
|
||
}),
|
||
paddle_region_requested: (p) => ({
|
||
title: '划槳區域申請',
|
||
body: `${p.actor} 正在 ${p.region} 規劃划槳行程。請在管理後台的附加元件中載入或拒絕其水域資料。`,
|
||
}),
|
||
synology_session_cleared: () => ({
|
||
title: 'Synology 工作階段已清除',
|
||
body: '您的 Synology 帳戶或 URL 已變更,您已登出 Synology Photos。',
|
||
}),
|
||
wanderer_source_hint: (p) => ({
|
||
title: `wanderer 路線: ${p.tour}`,
|
||
body:
|
||
p.state === 'changed'
|
||
? `「${p.trip}」中的「${p.tour}」已在 wanderer 中變更。開啟行程並檢查其來源即可查看所有變更。旅行中的內容不會自行改變。`
|
||
: p.state === 'unverifiable'
|
||
? `「${p.trip}」中的「${p.tour}」已無法在 wanderer 中檢查。你旅行中的行程保持不變。`
|
||
: `「${p.trip}」中的「${p.tour}」可能已在 wanderer 中變更。請開啟行程並檢查其來源。旅行中的內容不會自行改變。`,
|
||
}),
|
||
plugin_notification: (p) => ({ title: p.title ?? '', body: p.body ?? '' }),
|
||
},
|
||
passwordReset: {
|
||
subject: '重設您的密碼',
|
||
greeting: '您好',
|
||
body: '我們收到了重設您 TREK 帳號密碼的請求。點擊下方按鈕以設定新密碼。',
|
||
ctaIntro: '重設密碼',
|
||
expiry: '此連結將於 60 分鐘後失效。',
|
||
ignore: '若非您本人發起的請求,請忽略此郵件 — 您的密碼不會變更。',
|
||
},
|
||
};
|
||
|
||
export default zhTW;
|