Files
TREK/shared/src/i18n/zh/externalNotifications.ts
T
Maurice 2e1dca9fe9 feat(tours): let a background check hint at changes of your own wanderer trails
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.
2026-10-20 15:35:32 +02:00

94 lines
3.9 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type { NotificationLocale } from '../externalNotifications/types';
import { pluralForm } from '../plural';
const zh: 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: '假期合并邀请',
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', { other: `${p.count} 张照片已分享` }),
body: pluralForm(p.count, 'zh', { 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', { 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 zh;