Files
TREK/shared/src/i18n/et/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

101 lines
4.5 KiB
TypeScript

import type { NotificationLocale } from '../externalNotifications/types';
import { pluralForm } from '../plural';
import reservations from './reservations';
const et: NotificationLocale = {
email: {
footer: 'Said selle kirja, sest oled TREKis teavitused lubanud.',
manage: 'Halda eelistusi seadetes',
madeWith: 'Loodud rakendusega',
openTrek: 'Ava TREK',
},
events: {
trip_invite: (p) => ({
title: `Reisikutse: „${p.trip}”`,
body: `${p.actor} kutsus ${p.invitee ? `kasutaja ${p.invitee}` : 'ühe liikme'} reisile „${p.trip}”.`,
}),
booking_change: (p) => ({
title: `Uus broneering: ${p.booking}`,
body: `${p.actor} lisas reisile „${p.trip}” uue broneeringu „${p.booking}” (tüüp: ${reservations[`reservations.type.${p.type}`] ?? (p.type === 'booking' ? 'broneering' : p.type)}).`,
}),
trip_reminder: (p) => ({
title: `Reisi meeldetuletus: ${p.trip}`,
body: `Sinu reis „${p.trip}” algab peagi!`,
}),
todo_due: (p) => ({
title: `Ülesande tähtaeg: ${p.todo}`,
body: `Reisi „${p.trip}” ülesande „${p.todo}” tähtaeg on ${p.due}.`,
}),
vacay_invite: (p) => ({
title: 'Kutse puhkuseplaanide ühendamiseks',
body: `${p.actor} kutsus sind puhkuseplaane ühendama. Nõustumiseks või keeldumiseks ava TREK.`,
}),
vacay_share: (p) => ({
title: 'Puhkusekalender jagatud',
body: `${p.actor} jagas sinuga oma puhkusekalendrit. Vaatamiseks ava TREK.`,
}),
collection_invite: (p) => ({
title: 'Kogumiku kutse',
body: `${p.actor} kutsus sind kogumikku jagama. Nõustumiseks või keeldumiseks ava TREK.`,
}),
photos_shared: (p) => ({
title: pluralForm(p.count, 'et', { one: `Jagatud ${p.count} foto`, other: `Jagatud ${p.count} fotot` }),
body: pluralForm(p.count, 'et', {
one: `${p.actor} jagas reisil „${p.trip}” ${p.count} foto.`,
other: `${p.actor} jagas reisil „${p.trip}” ${p.count} fotot.`,
}),
}),
collab_message: (p) => ({
title: `Uus sõnum reisil „${p.trip}”`,
body: `${p.actor}: ${p.preview}`,
}),
packing_tagged: (p) => ({
title: `Pakkimine: ${p.category}`,
body: `${p.actor} määras sind reisil „${p.trip}” vastutama pakkimiskategooria „${p.category}” eest.`,
}),
version_available: (p) => ({
title: 'TREKi uus versioon on saadaval',
body: `TREK ${p.version} on nüüd saadaval. Uuendamiseks ava halduspaneel.`,
}),
replica_failure: (p) => ({
title: 'Salvestuskoopia tõrge',
body:
`Koopia kirjutamine taustasüsteemi „${p.backend}” ebaõnnestus: toiming ${p.op}, võti ${p.key} — ${p.error}.` +
(p.suppressed !== '0'
? pluralForm(p.suppressed, 'et', {
one: ` Pärast viimast teavitust jäeti veel ${p.suppressed} tõrketeavitus saatmata.`,
other: ` Pärast viimast teavitust jäeti veel ${p.suppressed} tõrketeavitust saatmata.`,
})
: ''),
}),
paddle_region_requested: (p) => ({
title: 'Aerutamispiirkonda taotleti',
body: `${p.actor} kavandab aerutamismatka piirkonnas ${p.region}. Laadi või lükka selle veeandmed tagasi halduses jaotises Lisad.`,
}),
synology_session_cleared: () => ({
title: 'Synology seanss tühjendatud',
body: 'Sinu Synology konto või URL muutus. Sind on Synology Photosist välja logitud.',
}),
wanderer_source_hint: (p) => ({
title: `wanderer rada: ${p.tour}`,
body:
p.state === 'changed'
? `„${p.tour}“ reisil „${p.trip}“ muudeti wandereris. Ava matk ja kontrolli selle allikat, et näha kõiki muudatusi. Reisis ei muutu midagi iseenesest.`
: p.state === 'unverifiable'
? `„${p.tour}“ reisil „${p.trip}“ ei saa wandereris enam kontrollida. Matk sinu reisis jääb samaks.`
: `„${p.tour}“ reisil „${p.trip}“ võib olla wandereris muutunud. Ava matk ja kontrolli selle allikat. Reisis ei muutu midagi iseenesest.`,
}),
plugin_notification: (p) => ({ title: p.title ?? '', body: p.body ?? '' }),
},
passwordReset: {
subject: 'Lähtesta oma parool',
greeting: 'Tere',
body: 'Saime taotluse sinu TREKi konto parooli lähtestamiseks. Uue parooli määramiseks klõpsa alloleval nupul.',
ctaIntro: 'Lähtesta parool',
expiry: 'See link aegub 60 minuti pärast.',
ignore: 'Kui sa seda ei taotlenud, võid kirja rahulikult eirata — sinu parool ei muutu.',
},
};
export default et;