mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-02 17:26:24 +00:00
bee500880e
Finishes the plural work the previous wip commit started. t() picks a count string's form by the language's own Intl.PluralRules, and every locale now spells out the forms its language reaches with whole numbers, about 160 count strings in all: one, few and many in Russian, Ukrainian and Polish, one and few in Czech and Slovak, five forms in Arabic, one in the others, none in Japanese, Korean, Chinese, Thai, Vietnamese and Indonesian. Each language was translated and then reviewed on its own. English no longer reads "1 files", "1 updates available" or "photo(s)". Count labels shown next to a number now take that number too: the atlas and admin statistics, the trip cards, journey and shared trip pills, packing templates, receipts, storage usage, the Studio export note. A heading that shared its key with a counted label keeps a key of its own (the boarding pass heading, the Bookings tab), so languages that put a noun after a number in the singular keep a plural heading. The plugin hosts chip passed its count through .replace() after t() and never got a form; three toasts sent the count as text. Mail and push texts for shared photos and suppressed storage failures pick their form in code through pluralForm. A whole number sent as text counts too, which is how in-app notification params arrive, and the plural rule follows the language of the strings on screen while another one still loads. The parity check knows which forms each language needs and refuses missing and impossible ones. It also reads keys that contain a colon now: it skipped them, which hid 58 missing plugin permission texts in Catalan and 35 in Vietnamese, both translated. The client parity test covers every language of the registry instead of a hand-kept list of 19, and the placeholder spec lets a form spell its number out only where its category is that one number. Brazilian Portuguese error screens were in Breton, and an Arabic dashboard label held Hebrew text.
84 lines
3.4 KiB
TypeScript
84 lines
3.4 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.`,
|
|
})
|
|
: ''),
|
|
}),
|
|
synology_session_cleared: () => ({
|
|
title: 'Sessione Synology rimossa',
|
|
body: 'Il tuo account o URL Synology è cambiato. Sei stato disconnesso da Synology Photos.',
|
|
}),
|
|
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;
|