diff --git a/shared/src/i18n/ar/journey.ts b/shared/src/i18n/ar/journey.ts index 094978f0c..f124e4e86 100644 --- a/shared/src/i18n/ar/journey.ts +++ b/shared/src/i18n/ar/journey.ts @@ -997,5 +997,20 @@ const journey: TranslationStrings = { 'يمكن للمساعد رؤية الصفحة التي تعمل عليها. تُرسل هذه الصفحة وحدها إلى {provider} كصورة لا تظهر فيها إلا الصور التي أضفتها بنفسك. لا يمكن التعرّف على من يظهر في صورك.', 'journey.studio.assistant.noticeAllow': 'اعرض الصفحات', 'journey.studio.assistant.noticeLater': 'ليس الآن', + 'journey.fromPhotos.created': 'تم إنشاء {count} مسودة من صورك', + 'journey.fromPhotos.created.zero': 'لم تُنشأ أي مسودة من صورك', + 'journey.fromPhotos.created.one': 'تم إنشاء مسودة واحدة من صورك', + 'journey.fromPhotos.created.two': 'تم إنشاء مسودتين من صورك', + 'journey.fromPhotos.created.few': 'تم إنشاء {count} مسودات من صورك', + 'journey.fromPhotos.created.many': 'تم إنشاء {count} مسودة من صورك', + 'journey.fromPhotos.skipped': 'تم تخطي {count} صورة: إنها في تدوينة بالفعل أو لم تعد في المعرض.', + 'journey.fromPhotos.skipped.zero': 'لم يتم تخطي أي صورة.', + 'journey.fromPhotos.skipped.one': 'تم تخطي صورة واحدة: إنها في تدوينة بالفعل أو لم تعد في المعرض.', + 'journey.fromPhotos.skipped.two': 'تم تخطي صورتين: إنهما في تدوينة بالفعل أو لم تعودا في المعرض.', + 'journey.fromPhotos.skipped.few': 'تم تخطي {count} صور: إنها في تدوينة بالفعل أو لم تعد في المعرض.', + 'journey.fromPhotos.skipped.many': 'تم تخطي {count} صورة: إنها في تدوينة بالفعل أو لم تعد في المعرض.', + 'journey.fromPhotos.nothingCreated': 'لم يكن بالإمكان تحويل أي من هذه الصور إلى تدوينة. لم يُنشأ أي شيء.', + 'journey.fromPhotos.createFailed': 'لم تُنشأ أي تدوينات. لم يُحفظ أي شيء، حاول مرة أخرى.', + 'journey.fromPhotos.previewFailed': 'تعذّر تجميع الصور. حاول مرة أخرى.', }; export default journey; diff --git a/shared/src/i18n/az/journey.ts b/shared/src/i18n/az/journey.ts index 80b6bacce..7c05235c7 100644 --- a/shared/src/i18n/az/journey.ts +++ b/shared/src/i18n/az/journey.ts @@ -999,5 +999,12 @@ const journey: TranslationStrings = { 'Köməkçi üzərində işlədiyin səhifəyə baxa bilər. {provider} xidmətinə yalnız bu səhifə, yalnız özün əlavə etdiyin fotoların göründüyü şəkil kimi göndərilir. Fotolarında kimin olduğunu müəyyən etmək mümkün deyil.', 'journey.studio.assistant.noticeAllow': 'Səhifələri göstər', 'journey.studio.assistant.noticeLater': 'İndi yox', + 'journey.fromPhotos.created': 'Fotolarınızdan {count} qaralama yaradıldı', + 'journey.fromPhotos.created.one': 'Fotolarınızdan {count} qaralama yaradıldı', + 'journey.fromPhotos.skipped': '{count} foto kənarda qaldı: artıq bir qeyddədir və ya qalereyada yoxdur.', + 'journey.fromPhotos.skipped.one': '{count} foto kənarda qaldı: artıq bir qeyddədir və ya qalereyada yoxdur.', + 'journey.fromPhotos.nothingCreated': 'Bu fotolardan heç biri qeydə çevrilə bilmədi. Heç nə yaradılmadı.', + 'journey.fromPhotos.createFailed': 'Heç bir qeyd yaradılmadı. Heç nə saxlanmadı, yenidən cəhd edin.', + 'journey.fromPhotos.previewFailed': 'Fotoları qruplaşdırmaq mümkün olmadı. Yenidən cəhd edin.', }; export default journey; diff --git a/shared/src/i18n/br/journey.ts b/shared/src/i18n/br/journey.ts index c99bbda4a..80ec70796 100644 --- a/shared/src/i18n/br/journey.ts +++ b/shared/src/i18n/br/journey.ts @@ -931,5 +931,14 @@ const journey: TranslationStrings = { 'O assistente pode olhar a página em que você está trabalhando. Só essa página vai para {provider}, como uma imagem que mostra apenas as fotos que você mesmo adicionou. Não é possível detectar quem aparece nas suas fotos.', 'journey.studio.assistant.noticeAllow': 'Mostrar páginas', 'journey.studio.assistant.noticeLater': 'Agora não', + 'journey.fromPhotos.created': '{count} rascunhos criados a partir das suas fotos', + 'journey.fromPhotos.created.one': '{count} rascunho criado a partir das suas fotos', + 'journey.fromPhotos.skipped': + '{count} fotos foram deixadas de fora: já estão em uma entrada ou não estão mais na galeria.', + 'journey.fromPhotos.skipped.one': + '{count} foto foi deixada de fora: já está em uma entrada ou não está mais na galeria.', + 'journey.fromPhotos.nothingCreated': 'Nenhuma destas fotos pôde virar uma entrada. Nada foi criado.', + 'journey.fromPhotos.createFailed': 'Nenhuma entrada foi criada. Nada foi salvo, tente novamente.', + 'journey.fromPhotos.previewFailed': 'Não foi possível agrupar as fotos. Tente novamente.', }; export default journey; diff --git a/shared/src/i18n/ca/journey.ts b/shared/src/i18n/ca/journey.ts index 1626bf33c..c382e6cc7 100644 --- a/shared/src/i18n/ca/journey.ts +++ b/shared/src/i18n/ca/journey.ts @@ -932,5 +932,13 @@ const journey: TranslationStrings = { 'L’assistent pot mirar la pàgina en què treballes. Només aquesta pàgina s’envia a {provider}, com una imatge que mostra només les fotos que has afegit tu. No es pot detectar qui surt a les teves fotos.', 'journey.studio.assistant.noticeAllow': 'Mostra-li pàgines', 'journey.studio.assistant.noticeLater': 'Ara no', + 'journey.fromPhotos.created': '{count} esborranys creats a partir de les teves fotos', + 'journey.fromPhotos.created.one': '{count} esborrany creat a partir de les teves fotos', + 'journey.fromPhotos.skipped': '{count} fotos s’han omès: ja són en una entrada o ja no són a la galeria.', + 'journey.fromPhotos.skipped.one': '{count} foto s’ha omès: ja és en una entrada o ja no és a la galeria.', + 'journey.fromPhotos.nothingCreated': + 'Cap d’aquestes fotos no s’ha pogut convertir en una entrada. No s’ha creat res.', + 'journey.fromPhotos.createFailed': 'No s’ha creat cap entrada. No s’ha desat res, torna-ho a provar.', + 'journey.fromPhotos.previewFailed': 'No s’han pogut agrupar les fotos. Torna-ho a provar.', }; export default journey; diff --git a/shared/src/i18n/cs/journey.ts b/shared/src/i18n/cs/journey.ts index 8ffce4f00..589c057e9 100644 --- a/shared/src/i18n/cs/journey.ts +++ b/shared/src/i18n/cs/journey.ts @@ -942,5 +942,14 @@ const journey: TranslationStrings = { 'Asistent se může podívat na stránku, na které pracujete. Na {provider} jde jen tato stránka, jako obrázek, na kterém jsou jen fotky, které jste přidali sami. Kdo je na vašich fotkách, nelze rozpoznat.', 'journey.studio.assistant.noticeAllow': 'Ukázat stránky', 'journey.studio.assistant.noticeLater': 'Teď ne', + 'journey.fromPhotos.created': '{count} konceptů vytvořeno z vašich fotek', + 'journey.fromPhotos.created.one': '{count} koncept vytvořen z vašich fotek', + 'journey.fromPhotos.created.few': '{count} koncepty vytvořeny z vašich fotek', + 'journey.fromPhotos.skipped': '{count} fotek bylo vynecháno: už jsou u záznamu nebo už nejsou v galerii.', + 'journey.fromPhotos.skipped.one': '{count} fotka byla vynechána: už je u záznamu nebo už není v galerii.', + 'journey.fromPhotos.skipped.few': '{count} fotky byly vynechány: už jsou u záznamu nebo už nejsou v galerii.', + 'journey.fromPhotos.nothingCreated': 'Z žádné z těchto fotek nemohl vzniknout záznam. Nic nebylo vytvořeno.', + 'journey.fromPhotos.createFailed': 'Nebyly vytvořeny žádné záznamy. Nic se neuložilo, zkuste to znovu.', + 'journey.fromPhotos.previewFailed': 'Fotky se nepodařilo seskupit. Zkuste to znovu.', }; export default journey; diff --git a/shared/src/i18n/de/journey.ts b/shared/src/i18n/de/journey.ts index 72c6f9d0f..704695c4a 100644 --- a/shared/src/i18n/de/journey.ts +++ b/shared/src/i18n/de/journey.ts @@ -939,5 +939,15 @@ const journey: TranslationStrings = { 'Der Assistent kann sich die Seite ansehen, an der du arbeitest. Nur diese Seite geht an {provider}, als Bild, auf dem nur deine eigenen Fotos zu sehen sind. Wer auf deinen Fotos ist, lässt sich nicht erkennen.', 'journey.studio.assistant.noticeAllow': 'Seiten zeigen', 'journey.studio.assistant.noticeLater': 'Jetzt nicht', + 'journey.fromPhotos.created': '{count} Entwürfe aus deinen Fotos erstellt', + 'journey.fromPhotos.created.one': '{count} Entwurf aus deinen Fotos erstellt', + 'journey.fromPhotos.skipped': + '{count} Fotos wurden ausgelassen: Sie hängen schon an einem Eintrag oder sind nicht mehr in der Galerie.', + 'journey.fromPhotos.skipped.one': + '{count} Foto wurde ausgelassen: Es hängt schon an einem Eintrag oder ist nicht mehr in der Galerie.', + 'journey.fromPhotos.nothingCreated': 'Aus diesen Fotos konnte kein Eintrag werden. Es wurde nichts erstellt.', + 'journey.fromPhotos.createFailed': + 'Es wurden keine Einträge erstellt. Nichts wurde gespeichert, versuch es noch einmal.', + 'journey.fromPhotos.previewFailed': 'Die Fotos konnten nicht gruppiert werden. Versuch es noch einmal.', }; export default journey; diff --git a/shared/src/i18n/en/journey.ts b/shared/src/i18n/en/journey.ts index 1e3ba2c1a..cf8b644c4 100644 --- a/shared/src/i18n/en/journey.ts +++ b/shared/src/i18n/en/journey.ts @@ -918,5 +918,14 @@ const journey: TranslationStrings = { 'The assistant can look at the page you are working on. Only that page goes to {provider}, as a picture showing just the photos you added yourself. Who is in your photos cannot be detected.', 'journey.studio.assistant.noticeAllow': 'Show it pages', 'journey.studio.assistant.noticeLater': 'Not now', + 'journey.fromPhotos.created': '{count} draft entries created from your photos', + 'journey.fromPhotos.created.one': '{count} draft entry created from your photos', + 'journey.fromPhotos.skipped': + '{count} photos were left out: they are on an entry already or no longer in the gallery.', + 'journey.fromPhotos.skipped.one': + '{count} photo was left out: it is on an entry already or no longer in the gallery.', + 'journey.fromPhotos.nothingCreated': 'None of these photos could become an entry. Nothing was created.', + 'journey.fromPhotos.createFailed': 'No entries were created. Nothing was written, try again.', + 'journey.fromPhotos.previewFailed': 'The photos could not be grouped. Try again.', }; export default journey; diff --git a/shared/src/i18n/es/journey.ts b/shared/src/i18n/es/journey.ts index 731dcbcf0..9e00931c2 100644 --- a/shared/src/i18n/es/journey.ts +++ b/shared/src/i18n/es/journey.ts @@ -932,5 +932,12 @@ const journey: TranslationStrings = { 'El asistente puede ver la página en la que estás trabajando. Solo esa página se envía a {provider}, como una imagen que muestra únicamente las fotos que añadiste tú. No se puede detectar quién aparece en tus fotos.', 'journey.studio.assistant.noticeAllow': 'Mostrarle páginas', 'journey.studio.assistant.noticeLater': 'Ahora no', + 'journey.fromPhotos.created': '{count} borradores creados a partir de tus fotos', + 'journey.fromPhotos.created.one': '{count} borrador creado a partir de tus fotos', + 'journey.fromPhotos.skipped': '{count} fotos se omitieron: ya están en una entrada o ya no están en la galería.', + 'journey.fromPhotos.skipped.one': '{count} foto se omitió: ya está en una entrada o ya no está en la galería.', + 'journey.fromPhotos.nothingCreated': 'Ninguna de estas fotos pudo convertirse en una entrada. No se creó nada.', + 'journey.fromPhotos.createFailed': 'No se crearon entradas. No se guardó nada, inténtalo de nuevo.', + 'journey.fromPhotos.previewFailed': 'No se pudieron agrupar las fotos. Inténtalo de nuevo.', }; export default journey; diff --git a/shared/src/i18n/et/journey.ts b/shared/src/i18n/et/journey.ts index 2664b80b4..3f4ff148c 100644 --- a/shared/src/i18n/et/journey.ts +++ b/shared/src/i18n/et/journey.ts @@ -922,5 +922,14 @@ const journey: TranslationStrings = { 'Assistent saab vaadata lehte, mille kallal töötad. {provider} saab ainult selle lehe, pildina, millel on näha ainult sinu enda lisatud fotod. Seda, kes sinu fotodel on, ei saa tuvastada.', 'journey.studio.assistant.noticeAllow': 'Näita lehti', 'journey.studio.assistant.noticeLater': 'Mitte praegu', + 'journey.fromPhotos.created': '{count} mustandit loodud sinu fotodest', + 'journey.fromPhotos.created.one': '{count} mustand loodud sinu fotodest', + 'journey.fromPhotos.skipped': + '{count} fotot jäeti välja: need on juba mõne sissekande juures või pole enam galeriis.', + 'journey.fromPhotos.skipped.one': + '{count} foto jäeti välja: see on juba mõne sissekande juures või pole enam galeriis.', + 'journey.fromPhotos.nothingCreated': 'Ükski neist fotodest ei saanud sissekandeks. Midagi ei loodud.', + 'journey.fromPhotos.createFailed': 'Sissekandeid ei loodud. Midagi ei salvestatud, proovi uuesti.', + 'journey.fromPhotos.previewFailed': 'Fotosid ei õnnestunud rühmitada. Proovi uuesti.', }; export default journey; diff --git a/shared/src/i18n/fr/journey.ts b/shared/src/i18n/fr/journey.ts index 6a89b5204..9f9ae562f 100644 --- a/shared/src/i18n/fr/journey.ts +++ b/shared/src/i18n/fr/journey.ts @@ -931,5 +931,14 @@ const journey: TranslationStrings = { 'L’assistant peut regarder la page sur laquelle vous travaillez. Seule cette page est envoyée à {provider}, sous forme d’image ne montrant que les photos que vous avez ajoutées vous-même. Il est impossible de détecter qui figure sur vos photos.', 'journey.studio.assistant.noticeAllow': 'Lui montrer les pages', 'journey.studio.assistant.noticeLater': 'Pas maintenant', + 'journey.fromPhotos.created': '{count} brouillons créés à partir de vos photos', + 'journey.fromPhotos.created.one': '{count} brouillon créé à partir de vos photos', + 'journey.fromPhotos.skipped': + '{count} photos ont été ignorées : elles sont déjà dans une entrée ou ne sont plus dans la galerie.', + 'journey.fromPhotos.skipped.one': + '{count} photo a été ignorée : elle est déjà dans une entrée ou n’est plus dans la galerie.', + 'journey.fromPhotos.nothingCreated': 'Aucune de ces photos n’a pu devenir une entrée. Rien n’a été créé.', + 'journey.fromPhotos.createFailed': 'Aucune entrée n’a été créée. Rien n’a été enregistré, réessayez.', + 'journey.fromPhotos.previewFailed': 'Les photos n’ont pas pu être regroupées. Réessayez.', }; export default journey; diff --git a/shared/src/i18n/gr/journey.ts b/shared/src/i18n/gr/journey.ts index 8d728396f..df0fbb8df 100644 --- a/shared/src/i18n/gr/journey.ts +++ b/shared/src/i18n/gr/journey.ts @@ -943,5 +943,15 @@ const journey: TranslationStrings = { 'Ο βοηθός μπορεί να δει τη σελίδα στην οποία δουλεύετε. Μόνο αυτή η σελίδα στέλνεται στο {provider}, ως εικόνα που δείχνει μόνο τις φωτογραφίες που προσθέσατε εσείς. Δεν είναι δυνατό να αναγνωριστεί ποιος εμφανίζεται στις φωτογραφίες σας.', 'journey.studio.assistant.noticeAllow': 'Εμφάνιση σελίδων', 'journey.studio.assistant.noticeLater': 'Όχι τώρα', + 'journey.fromPhotos.created': '{count} πρόχειρα δημιουργήθηκαν από τις φωτογραφίες σας', + 'journey.fromPhotos.created.one': '{count} πρόχειρο δημιουργήθηκε από τις φωτογραφίες σας', + 'journey.fromPhotos.skipped': + '{count} φωτογραφίες παραλείφθηκαν: είναι ήδη σε καταχώριση ή δεν είναι πια στη συλλογή.', + 'journey.fromPhotos.skipped.one': + '{count} φωτογραφία παραλείφθηκε: είναι ήδη σε καταχώριση ή δεν είναι πια στη συλλογή.', + 'journey.fromPhotos.nothingCreated': + 'Καμία από αυτές τις φωτογραφίες δεν μπόρεσε να γίνει καταχώριση. Δεν δημιουργήθηκε τίποτα.', + 'journey.fromPhotos.createFailed': 'Δεν δημιουργήθηκαν καταχωρίσεις. Δεν αποθηκεύτηκε τίποτα, δοκιμάστε ξανά.', + 'journey.fromPhotos.previewFailed': 'Δεν ήταν δυνατή η ομαδοποίηση των φωτογραφιών. Δοκιμάστε ξανά.', }; export default journey; diff --git a/shared/src/i18n/he/journey.ts b/shared/src/i18n/he/journey.ts index ec6cd7a2f..b9293c397 100644 --- a/shared/src/i18n/he/journey.ts +++ b/shared/src/i18n/he/journey.ts @@ -929,6 +929,15 @@ const journey: TranslationStrings = { 'העוזר יכול לראות את העמוד שאתם עובדים עליו. רק העמוד הזה נשלח אל {provider}, כתמונה שמציגה רק את התמונות שהוספתם בעצמכם. אי אפשר לזהות מי מופיע בתמונות שלכם.', 'journey.studio.assistant.noticeAllow': 'אפשרו לעוזר לראות עמודים', 'journey.studio.assistant.noticeLater': 'לא עכשיו', + 'journey.fromPhotos.created': 'נוצרו {count} טיוטות מהתמונות שלך', + 'journey.fromPhotos.created.one': 'נוצרה טיוטה אחת מהתמונות שלך', + 'journey.fromPhotos.created.two': 'נוצרו {count} טיוטות מהתמונות שלך', + 'journey.fromPhotos.skipped': '{count} תמונות הושמטו: הן כבר ברשומה או שאינן עוד בגלריה.', + 'journey.fromPhotos.skipped.one': 'תמונה אחת הושמטה: היא כבר ברשומה או שאינה עוד בגלריה.', + 'journey.fromPhotos.skipped.two': '{count} תמונות הושמטו: הן כבר ברשומה או שאינן עוד בגלריה.', + 'journey.fromPhotos.nothingCreated': 'אף אחת מהתמונות האלה לא יכלה להפוך לרשומה. לא נוצר דבר.', + 'journey.fromPhotos.createFailed': 'לא נוצרו רשומות. דבר לא נשמר, נסו שוב.', + 'journey.fromPhotos.previewFailed': 'לא ניתן היה לקבץ את התמונות. נסו שוב.', }; export default journey; diff --git a/shared/src/i18n/hu/journey.ts b/shared/src/i18n/hu/journey.ts index 5af7676f8..c85a705fe 100644 --- a/shared/src/i18n/hu/journey.ts +++ b/shared/src/i18n/hu/journey.ts @@ -928,5 +928,14 @@ const journey: TranslationStrings = { 'Az asszisztens megnézheti az oldalt, amelyen dolgozol. Csak ez az oldal kerül a(z) {provider} szolgáltatóhoz, képként, amelyen csak a saját magad által hozzáadott fotók látszanak. Azt, hogy ki szerepel a fotóidon, nem lehet felismerni.', 'journey.studio.assistant.noticeAllow': 'Oldalak megmutatása', 'journey.studio.assistant.noticeLater': 'Most nem', + 'journey.fromPhotos.created': '{count} piszkozat készült a fotóidból', + 'journey.fromPhotos.created.one': '{count} piszkozat készült a fotóidból', + 'journey.fromPhotos.skipped': '{count} fotó kimaradt: már egy bejegyzéshez tartozik, vagy már nincs a galériában.', + 'journey.fromPhotos.skipped.one': + '{count} fotó kimaradt: már egy bejegyzéshez tartozik, vagy már nincs a galériában.', + 'journey.fromPhotos.nothingCreated': + 'Ezek közül a fotók közül egyikből sem lehetett bejegyzés. Semmi sem jött létre.', + 'journey.fromPhotos.createFailed': 'Nem jött létre bejegyzés. Semmi sem mentődött, próbáld újra.', + 'journey.fromPhotos.previewFailed': 'A fotókat nem sikerült csoportosítani. Próbáld újra.', }; export default journey; diff --git a/shared/src/i18n/id/journey.ts b/shared/src/i18n/id/journey.ts index 873d1fa23..f2a7a56ae 100644 --- a/shared/src/i18n/id/journey.ts +++ b/shared/src/i18n/id/journey.ts @@ -905,5 +905,10 @@ const journey: TranslationStrings = { 'Asisten dapat melihat halaman yang sedang Anda kerjakan. Hanya halaman itu yang dikirim ke {provider}, sebagai gambar yang hanya menampilkan foto yang Anda tambahkan sendiri. Siapa yang ada di foto Anda tidak dapat dideteksi.', 'journey.studio.assistant.noticeAllow': 'Tunjukkan halaman', 'journey.studio.assistant.noticeLater': 'Nanti saja', + 'journey.fromPhotos.created': '{count} draf dibuat dari foto Anda', + 'journey.fromPhotos.skipped': '{count} foto dilewati: sudah ada di sebuah entri atau tidak lagi ada di galeri.', + 'journey.fromPhotos.nothingCreated': 'Tidak ada foto ini yang bisa menjadi entri. Tidak ada yang dibuat.', + 'journey.fromPhotos.createFailed': 'Tidak ada entri yang dibuat. Tidak ada yang disimpan, coba lagi.', + 'journey.fromPhotos.previewFailed': 'Foto tidak dapat dikelompokkan. Coba lagi.', }; export default journey; diff --git a/shared/src/i18n/it/journey.ts b/shared/src/i18n/it/journey.ts index cc8edef61..fa631d9f5 100644 --- a/shared/src/i18n/it/journey.ts +++ b/shared/src/i18n/it/journey.ts @@ -931,5 +931,12 @@ const journey: TranslationStrings = { 'L’assistente può guardare la pagina su cui stai lavorando. Solo quella pagina viene inviata a {provider}, come immagine che mostra soltanto le foto che hai aggiunto tu. Non è possibile riconoscere chi compare nelle tue foto.', 'journey.studio.assistant.noticeAllow': 'Mostra le pagine', 'journey.studio.assistant.noticeLater': 'Non ora', + 'journey.fromPhotos.created': '{count} bozze create dalle tue foto', + 'journey.fromPhotos.created.one': '{count} bozza creata dalle tue foto', + 'journey.fromPhotos.skipped': '{count} foto sono state escluse: sono già in una voce o non sono più nella galleria.', + 'journey.fromPhotos.skipped.one': '{count} foto è stata esclusa: è già in una voce o non è più nella galleria.', + 'journey.fromPhotos.nothingCreated': 'Nessuna di queste foto è potuta diventare una voce. Non è stato creato nulla.', + 'journey.fromPhotos.createFailed': 'Nessuna voce creata. Non è stato salvato nulla, riprova.', + 'journey.fromPhotos.previewFailed': 'Non è stato possibile raggruppare le foto. Riprova.', }; export default journey; diff --git a/shared/src/i18n/ja/journey.ts b/shared/src/i18n/ja/journey.ts index 3c7b44df3..c11985202 100644 --- a/shared/src/i18n/ja/journey.ts +++ b/shared/src/i18n/ja/journey.ts @@ -891,5 +891,11 @@ const journey: TranslationStrings = { 'アシスタントは作業中のページを見ることができます。{provider} に送られるのはそのページだけで、あなた自身が追加した写真だけが写った画像として送られます。写真に誰が写っているかは判別できません。', 'journey.studio.assistant.noticeAllow': 'ページを見せる', 'journey.studio.assistant.noticeLater': '今はしない', + 'journey.fromPhotos.created': '写真から下書きを {count} 件作成しました', + 'journey.fromPhotos.skipped': '{count} 枚の写真は除外されました。すでにエントリーにあるか、ギャラリーにありません。', + 'journey.fromPhotos.nothingCreated': 'これらの写真からはエントリーを作成できませんでした。何も作成されていません。', + 'journey.fromPhotos.createFailed': + 'エントリーは作成されませんでした。何も保存されていません。もう一度お試しください。', + 'journey.fromPhotos.previewFailed': '写真をグループ分けできませんでした。もう一度お試しください。', }; export default journey; diff --git a/shared/src/i18n/ko/journey.ts b/shared/src/i18n/ko/journey.ts index 01f79e87a..8b0e6abd7 100644 --- a/shared/src/i18n/ko/journey.ts +++ b/shared/src/i18n/ko/journey.ts @@ -885,5 +885,10 @@ const journey: TranslationStrings = { '어시스턴트가 작업 중인 페이지를 볼 수 있습니다. {provider}(으)로는 그 페이지만, 직접 추가한 사진만 보이는 이미지로 전송됩니다. 사진에 누가 있는지는 감지할 수 없습니다.', 'journey.studio.assistant.noticeAllow': '페이지 보여주기', 'journey.studio.assistant.noticeLater': '나중에', + 'journey.fromPhotos.created': '사진으로 초안 {count}개를 만들었습니다', + 'journey.fromPhotos.skipped': '사진 {count}장은 제외되었습니다. 이미 기록에 있거나 더 이상 갤러리에 없습니다.', + 'journey.fromPhotos.nothingCreated': '이 사진들로는 기록을 만들 수 없었습니다. 아무것도 만들어지지 않았습니다.', + 'journey.fromPhotos.createFailed': '기록이 만들어지지 않았습니다. 아무것도 저장되지 않았으니 다시 시도하세요.', + 'journey.fromPhotos.previewFailed': '사진을 묶을 수 없었습니다. 다시 시도하세요.', }; export default journey; diff --git a/shared/src/i18n/nl/journey.ts b/shared/src/i18n/nl/journey.ts index 43c8d7814..86b9e8a5e 100644 --- a/shared/src/i18n/nl/journey.ts +++ b/shared/src/i18n/nl/journey.ts @@ -933,5 +933,14 @@ const journey: TranslationStrings = { 'De assistent kan de pagina bekijken waaraan je werkt. Alleen die pagina gaat naar {provider}, als afbeelding met alleen de foto’s die je zelf hebt toegevoegd. Wie er op je foto’s staat, kan niet worden herkend.', 'journey.studio.assistant.noticeAllow': 'Pagina’s tonen', 'journey.studio.assistant.noticeLater': 'Niet nu', + 'journey.fromPhotos.created': '{count} concepten gemaakt van je foto’s', + 'journey.fromPhotos.created.one': '{count} concept gemaakt van je foto’s', + 'journey.fromPhotos.skipped': + '{count} foto’s zijn overgeslagen: ze staan al bij een bericht of zijn niet meer in de galerij.', + 'journey.fromPhotos.skipped.one': + '{count} foto is overgeslagen: hij staat al bij een bericht of is niet meer in de galerij.', + 'journey.fromPhotos.nothingCreated': 'Geen van deze foto’s kon een bericht worden. Er is niets gemaakt.', + 'journey.fromPhotos.createFailed': 'Er zijn geen berichten gemaakt. Er is niets opgeslagen, probeer het opnieuw.', + 'journey.fromPhotos.previewFailed': 'De foto’s konden niet worden gegroepeerd. Probeer het opnieuw.', }; export default journey; diff --git a/shared/src/i18n/pl/journey.ts b/shared/src/i18n/pl/journey.ts index a1ab77ca9..b31b57617 100644 --- a/shared/src/i18n/pl/journey.ts +++ b/shared/src/i18n/pl/journey.ts @@ -974,5 +974,16 @@ const journey: TranslationStrings = { 'Asystent może zobaczyć stronę, nad którą pracujesz. Do {provider} trafia tylko ta strona, jako obraz pokazujący wyłącznie zdjęcia dodane przez ciebie. Nie da się rozpoznać, kto jest na twoich zdjęciach.', 'journey.studio.assistant.noticeAllow': 'Pokaż strony', 'journey.studio.assistant.noticeLater': 'Nie teraz', + 'journey.fromPhotos.created': 'Utworzono {count} szkicu z twoich zdjęć', + 'journey.fromPhotos.created.one': 'Utworzono {count} szkic z twoich zdjęć', + 'journey.fromPhotos.created.few': 'Utworzono {count} szkice z twoich zdjęć', + 'journey.fromPhotos.created.many': 'Utworzono {count} szkiców z twoich zdjęć', + 'journey.fromPhotos.skipped': 'Pominięto {count} zdjęcia: są już przy wpisie albo nie ma ich już w galerii.', + 'journey.fromPhotos.skipped.one': 'Pominięto {count} zdjęcie: jest już przy wpisie albo nie ma go już w galerii.', + 'journey.fromPhotos.skipped.few': 'Pominięto {count} zdjęcia: są już przy wpisie albo nie ma ich już w galerii.', + 'journey.fromPhotos.skipped.many': 'Pominięto {count} zdjęć: są już przy wpisie albo nie ma ich już w galerii.', + 'journey.fromPhotos.nothingCreated': 'Z żadnego z tych zdjęć nie mógł powstać wpis. Nic nie utworzono.', + 'journey.fromPhotos.createFailed': 'Nie utworzono żadnych wpisów. Nic nie zapisano, spróbuj ponownie.', + 'journey.fromPhotos.previewFailed': 'Nie udało się pogrupować zdjęć. Spróbuj ponownie.', }; export default journey; diff --git a/shared/src/i18n/ru/journey.ts b/shared/src/i18n/ru/journey.ts index 4a5c112c7..e67173bef 100644 --- a/shared/src/i18n/ru/journey.ts +++ b/shared/src/i18n/ru/journey.ts @@ -974,5 +974,16 @@ const journey: TranslationStrings = { 'Ассистент может посмотреть страницу, над которой вы работаете. В {provider} отправляется только эта страница, в виде изображения, на котором видны лишь фото, добавленные вами. Определить, кто изображён на ваших фото, невозможно.', 'journey.studio.assistant.noticeAllow': 'Показывать страницы', 'journey.studio.assistant.noticeLater': 'Не сейчас', + 'journey.fromPhotos.created': 'Создано {count} черновика из ваших фото', + 'journey.fromPhotos.created.one': 'Создан {count} черновик из ваших фото', + 'journey.fromPhotos.created.few': 'Создано {count} черновика из ваших фото', + 'journey.fromPhotos.created.many': 'Создано {count} черновиков из ваших фото', + 'journey.fromPhotos.skipped': 'Пропущено {count} фото: они уже в записи или больше не в галерее.', + 'journey.fromPhotos.skipped.one': 'Пропущено {count} фото: оно уже в записи или больше не в галерее.', + 'journey.fromPhotos.skipped.few': 'Пропущено {count} фото: они уже в записи или больше не в галерее.', + 'journey.fromPhotos.skipped.many': 'Пропущено {count} фото: они уже в записи или больше не в галерее.', + 'journey.fromPhotos.nothingCreated': 'Ни одно из этих фото не стало записью. Ничего не создано.', + 'journey.fromPhotos.createFailed': 'Записи не созданы. Ничего не сохранено, попробуйте ещё раз.', + 'journey.fromPhotos.previewFailed': 'Не удалось сгруппировать фото. Попробуйте ещё раз.', }; export default journey; diff --git a/shared/src/i18n/sk/journey.ts b/shared/src/i18n/sk/journey.ts index ae22d1b9a..0815ed0d6 100644 --- a/shared/src/i18n/sk/journey.ts +++ b/shared/src/i18n/sk/journey.ts @@ -947,5 +947,14 @@ const journey: TranslationStrings = { 'Asistent sa môže pozrieť na stranu, na ktorej pracujete. Do {provider} ide iba táto strana, ako obrázok, na ktorom sú len fotky, ktoré ste pridali sami. Kto je na vašich fotkách, sa nedá rozpoznať.', 'journey.studio.assistant.noticeAllow': 'Ukázať strany', 'journey.studio.assistant.noticeLater': 'Teraz nie', + 'journey.fromPhotos.created': '{count} konceptov vytvorených z vašich fotiek', + 'journey.fromPhotos.created.one': '{count} koncept vytvorený z vašich fotiek', + 'journey.fromPhotos.created.few': '{count} koncepty vytvorené z vašich fotiek', + 'journey.fromPhotos.skipped': '{count} fotiek bolo vynechaných: už sú pri zázname alebo už nie sú v galérii.', + 'journey.fromPhotos.skipped.one': '{count} fotka bola vynechaná: už je pri zázname alebo už nie je v galérii.', + 'journey.fromPhotos.skipped.few': '{count} fotky boli vynechané: už sú pri zázname alebo už nie sú v galérii.', + 'journey.fromPhotos.nothingCreated': 'Zo žiadnej z týchto fotiek nemohol vzniknúť záznam. Nič nebolo vytvorené.', + 'journey.fromPhotos.createFailed': 'Neboli vytvorené žiadne záznamy. Nič sa neuložilo, skúste to znova.', + 'journey.fromPhotos.previewFailed': 'Fotky sa nepodarilo zoskupiť. Skúste to znova.', }; export default journey; diff --git a/shared/src/i18n/sv/journey.ts b/shared/src/i18n/sv/journey.ts index 6d2fd2d6c..8b4b88d5a 100644 --- a/shared/src/i18n/sv/journey.ts +++ b/shared/src/i18n/sv/journey.ts @@ -922,5 +922,14 @@ const journey: TranslationStrings = { 'Assistenten kan titta på sidan du arbetar med. Bara den sidan skickas till {provider}, som en bild som bara visar foton du själv har lagt till. Vem som finns på dina foton går inte att upptäcka.', 'journey.studio.assistant.noticeAllow': 'Visa sidor', 'journey.studio.assistant.noticeLater': 'Inte nu', + 'journey.fromPhotos.created': '{count} utkast skapade från dina foton', + 'journey.fromPhotos.created.one': '{count} utkast skapat från dina foton', + 'journey.fromPhotos.skipped': + '{count} foton hoppades över: de finns redan i ett inlägg eller finns inte längre i galleriet.', + 'journey.fromPhotos.skipped.one': + '{count} foto hoppades över: det finns redan i ett inlägg eller finns inte längre i galleriet.', + 'journey.fromPhotos.nothingCreated': 'Inget av dessa foton kunde bli ett inlägg. Inget skapades.', + 'journey.fromPhotos.createFailed': 'Inga inlägg skapades. Inget sparades, försök igen.', + 'journey.fromPhotos.previewFailed': 'Fotona kunde inte grupperas. Försök igen.', }; export default journey; diff --git a/shared/src/i18n/th/journey.ts b/shared/src/i18n/th/journey.ts index b3cee2073..dfdf7d7cc 100644 --- a/shared/src/i18n/th/journey.ts +++ b/shared/src/i18n/th/journey.ts @@ -864,5 +864,10 @@ const journey: TranslationStrings = { 'ผู้ช่วยสามารถดูหน้าที่คุณกำลังทำอยู่ได้ มีเพียงหน้านั้นที่ส่งไปยัง {provider} ในรูปแบบภาพที่แสดงเฉพาะรูปภาพที่คุณเพิ่มเอง ไม่สามารถตรวจจับได้ว่าใครอยู่ในรูปภาพของคุณ', 'journey.studio.assistant.noticeAllow': 'แสดงหน้าให้ดู', 'journey.studio.assistant.noticeLater': 'ไว้ทีหลัง', + 'journey.fromPhotos.created': 'สร้างฉบับร่าง {count} รายการจากรูปภาพของคุณแล้ว', + 'journey.fromPhotos.skipped': 'ข้ามรูปภาพ {count} รูป เพราะอยู่ในบันทึกแล้วหรือไม่อยู่ในแกลเลอรีแล้ว', + 'journey.fromPhotos.nothingCreated': 'ไม่มีรูปภาพใดในชุดนี้ที่สร้างเป็นบันทึกได้ ไม่ได้สร้างอะไรเลย', + 'journey.fromPhotos.createFailed': 'ไม่ได้สร้างบันทึกใด ๆ และไม่มีอะไรถูกบันทึก ลองอีกครั้ง', + 'journey.fromPhotos.previewFailed': 'จัดกลุ่มรูปภาพไม่สำเร็จ ลองอีกครั้ง', }; export default journey; diff --git a/shared/src/i18n/tr/journey.ts b/shared/src/i18n/tr/journey.ts index 069ac8682..0d834735f 100644 --- a/shared/src/i18n/tr/journey.ts +++ b/shared/src/i18n/tr/journey.ts @@ -923,5 +923,13 @@ const journey: TranslationStrings = { 'Asistan üzerinde çalıştığın sayfaya bakabilir. {provider} hizmetine yalnızca bu sayfa, sadece kendi eklediğin fotoğrafları gösteren bir görüntü olarak gider. Fotoğraflarında kimin olduğu tespit edilemez.', 'journey.studio.assistant.noticeAllow': 'Sayfaları göster', 'journey.studio.assistant.noticeLater': 'Şimdi değil', + 'journey.fromPhotos.created': 'Fotoğraflarınızdan {count} taslak oluşturuldu', + 'journey.fromPhotos.created.one': 'Fotoğraflarınızdan {count} taslak oluşturuldu', + 'journey.fromPhotos.skipped': '{count} fotoğraf dışarıda bırakıldı: zaten bir kayıtta ya da artık galeride değil.', + 'journey.fromPhotos.skipped.one': + '{count} fotoğraf dışarıda bırakıldı: zaten bir kayıtta ya da artık galeride değil.', + 'journey.fromPhotos.nothingCreated': 'Bu fotoğrafların hiçbiri kayda dönüştürülemedi. Hiçbir şey oluşturulmadı.', + 'journey.fromPhotos.createFailed': 'Hiç kayıt oluşturulmadı. Hiçbir şey kaydedilmedi, tekrar deneyin.', + 'journey.fromPhotos.previewFailed': 'Fotoğraflar gruplanamadı. Tekrar deneyin.', }; export default journey; diff --git a/shared/src/i18n/uk/journey.ts b/shared/src/i18n/uk/journey.ts index 7f48de47f..a43768670 100644 --- a/shared/src/i18n/uk/journey.ts +++ b/shared/src/i18n/uk/journey.ts @@ -980,5 +980,16 @@ const journey: TranslationStrings = { 'Асистент може переглянути сторінку, над якою ви працюєте. До {provider} надсилається лише ця сторінка, як зображення, на якому видно тільки фото, додані вами. Визначити, хто є на ваших фото, неможливо.', 'journey.studio.assistant.noticeAllow': 'Показувати сторінки', 'journey.studio.assistant.noticeLater': 'Не зараз', + 'journey.fromPhotos.created': 'Створено {count} чернетки з ваших фото', + 'journey.fromPhotos.created.one': 'Створено {count} чернетку з ваших фото', + 'journey.fromPhotos.created.few': 'Створено {count} чернетки з ваших фото', + 'journey.fromPhotos.created.many': 'Створено {count} чернеток з ваших фото', + 'journey.fromPhotos.skipped': 'Пропущено {count} фото: вони вже в записі або їх більше немає в галереї.', + 'journey.fromPhotos.skipped.one': 'Пропущено {count} фото: воно вже в записі або його більше немає в галереї.', + 'journey.fromPhotos.skipped.few': 'Пропущено {count} фото: вони вже в записі або їх більше немає в галереї.', + 'journey.fromPhotos.skipped.many': 'Пропущено {count} фото: вони вже в записі або їх більше немає в галереї.', + 'journey.fromPhotos.nothingCreated': 'Жодне з цих фото не стало записом. Нічого не створено.', + 'journey.fromPhotos.createFailed': 'Записи не створено. Нічого не збережено, спробуйте ще раз.', + 'journey.fromPhotos.previewFailed': 'Не вдалося згрупувати фото. Спробуйте ще раз.', }; export default journey; diff --git a/shared/src/i18n/vi/journey.ts b/shared/src/i18n/vi/journey.ts index e1e6b46f5..850483177 100644 --- a/shared/src/i18n/vi/journey.ts +++ b/shared/src/i18n/vi/journey.ts @@ -899,5 +899,10 @@ const journey: TranslationStrings = { 'Trợ lý có thể xem trang bạn đang làm. Chỉ trang đó được gửi tới {provider}, dưới dạng ảnh chỉ hiển thị những ảnh do chính bạn thêm vào. Không thể nhận biết ai có trong ảnh của bạn.', 'journey.studio.assistant.noticeAllow': 'Cho xem trang', 'journey.studio.assistant.noticeLater': 'Để sau', + 'journey.fromPhotos.created': 'Đã tạo {count} bản nháp từ ảnh của bạn', + 'journey.fromPhotos.skipped': 'Đã bỏ qua {count} ảnh: ảnh đã nằm trong một mục hoặc không còn trong thư viện.', + 'journey.fromPhotos.nothingCreated': 'Không ảnh nào trong số này có thể trở thành một mục. Không có gì được tạo.', + 'journey.fromPhotos.createFailed': 'Không có mục nào được tạo. Chưa lưu gì cả, hãy thử lại.', + 'journey.fromPhotos.previewFailed': 'Không thể nhóm ảnh. Hãy thử lại.', }; export default journey; diff --git a/shared/src/i18n/zh-TW/journey.ts b/shared/src/i18n/zh-TW/journey.ts index 260221760..bbc0a76af 100644 --- a/shared/src/i18n/zh-TW/journey.ts +++ b/shared/src/i18n/zh-TW/journey.ts @@ -864,5 +864,10 @@ const journey: TranslationStrings = { '助理可以查看你正在編輯的頁面。只有這一頁會以圖片形式傳送給 {provider},圖片中只顯示你自己新增的照片。無法辨識照片中的人物是誰。', 'journey.studio.assistant.noticeAllow': '允許查看頁面', 'journey.studio.assistant.noticeLater': '暫不', + 'journey.fromPhotos.created': '已根據你的照片建立 {count} 篇草稿', + 'journey.fromPhotos.skipped': '已略過 {count} 張照片:它們已在某則紀錄中,或已不在相簿中。', + 'journey.fromPhotos.nothingCreated': '這些照片都無法建立紀錄,未建立任何內容。', + 'journey.fromPhotos.createFailed': '未建立任何紀錄。沒有儲存任何內容,請再試一次。', + 'journey.fromPhotos.previewFailed': '無法為照片分組,請再試一次。', }; export default journey; diff --git a/shared/src/i18n/zh/journey.ts b/shared/src/i18n/zh/journey.ts index c4de8899c..05182b546 100644 --- a/shared/src/i18n/zh/journey.ts +++ b/shared/src/i18n/zh/journey.ts @@ -864,5 +864,10 @@ const journey: TranslationStrings = { '助手可以查看你正在编辑的页面。只有这一页会以图片形式发送给 {provider},图片中只显示你自己添加的照片。无法识别照片中的人物是谁。', 'journey.studio.assistant.noticeAllow': '允许查看页面', 'journey.studio.assistant.noticeLater': '暂不', + 'journey.fromPhotos.created': '已根据你的照片创建 {count} 篇草稿', + 'journey.fromPhotos.skipped': '已跳过 {count} 张照片:它们已在某条记录中,或已不在相册中。', + 'journey.fromPhotos.nothingCreated': '这些照片都无法生成记录,未创建任何内容。', + 'journey.fromPhotos.createFailed': '未创建任何记录。没有保存任何内容,请重试。', + 'journey.fromPhotos.previewFailed': '无法为照片分组,请重试。', }; export default journey; diff --git a/shared/src/index.ts b/shared/src/index.ts index 10663c1ca..100802fc6 100644 --- a/shared/src/index.ts +++ b/shared/src/index.ts @@ -146,6 +146,7 @@ export * from './file/file.schema'; export * from './journey/journey.schema'; export * from './journey/journey-recordings.schema'; export * from './journey/journey-day-import.schema'; +export * from './journey/journey-entries-from-photos.schema'; export * from './journey/journey-recording-prep.schema'; export * from './journey/journey-map.schema'; export * from './journey/journey-public.schema'; diff --git a/shared/src/journey/journey-entries-from-photos.schema.spec.ts b/shared/src/journey/journey-entries-from-photos.schema.spec.ts new file mode 100644 index 000000000..64bbea752 --- /dev/null +++ b/shared/src/journey/journey-entries-from-photos.schema.spec.ts @@ -0,0 +1,97 @@ +import { + isKnownTimeZone, + journeyEntriesFromPhotosCreateRequestSchema, + journeyEntriesFromPhotosCreateResponseSchema, + journeyEntriesFromPhotosPreviewRequestSchema, + journeyEntriesFromPhotosPreviewResponseSchema, + JOURNEY_FROM_PHOTOS_MAX_GROUPS, +} from './journey-entries-from-photos.schema'; + +import { describe, expect, it } from 'vitest'; + +describe('journey entries from photos contracts', () => { + it('JRNPHOTOS-SCHEMA-001: a preview takes nothing, or a zone, thresholds and a language', () => { + expect(journeyEntriesFromPhotosPreviewRequestSchema.safeParse({}).success).toBe(true); + const parsed = journeyEntriesFromPhotosPreviewRequestSchema.safeParse({ + timezone: ' Europe/Rome ', + maxGapMinutes: 90, + maxDistanceKm: 2.5, + lang: 'pt-BR', + }); + expect(parsed.success).toBe(true); + expect(parsed.data?.timezone).toBe('Europe/Rome'); + }); + + it('JRNPHOTOS-SCHEMA-002: refuses an unknown zone, thresholds out of range, a fractional gap and unknown keys', () => { + const refused = (body: unknown) => journeyEntriesFromPhotosPreviewRequestSchema.safeParse(body).success; + expect(refused({ timezone: 'Mars/Olympus' })).toBe(false); + expect(refused({ maxGapMinutes: 5 })).toBe(false); + expect(refused({ maxGapMinutes: 90.5 })).toBe(false); + expect(refused({ maxDistanceKm: 0 })).toBe(false); + expect(refused({ maxDistanceKm: 501 })).toBe(false); + expect(refused({ lang: 'not a tag' })).toBe(false); + expect(refused({ extra: true })).toBe(false); + }); + + it('JRNPHOTOS-SCHEMA-003: a create takes groups of photo ids with an optional title and place name', () => { + const parsed = journeyEntriesFromPhotosCreateRequestSchema.safeParse({ + groups: [ + { photoIds: [1, 2], title: ' Rialto ', locationName: 'Venezia' }, + { photoIds: [3], locationName: null }, + ], + }); + expect(parsed.success).toBe(true); + expect(parsed.data?.groups[0]?.title).toBe('Rialto'); + }); + + it('JRNPHOTOS-SCHEMA-004: refuses no groups, an empty group, a blank title, an id that is no id and too many groups', () => { + const refused = (body: unknown) => journeyEntriesFromPhotosCreateRequestSchema.safeParse(body).success; + expect(refused({ groups: [] })).toBe(false); + expect(refused({ groups: [{ photoIds: [] }] })).toBe(false); + expect(refused({ groups: [{ photoIds: [1], title: ' ' }] })).toBe(false); + expect(refused({ groups: [{ photoIds: ['1'] }] })).toBe(false); + expect(refused({ groups: [{ photoIds: [1.5] }] })).toBe(false); + expect(refused({ groups: [{ photoIds: [1], cover: 1 }] })).toBe(false); + const many = Array.from({ length: JOURNEY_FROM_PHOTOS_MAX_GROUPS + 1 }, (_, i) => ({ photoIds: [i + 1] })); + expect(refused({ groups: many })).toBe(false); + }); + + it('JRNPHOTOS-SCHEMA-005: the answers describe a group and the written drafts', () => { + expect( + journeyEntriesFromPhotosPreviewResponseSchema.safeParse({ + clusters: [ + { + date: '2026-05-14', + startTime: '09:10', + endTime: '11:40', + timezone: 'Europe/Rome', + lat: 45.43, + lng: 12.33, + countryCode: 'IT', + locationName: 'Venezia', + suggestedTitle: 'Venezia', + titleSource: 'place', + photoIds: [4, 5], + photoCount: 2, + coverPhotoId: 4, + }, + ], + withoutCaptureTime: 1, + maxGapMinutes: 180, + maxDistanceKm: 20, + }).success, + ).toBe(true); + expect( + journeyEntriesFromPhotosCreateResponseSchema.safeParse({ + entries: [{ id: 9, title: 'Venezia', entry_date: '2026-05-14', entry_time: '09:10', photoCount: 2 }], + skippedPhotoIds: [6], + }).success, + ).toBe(true); + }); + + it('JRNPHOTOS-SCHEMA-006: knows a zone the runtime knows', () => { + expect(isKnownTimeZone('UTC')).toBe(true); + expect(isKnownTimeZone('America/Los_Angeles')).toBe(true); + expect(isKnownTimeZone('Nowhere/City')).toBe(false); + }); +}); diff --git a/shared/src/journey/journey-entries-from-photos.schema.ts b/shared/src/journey/journey-entries-from-photos.schema.ts new file mode 100644 index 000000000..26a7d1808 --- /dev/null +++ b/shared/src/journey/journey-entries-from-photos.schema.ts @@ -0,0 +1,151 @@ +import { idSchema } from '../common/primitives.schema'; + +import { z } from 'zod'; + +/** + * Draft entries made from the photos of a journey's gallery (#1920). + * + * The preview groups the gallery photos that sit on no entry yet and know + * when they were taken: by local day first, then, inside a day, wherever the + * time between two photos or the distance between two geotagged ones is + * larger than the thresholds. Nothing is written by it. The traveller keeps + * the groups they want, may rename them, and the create call writes one draft + * entry per group with its photos, in one transaction. A photo that was put + * on an entry in the meantime is left out, so nothing ends up twice, and no + * entry that existed before is changed. + * + * The local day: TREK keeps no time zone on a journey or a trip, so the day + * of a photo is read in the offset its capture time carries when it carries + * one (`+02:00`), else in the zone of the place it was taken (its own + * position), else in the zone of the journey's geotagged photo nearest in + * time, else in `timezone` (the device's zone the client sends), else UTC. + */ + +/** Two photos further apart in time than this start a new group, unless the request says otherwise. */ +export const JOURNEY_FROM_PHOTOS_DEFAULT_GAP_MINUTES = 180; +/** Two geotagged photos further apart than this start a new group, unless the request says otherwise. */ +export const JOURNEY_FROM_PHOTOS_DEFAULT_DISTANCE_KM = 20; +/** The most groups one create call takes. */ +export const JOURNEY_FROM_PHOTOS_MAX_GROUPS = 200; +/** The most photos one group of a create call takes. */ +export const JOURNEY_FROM_PHOTOS_MAX_PHOTOS_PER_GROUP = 1000; + +/** Whether the runtime knows this IANA zone name ('Europe/Rome', 'UTC'). */ +export function isKnownTimeZone(zone: string): boolean { + try { + new Intl.DateTimeFormat('en-US', { timeZone: zone }); + return true; + } catch { + return false; + } +} + +/** An IANA zone name the runtime knows. */ +export const journeyFromPhotosTimeZoneSchema = z + .string() + .trim() + .min(1) + .max(64) + .refine(isKnownTimeZone, 'Unknown time zone'); + +/** A language tag for the place names ('de', 'pt-BR'). */ +const placeLanguageSchema = z + .string() + .trim() + .regex(/^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})?$/, 'Not a language tag'); + +/** What both calls share: how the local day of a photo is read. */ +const zoneFields = { + /** The zone a photo's day is read in when neither the photo nor the journey's other photos name one. */ + timezone: journeyFromPhotosTimeZoneSchema.optional(), +}; + +/** POST /api/journeys/:id/entries/from-photos/preview */ +export const journeyEntriesFromPhotosPreviewRequestSchema = z.strictObject({ + ...zoneFields, + /** Minutes between two photos of a day that start a new group (15 to 1440). */ + maxGapMinutes: z.number().int().min(15).max(1440).optional(), + /** Kilometres between two geotagged photos of a day that start a new group (0.1 to 500). */ + maxDistanceKm: z.number().min(0.1).max(500).optional(), + /** The language the suggested titles and place names are asked for in. */ + lang: placeLanguageSchema.optional(), +}); +export type JourneyEntriesFromPhotosPreviewRequest = z.infer; + +/** Where a group's suggested title came from: a place name, the country it lies in, or only its day. */ +export const JOURNEY_FROM_PHOTOS_TITLE_SOURCES = ['place', 'country', 'date'] as const; + +export const journeyEntriesFromPhotosClusterSchema = z.object({ + /** The local day of its first photo, `YYYY-MM-DD`. */ + date: z.string(), + /** Its first and last photo on the clock of that day, `HH:MM`. */ + startTime: z.string(), + endTime: z.string(), + /** The zone the day was read in: an IANA name, or `UTC+02:00` for an offset the photo carried. */ + timezone: z.string(), + /** The middle of its geotagged photos; null when none of them has a position. */ + lat: z.number().nullable(), + lng: z.number().nullable(), + /** ISO 3166-1 alpha-2 of the middle, when it falls in a country. */ + countryCode: z.string().nullable(), + /** The place name found for the middle, or null. */ + locationName: z.string().nullable(), + suggestedTitle: z.string(), + titleSource: z.enum(JOURNEY_FROM_PHOTOS_TITLE_SOURCES), + /** The gallery photo ids (journey photo ids), in the order they were taken. */ + photoIds: z.array(idSchema), + photoCount: z.number(), + /** The gallery photo id to show for it: its first picture, a clip only when it holds nothing else. */ + coverPhotoId: idSchema, +}); +export type JourneyEntriesFromPhotosCluster = z.infer; + +export const journeyEntriesFromPhotosPreviewResponseSchema = z.object({ + /** In the order they were lived. */ + clusters: z.array(journeyEntriesFromPhotosClusterSchema), + /** Gallery photos on no entry that do not know when they were taken, and so belong to no group. */ + withoutCaptureTime: z.number(), + /** The thresholds the groups were cut with. */ + maxGapMinutes: z.number(), + maxDistanceKm: z.number(), +}); +export type JourneyEntriesFromPhotosPreviewResponse = z.infer; + +export const journeyEntriesFromPhotosGroupSchema = z.strictObject({ + /** The gallery photos (journey photo ids) that become one entry. */ + photoIds: z.array(idSchema).min(1).max(JOURNEY_FROM_PHOTOS_MAX_PHOTOS_PER_GROUP), + /** The entry's title, as the traveller left it; the group's own suggestion without place name when left out. */ + title: z.string().trim().min(1).max(255).optional(), + /** The place name the entry is pinned under, as the preview found it or the traveller wrote it. */ + locationName: z.string().trim().max(255).nullable().optional(), +}); +export type JourneyEntriesFromPhotosGroup = z.infer; + +/** POST /api/journeys/:id/entries/from-photos */ +export const journeyEntriesFromPhotosCreateRequestSchema = z.strictObject({ + ...zoneFields, + groups: z.array(journeyEntriesFromPhotosGroupSchema).min(1).max(JOURNEY_FROM_PHOTOS_MAX_GROUPS), + /** The language a title left out is written in. */ + lang: placeLanguageSchema.optional(), +}); +export type JourneyEntriesFromPhotosCreateRequest = z.infer; + +export const journeyEntriesFromPhotosCreateResponseSchema = z.object({ + /** The draft entries written, in the order of the groups that made them. */ + entries: z.array( + z.object({ + id: idSchema, + title: z.string().nullable(), + entry_date: z.string(), + entry_time: z.string().nullable(), + photoCount: z.number(), + }), + ), + /** + * Photos asked for that were not written: already on an entry (put there in + * the meantime), named twice, not in this journey's gallery or without a + * capture time. A group left with none of its photos writes no entry. + */ + skippedPhotoIds: z.array(idSchema), +}); +export type JourneyEntriesFromPhotosCreateResponse = z.infer;