mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-14 00:01:03 +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.
97 lines
4.3 KiB
TypeScript
97 lines
4.3 KiB
TypeScript
import type { NotificationLocale } from '../externalNotifications/types';
|
|
import { pluralForm } from '../plural';
|
|
|
|
const it: NotificationLocale = {
|
|
email: {
|
|
footer: 'Hai ricevuto questa email perché hai le notifiche abilitate in TREK.',
|
|
manage: 'Gestisci le preferenze nelle impostazioni',
|
|
madeWith: 'Made with',
|
|
openTrek: 'Apri TREK',
|
|
},
|
|
events: {
|
|
trip_invite: (p) => ({
|
|
title: `Invito a "${p.trip}"`,
|
|
body: `${p.actor} ha invitato ${p.invitee || 'un membro'} al viaggio "${p.trip}".`,
|
|
}),
|
|
booking_change: (p) => ({
|
|
title: `Nuova prenotazione: ${p.booking}`,
|
|
body: `${p.actor} ha aggiunto una prenotazione "${p.booking}" (${p.type}) a "${p.trip}".`,
|
|
}),
|
|
trip_reminder: (p) => ({
|
|
title: `Promemoria viaggio: ${p.trip}`,
|
|
body: `Il tuo viaggio "${p.trip}" si avvicina!`,
|
|
}),
|
|
todo_due: (p) => ({
|
|
title: `Attività in scadenza: ${p.todo}`,
|
|
body: `"${p.todo}" in "${p.trip}" scade il ${p.due}.`,
|
|
}),
|
|
vacay_invite: (p) => ({
|
|
title: 'Invito Vacay Fusion',
|
|
body: `${p.actor} ti ha invitato a fondere i piani vacanza. Apri TREK per accettare o rifiutare.`,
|
|
}),
|
|
vacay_share: (p) => ({
|
|
title: 'Calendario Vacay condiviso',
|
|
body: `${p.actor} ha condiviso con te il suo calendario ferie. Apri TREK per vederlo.`,
|
|
}),
|
|
collection_invite: (p) => ({
|
|
title: 'Invito a una raccolta',
|
|
body: `${p.actor} ti ha invitato a condividere una raccolta. Apri TREK per accettare o rifiutare.`,
|
|
}),
|
|
photos_shared: (p) => ({
|
|
title: pluralForm(p.count, 'it', { one: `${p.count} foto condivisa`, other: `${p.count} foto condivise` }),
|
|
body: `${p.actor} ha condiviso ${p.count} foto in "${p.trip}".`,
|
|
}),
|
|
collab_message: (p) => ({
|
|
title: `Nuovo messaggio in "${p.trip}"`,
|
|
body: `${p.actor}: ${p.preview}`,
|
|
}),
|
|
packing_tagged: (p) => ({
|
|
title: `Bagagli: ${p.category}`,
|
|
body: `${p.actor} ti ha assegnato alla categoria "${p.category}" in "${p.trip}".`,
|
|
}),
|
|
version_available: (p) => ({
|
|
title: 'Nuova versione TREK disponibile',
|
|
body: `TREK ${p.version} è ora disponibile. Visita il pannello di amministrazione per aggiornare.`,
|
|
}),
|
|
replica_failure: (p) => ({
|
|
title: "Errore di replica dell'archiviazione",
|
|
body:
|
|
`Scrittura sulla replica non riuscita su '${p.backend}': ${p.op} di ${p.key} — ${p.error}.` +
|
|
(p.suppressed !== '0'
|
|
? pluralForm(p.suppressed, 'it', {
|
|
one: " Dall'ultima notifica è stato soppresso un altro errore.",
|
|
other: ` Dall'ultima notifica sono stati soppressi altri ${p.suppressed} errori.`,
|
|
})
|
|
: ''),
|
|
}),
|
|
paddle_region_requested: (p) => ({
|
|
title: 'Regione canoa richiesta',
|
|
body: `${p.actor} sta pianificando un giro in canoa in ${p.region}. Carica o rifiuta i suoi dati sull'acqua nell'area amministrazione, sotto Componenti.`,
|
|
}),
|
|
synology_session_cleared: () => ({
|
|
title: 'Sessione Synology rimossa',
|
|
body: 'Il tuo account o URL Synology è cambiato. Sei stato disconnesso da Synology Photos.',
|
|
}),
|
|
wanderer_source_hint: (p) => ({
|
|
title: `Sentiero wanderer: ${p.tour}`,
|
|
body:
|
|
p.state === 'changed'
|
|
? `«${p.tour}» in «${p.trip}» è stato modificato in wanderer. Apri il percorso e controlla la sua fonte per vedere tutte le modifiche. Nel viaggio non cambia nulla da solo.`
|
|
: p.state === 'unverifiable'
|
|
? `«${p.tour}» in «${p.trip}» non si può più controllare in wanderer. Il percorso nel tuo viaggio resta com'è.`
|
|
: `«${p.tour}» in «${p.trip}» potrebbe essere cambiato in wanderer. Apri il percorso e controlla la sua fonte per saperlo. Nel viaggio non cambia nulla da solo.`,
|
|
}),
|
|
plugin_notification: (p) => ({ title: p.title ?? '', body: p.body ?? '' }),
|
|
},
|
|
passwordReset: {
|
|
subject: 'Reimposta la tua password',
|
|
greeting: 'Ciao',
|
|
body: 'Abbiamo ricevuto una richiesta di reimpostazione della password per il tuo account TREK. Clicca il pulsante qui sotto per impostare una nuova password.',
|
|
ctaIntro: 'Reimposta password',
|
|
expiry: 'Questo link scade tra 60 minuti.',
|
|
ignore: 'Se non hai richiesto questa operazione, ignora questa email — la tua password non cambierà.',
|
|
},
|
|
};
|
|
|
|
export default it;
|