mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-21 03:26:07 +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.
93 lines
6.3 KiB
TypeScript
93 lines
6.3 KiB
TypeScript
import type { NotificationLocale } from '../externalNotifications/types';
|
|
|
|
const th: NotificationLocale = {
|
|
email: {
|
|
footer: 'คุณได้รับข้อความนี้เนื่องจากเปิดใช้การแจ้งเตือนใน TREK',
|
|
manage: 'จัดการการตั้งค่าในหน้าการตั้งค่า',
|
|
madeWith: 'สร้างด้วย',
|
|
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.type}ใหม่ "${p.booking}" ลงใน "${p.trip}"`,
|
|
}),
|
|
trip_reminder: (p) => ({
|
|
title: `แจ้งเตือนทริป: ${p.trip}`,
|
|
body: `ทริป "${p.trip}" ของคุณกำลังจะมาถึงเร็ว ๆ นี้!`,
|
|
}),
|
|
todo_due: (p) => ({
|
|
title: `งานที่ถึงกำหนด: ${p.todo}`,
|
|
body: `"${p.todo}" ใน "${p.trip}" ครบกำหนดวันที่ ${p.due}`,
|
|
}),
|
|
vacay_invite: (p) => ({
|
|
title: 'คำเชิญรวมปฏิทินวันลา',
|
|
body: `${p.actor} เชิญคุณให้รวมแผนวันลา เปิด TREK เพื่อยอมรับหรือปฏิเสธ`,
|
|
}),
|
|
vacay_share: (p) => ({
|
|
title: 'แชร์ปฏิทินวันลาแล้ว',
|
|
body: `${p.actor} แชร์ปฏิทินวันลาของตนกับคุณ เปิด TREK เพื่อดู`,
|
|
}),
|
|
collection_invite: (p) => ({
|
|
title: 'คำเชิญให้แชร์คอลเลกชัน',
|
|
body: `${p.actor} เชิญคุณให้แชร์คอลเลกชัน เปิด TREK เพื่อยอมรับหรือปฏิเสธ`,
|
|
}),
|
|
photos_shared: (p) => ({
|
|
title: `แชร์รูปภาพ ${p.count} รูปแล้ว`,
|
|
body: `${p.actor} แชร์รูปภาพ ${p.count} รูปใน "${p.trip}"`,
|
|
}),
|
|
collab_message: (p) => ({
|
|
title: `ข้อความใหม่ใน "${p.trip}"`,
|
|
body: `${p.actor}: ${p.preview}`,
|
|
}),
|
|
packing_tagged: (p) => ({
|
|
title: `รายการจัดกระเป๋า: ${p.category}`,
|
|
body: `${p.actor} มอบหมายหมวดหมู่รายการจัดกระเป๋า "${p.category}" ให้คุณใน "${p.trip}"`,
|
|
}),
|
|
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'
|
|
? ` ตั้งแต่การแจ้งเตือนครั้งก่อน ยังมีความล้มเหลวอีก ${p.suppressed} ครั้งที่ไม่ได้แจ้งเตือนแยก`
|
|
: ''),
|
|
}),
|
|
paddle_region_requested: (p) => ({
|
|
title: 'มีคำขอภูมิภาคพายเรือ',
|
|
body: `${p.actor} กำลังวางแผนทริปพายเรือใน ${p.region} โหลดหรือปฏิเสธข้อมูลแหล่งน้ำได้ในส่วนผู้ดูแลที่ส่วนเสริม`,
|
|
}),
|
|
synology_session_cleared: () => ({
|
|
title: 'ล้างเซสชัน Synology แล้ว',
|
|
body: 'บัญชีหรือ URL ของ Synology เปลี่ยนแปลง คุณจึงออกจากระบบ Synology Photos แล้ว',
|
|
}),
|
|
wanderer_source_hint: (p) => ({
|
|
title: `เส้นทาง wanderer: ${p.tour}`,
|
|
body:
|
|
p.state === 'changed'
|
|
? `"${p.tour}" ใน "${p.trip}" ถูกเปลี่ยนใน wanderer เปิดทัวร์และตรวจแหล่งที่มาเพื่อดูการเปลี่ยนแปลงทั้งหมด ไม่มีสิ่งใดในทริปเปลี่ยนเอง`
|
|
: p.state === 'unverifiable'
|
|
? `"${p.tour}" ใน "${p.trip}" ตรวจใน wanderer ไม่ได้อีกต่อไป ทัวร์ในทริปของคุณยังคงเหมือนเดิม`
|
|
: `"${p.tour}" ใน "${p.trip}" อาจเปลี่ยนแปลงใน wanderer เปิดทัวร์และตรวจแหล่งที่มา ไม่มีสิ่งใดในทริปเปลี่ยนเอง`,
|
|
}),
|
|
plugin_notification: (p) => ({ title: p.title ?? '', body: p.body ?? '' }),
|
|
},
|
|
passwordReset: {
|
|
subject: 'รีเซ็ตรหัสผ่านของคุณ',
|
|
greeting: 'สวัสดี',
|
|
body: 'เราได้รับคำขอรีเซ็ตรหัสผ่านสำหรับบัญชี TREK ของคุณ คลิกปุ่มด้านล่างเพื่อตั้งรหัสผ่านใหม่',
|
|
ctaIntro: 'รีเซ็ตรหัสผ่าน',
|
|
expiry: 'ลิงก์นี้จะหมดอายุใน 60 นาที',
|
|
ignore: 'หากคุณไม่ได้ส่งคำขอนี้ คุณสามารถละเว้นอีเมลนี้ได้อย่างปลอดภัย — รหัสผ่านของคุณจะไม่เปลี่ยนแปลง',
|
|
},
|
|
};
|
|
|
|
export default th;
|