diff --git a/_locales/bg/messages.json b/_locales/bg/messages.json index 70b3549f..7e70cdfc 100644 --- a/_locales/bg/messages.json +++ b/_locales/bg/messages.json @@ -199,5 +199,23 @@ }, "prefs_google_gemini_thinking_budget": { "message": "Бюджет за мислене" + }, + "prefs_OptionText_auto_summary": { + "message": "Показване на автоматично AI резюме за прегледи на съобщения" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "Ако е отметнато, ThunderAI автоматично ще генерира и показва AI резюмета над е-пощта, когато те бъдат отворени. Имайте предвид, че това означава, че всички съобщения, които преглеждате, ще бъдат незабавно изпратени до конфигурираната AI услуга." + }, + "auto_summary_title": { + "message": "ThunderAI Резюме" + }, + "auto_summary_generating": { + "message": "Генериране на AI резюме..." + }, + "auto_summary_failed": { + "message": "Неуспешно генериране на AI резюме. Моля, потвърдете настройките си и опитайте отново." + }, + "auto_summary_prompt": { + "message": "Моля, предоставете кратко резюме на следващото съобщение. Резюмето трябва да бъде максимум 3-5 изречения и да обхваща основните точки:\n\n" } -} + } diff --git a/_locales/cs/messages.json b/_locales/cs/messages.json index d0b12318..3586bea0 100644 --- a/_locales/cs/messages.json +++ b/_locales/cs/messages.json @@ -1166,5 +1166,23 @@ }, "prefs_OptionText_get_calendar_event_Sparks_wrong_version": { "message": "Pro používání funkcí událostí v kalendáři a úloh, nainstalujte aktualizovanou verzi doplňku ThunderAI Sparks." + }, + "prefs_OptionText_auto_summary": { + "message": "Povolit automatické AI shrnutí pro náhledy zpráv" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "Pokud je zaškrtnuto, ThunderAI automaticky vygeneruje a zobrazí AI shrnutí nad e-mailovými zprávami, když jsou otevřeny. Mějte na paměti, že to znamená, že všechny zprávy, které si prohlížíte, budou okamžitě odeslány do nakonfigurované AI služby." + }, + "auto_summary_title": { + "message": "ThunderAI Souhrn" + }, + "auto_summary_generating": { + "message": "Generování AI souhrnu..." + }, + "auto_summary_failed": { + "message": "Nepodařilo se vygenerovat AI souhrn. Zkontrolujte prosím nastavení a zkuste to znovu." + }, + "auto_summary_prompt": { + "message": "Poskytněte stručný souhrn následující e-mailové zprávy. Souhrn by měl obsahovat maximálně 3-5 vět a zachytit hlavní body:\n\n" } } diff --git a/_locales/de/messages.json b/_locales/de/messages.json index 9930d5ac..2a5ec296 100644 --- a/_locales/de/messages.json +++ b/_locales/de/messages.json @@ -1312,6 +1312,24 @@ "Optional_Permission_Denied_Model_Fetching": { "message": "Sie haben die optionale Berechtigung verweigert, die zum Abrufen der Modelle für diese Integration erforderlich ist." }, + "prefs_OptionText_auto_summary": { + "message": "Automatische KI-Zusammenfassung für Nachrichten-Vorschau aktivieren" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "Wenn aktiviert, wird ThunderAI automatisch KI-Zusammenfassungen über E-Mail-Nachrichten generieren und anzeigen, wenn sie geöffnet werden. Beachten Sie, dass dies bedeutet, dass alle Nachrichten, die Sie in der Vorschau anzeigen, sofort an den konfigurierten KI-Dienst gesendet werden." + }, + "auto_summary_title": { + "message": "ThunderAI Zusammenfassung" + }, + "auto_summary_generating": { + "message": "KI-Zusammenfassung wird generiert..." + }, + "auto_summary_failed": { + "message": "Fehler beim Generieren der KI-Zusammenfassung. Bitte überprüfen Sie Ihre Einstellungen und versuchen Sie es erneut." + }, + "auto_summary_prompt": { + "message": "Bitte geben Sie eine prägnante Zusammenfassung der folgenden E-Mail-Nachricht. Die Zusammenfassung sollte maximal 3-5 Sätze umfassen und die Hauptpunkte erfassen:\n\n" + }, "prompt_string": { "message": "Prompt" }, diff --git a/_locales/el/messages.json b/_locales/el/messages.json index 16a60884..974568f2 100644 --- a/_locales/el/messages.json +++ b/_locales/el/messages.json @@ -1278,7 +1278,25 @@ "Optional_Permission_Denied_Model_Fetching": { "message": "Έχετε αρνηθεί την προαιρετική άδεια που απαιτείται για την τοποθέτηση μοντέλων για αυτήν την ενσωμάτωση." }, + "prefs_OptionText_auto_summary": { + "message": "Ενεργοποίηση αυτόματου AI περιλήψεων για προεπισκόπηση μηνυμάτων" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "Εάν είναι επιλεγμένο, το ThunderAI θα δημιουργεί και θα εμφανίζει αυτόματα AI περιλήψεις πάνω από τα μηνύματα ηλεκτρονικού ταχυδρομείου όταν ανοίγουν. Σημειώστε ότι αυτό σημαίνει ότι όλα τα μηνύματα που προεπισκοπείτε θα σταλούν αμέσως στην υπηρεσία AI που έχετε διαμορφώσει." + }, + "auto_summary_title": { + "message": "Περίληψη ThunderAI" + }, + "auto_summary_generating": { + "message": "Δημιουργία AI περίληψης..." + }, + "auto_summary_failed": { + "message": "Αποτυχία δημιουργίας AI περίληψης. Παρακαλώ ελέγξτε τις ρυθμίσεις σας και προσπαθήστε ξανά." + }, + "auto_summary_prompt": { + "message": "Παρακαλώ παρέχετε μια σύντομη περίληψη του ακόλουθου μηνύματος ηλεκτρονικού ταχυδρομείου. Η περίληψη θα πρέπει να είναι το πολύ 3-5 προτάσεις και να καταγράφει τα κύρια σημεία:\n\n" + }, "reset": { "message": "Επαναφορά" } -} + } diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 1e8b9cac..4a7e3984 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1736,5 +1736,23 @@ "Optional_Permission_Denied_Model_Fetching": { "message": "You have denied the optional permission needed to fetch models for this integration.", "description": "" + }, + "prefs_OptionText_auto_summary": { + "message": "Enable automatic AI summarization for message previews" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "If checked, ThunderAI will automatically generate and display AI summaries above email messages when they are opened. Note that this means all messages you preview will immediately be sent to the configured AI service." + }, + "auto_summary_title": { + "message": "ThunderAI Summary" + }, + "auto_summary_generating": { + "message": "Generating AI summary..." + }, + "auto_summary_failed": { + "message": "Failed to generate AI summary. Please confirm your settings and try again." + }, + "auto_summary_prompt": { + "message": "Please provide a concise summary of the following email message. The summary should be 3-5 sentences maximum and capture the main points:\n\n" } } diff --git a/_locales/eo/messages.json b/_locales/eo/messages.json index 07eeb95f..036ad476 100644 --- a/_locales/eo/messages.json +++ b/_locales/eo/messages.json @@ -172,5 +172,23 @@ }, "customPrompts_substitute_text": { "message": "Anstataŭigi tekston" + }, + "prefs_OptionText_auto_summary": { + "message": "Aŭtomata AI resumo por mesaĝaj antaŭrigardoj" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "Se markita, ThunderAI aŭtomate generos kaj montros AI resumojn super retpoŝtaj mesaĝoj kiam ili estas malfermitaj. Bonvolu noti ke tio signifas ke ĉiuj mesaĝoj kiun vi antaŭrigardas estos tuj senditaj al la agordita AI servo." + }, + "auto_summary_title": { + "message": "ThunderAI Resumo" + }, + "auto_summary_generating": { + "message": "Generante AI resumon..." + }, + "auto_summary_failed": { + "message": "Malsukcesis generi AI resumon. Bonvolu kontroli viajn agordojn kaj reprovu." + }, + "auto_summary_prompt": { + "message": "Bonvolu provizi koncizan resumon de la sekva retpoŝta mesaĝo. La resumo devus esti maksimume 3-5 frazoj kaj kapti la ĉefajn punktojn:\n\n" } } diff --git a/_locales/es/messages.json b/_locales/es/messages.json index 2980618d..17d756ec 100644 --- a/_locales/es/messages.json +++ b/_locales/es/messages.json @@ -1302,6 +1302,24 @@ "Anthropic_System_Prompt": { "message": "Prompt del sistema" }, + "prefs_OptionText_auto_summary": { + "message": "Habilitar resumen automático de IA para vistas previas de mensajes" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "Si está marcado, ThunderAI generará y mostrará automáticamente resúmenes de IA sobre los mensajes de correo electrónico cuando se abran. Tenga en cuenta que esto significa que todos los mensajes que previsualice se enviarán inmediatamente al servicio de IA configurado." + }, + "auto_summary_title": { + "message": "Resumen de ThunderAI" + }, + "auto_summary_generating": { + "message": "Generando resumen de IA..." + }, + "auto_summary_failed": { + "message": "Error al generar el resumen de IA. Verifica tu configuración e inténtalo de nuevo." + }, + "auto_summary_prompt": { + "message": "Proporciona un resumen conciso del siguiente mensaje de correo electrónico. El resumen debe tener un máximo de 3-5 oraciones y capturar los puntos principales:\n\n" + }, "reset": { "message": "Reiniciar" } diff --git a/_locales/fr/messages.json b/_locales/fr/messages.json index e8081aab..f33054d7 100644 --- a/_locales/fr/messages.json +++ b/_locales/fr/messages.json @@ -1336,6 +1336,24 @@ "prefs_anthropic_temperature_Info": { "message": "Degré d'aléa injecté dans la réponse. La valeur par défaut est 1,0. La plage de valeurs s'étend di 0,0 à 1,0. Utilisez une température proche de 0,0 pour des tâches analytiques ou des choix multiples, et proche de 1,0 pour des tâches créatives et génératives. Notez que même avec une température de 0,0, les résultats ne seront pas totalement déterministes." }, + "prefs_OptionText_auto_summary": { + "message": "Activer le résumé automatique par IA pour les aperçus de messages" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "Si coché, ThunderAI générera et affichera automatiquement des résumés par IA au-dessus des messages lorsque vous les ouvrirez. Notez que cela signifie que tous les messages que vous prévisualisez seront immédiatement envoyés au service IA configuré." + }, + "auto_summary_title": { + "message": "Résumé ThunderAI" + }, + "auto_summary_generating": { + "message": "Génération du résumé IA..." + }, + "auto_summary_failed": { + "message": "Échec de la génération du résumé IA. Veuillez vérifier vos paramètres et réessayer." + }, + "auto_summary_prompt": { + "message": "Veuillez fournir un résumé concis du message suivant. Le résumé doit comporter au maximum 3 à 5 phrases et capturer les points principaux :\n\n" + }, "reset": { "message": "Réinitialiser" } diff --git a/_locales/hr/messages.json b/_locales/hr/messages.json index 2b67fc51..eda8e3a1 100644 --- a/_locales/hr/messages.json +++ b/_locales/hr/messages.json @@ -854,5 +854,23 @@ }, "prefs_OptionText_openai_comp_info_remote": { "message": "Ovdje možete unijeti i adresu udaljenog poslužitelja." + }, + "prefs_OptionText_auto_summary": { + "message": "Omogući automatsko AI sažimanje za pregled poruka" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "Ako je označeno, ThunderAI će automatski generirati i prikazivati AI sažetke iznad e-poruka kada se otvore. Imajte na umu da će to značiti da će sve poruke koje pregledavate biti odmah poslane na konfiguriranu AI uslugu." + }, + "auto_summary_title": { + "message": "ThunderAI Sažetak" + }, + "auto_summary_generating": { + "message": "Generiranje AI sažetka..." + }, + "auto_summary_failed": { + "message": "Neuspjelo generiranje AI sažetka. Molimo provjerite svoje postavke i pokušajte ponovno." + }, + "auto_summary_prompt": { + "message": "Molimo pružite sažetak sljedeće e-poruke. Sažetak bi trebao biti maksimalno 3-5 rečenica i sadržavati glavne točke:\n\n" } -} + } diff --git a/_locales/hu/messages.json b/_locales/hu/messages.json index 62e99942..9c05d5ce 100644 --- a/_locales/hu/messages.json +++ b/_locales/hu/messages.json @@ -13,5 +13,23 @@ }, "prompt_rewrite_formal": { "message": "Újraírás formálisan" + }, + "prefs_OptionText_auto_summary": { + "message": "Automatikus AI összefoglaló engedélyezése az üzenetelőnézetekhez" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "Ha be van jelölve, a ThunderAI automatikusan generál és megjelenít AI összefoglalókat az e-mail üzenetek felett, amikor megnyitják őket. Vegye figyelembe, hogy ez azt jelenti, hogy az összes üzenet, amelyet előnézetben megtekint, azonnal elküldésre kerül a konfigurált AI szolgáltatáshoz." + }, + "auto_summary_title": { + "message": "ThunderAI Összefoglaló" + }, + "auto_summary_generating": { + "message": "AI összefoglaló generálása..." + }, + "auto_summary_failed": { + "message": "Nem sikerült generálni az AI összefoglalót. Kérjük, ellenőrizze a beállításait, és próbálja újra." + }, + "auto_summary_prompt": { + "message": "Kérjük, adjon egy rövid összefoglalót a következő e-mail üzenetről. Az összefoglaló maximum 3-5 mondatból állhat, és tartalmazza a fő pontokat:\n\n" } -} + } diff --git a/_locales/it/messages.json b/_locales/it/messages.json index 69840ade..01ba7654 100644 --- a/_locales/it/messages.json +++ b/_locales/it/messages.json @@ -1315,6 +1315,26 @@ "Optional_Permission_Denied_Model_Fetching": { "message": "Hai negato l’autorizzazione necessaria per recuperare i modelli per questa integrazione." }, + "prefs_OptionText_auto_summary": { + "message": "Abilita il riassunto automatico AI per le anteprime dei messaggi", + "description": "" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "Se abilitata, ThunderAI genererà e mostrerà automaticamente i riassunti AI sopra le email quando vengono aperte. Nota che questo significa che tutte le email che visualizzi in anteprima verranno immediatamente inviate al servizio AI configurato.", + "description": "" + }, + "auto_summary_title": { + "message": "Riassunto ThunderAI" + }, + "auto_summary_generating": { + "message": "Generazione del riassunto AI..." + }, + "auto_summary_failed": { + "message": "Impossibile generare il riassunto AI. Verificare le impostazioni e riprovare." + }, + "auto_summary_prompt": { + "message": "Fornire un riassunto conciso del seguente messaggio email. Il riassunto dovrebbe essere di massimo 3-5 frasi e catturare i punti principali:\n\n" + }, "prompt_string": { "message": "Prompt" }, diff --git a/_locales/pl/messages.json b/_locales/pl/messages.json index 0b7b90c1..88650f76 100644 --- a/_locales/pl/messages.json +++ b/_locales/pl/messages.json @@ -908,5 +908,11 @@ }, "placeholder_selected_html": { "message": "Zaznaczony HTML" + }, + "prefs_OptionText_auto_summary": { + "message": "Włącz automatyczne podsumowanie AI dla podglądów wiadomości" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "Jeśli zaznaczone, ThunderAI automatycznie wygeneruje i wyświetli podsumowania AI nad wiadomościami e-mail, gdy zostaną otwarte. Pamiętaj, że oznacza to, że wszystkie wiadomości, które przeglądasz, zostaną natychmiast wysłane do skonfigurowanej usługi AI." } } diff --git a/_locales/pt-br/messages.json b/_locales/pt-br/messages.json index d9941262..a27d6a8c 100644 --- a/_locales/pt-br/messages.json +++ b/_locales/pt-br/messages.json @@ -854,5 +854,23 @@ }, "SpamFilter_PageTitle": { "message": "Gerenciar configurações do filtro de spam" + }, + "prefs_OptionText_auto_summary": { + "message": "Mostrar resumo automático na visualização de mensagens" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "Se marcado, um resumo gerado por IA será exibido automaticamente acima das mensagens na visualização." + }, + "auto_summary_title": { + "message": "Resumo ThunderAI" + }, + "auto_summary_generating": { + "message": "Gerando resumo de IA..." + }, + "auto_summary_failed": { + "message": "Falha ao gerar o resumo de IA. Verifique suas configurações e tente novamente." + }, + "auto_summary_prompt": { + "message": "Forneça um resumo conciso da seguinte mensagem de e-mail. O resumo deve ter no máximo 3-5 frases e capturar os pontos principais:\n\n" } } diff --git a/_locales/pt/messages.json b/_locales/pt/messages.json index f6656907..dfbe2fdf 100644 --- a/_locales/pt/messages.json +++ b/_locales/pt/messages.json @@ -172,5 +172,23 @@ }, "chatgpt_win_send": { "message": "Enviar" + }, + "prefs_OptionText_auto_summary": { + "message": "Ativar resumo automático de IA para pré-visualizações de mensagens" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "Se ativado, o ThunderAI gerará e mostrará automaticamente resumos de IA acima das mensagens de e-mail quando forem abertas. Note que isso significa que todas as mensagens que você visualizar serão enviadas imediatamente para o serviço de IA configurado." + }, + "auto_summary_title": { + "message": "Resumo ThunderAI" + }, + "auto_summary_generating": { + "message": "Gerando resumo de IA..." + }, + "auto_summary_failed": { + "message": "Falha ao gerar o resumo de IA. Verifique suas configurações e tente novamente." + }, + "auto_summary_prompt": { + "message": "Forneça um resumo conciso da seguinte mensagem de e-mail. O resumo deve ter no máximo 3-5 frases e capturar os pontos principais:\n\n" } } diff --git a/_locales/ro/messages.json b/_locales/ro/messages.json index dbecf17f..f98b7f55 100644 --- a/_locales/ro/messages.json +++ b/_locales/ro/messages.json @@ -229,5 +229,23 @@ }, "prefsInfoDesc_1": { "message": "S-ar putea ca interfața web ChatGPT să se modifice într-un mod care să perturbe funcționarea addon-ului. Verificați pagina \"Starea serviciului\" accesibilă prin legătura din partea de jos a acestei pagini. De asemenea, rețineți că prima dată când utilizați ThunderAI, trebuie să vă conectați la ChatGPT." + }, + "prefs_OptionText_auto_summary": { + "message": "Activează rezumatul automat AI pentru previzualizările mesajelor" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "Dacă este bifată, ThunderAI va genera și afișa automat rezumate AI deasupra mesajelor de e-mail atunci când sunt deschise. Rețineți că acest lucru înseamnă că toate mesajele pe care le previzualizați vor fi trimise imediat către serviciul AI configurat." + }, + "auto_summary_title": { + "message": "Rezumat ThunderAI" + }, + "auto_summary_generating": { + "message": "Generare rezumat AI..." + }, + "auto_summary_failed": { + "message": "Nu s-a putut genera rezumatul AI. Vă rugăm să verificați setările și să încercați din nou." + }, + "auto_summary_prompt": { + "message": "Vă rugăm să furnizați un rezumat concis al următorului mesaj de e-mail. Rezumatul ar trebui să aibă maximum 3-5 propoziții și să cuprindă punctele principale:\n\n" } -} + } diff --git a/_locales/ru/messages.json b/_locales/ru/messages.json index 3b17cff4..6f93f42b 100644 --- a/_locales/ru/messages.json +++ b/_locales/ru/messages.json @@ -1223,5 +1223,23 @@ }, "OpenAIComp_ClearModelsList_Confirm": { "message": "Вы уверены, что хотите очистить список моделей? Это действие не может быть отменено." + }, + "prefs_OptionText_auto_summary": { + "message": "Показывать автоматическое резюме в просмотре сообщений" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "Если отмечено, резюме, сгенерированное ИИ, будет автоматически отображаться над сообщениями в просмотре." + }, + "auto_summary_title": { + "message": "ThunderAI Резюме" + }, + "auto_summary_generating": { + "message": "Генерация AI резюме..." + }, + "auto_summary_failed": { + "message": "Не удалось сгенерировать AI резюме. Пожалуйста, проверьте настройки и попробуйте снова." + }, + "auto_summary_prompt": { + "message": "Пожалуйста, предоставьте краткое резюме следующего сообщения электронной почты. Резюме должно содержать максимум 3-5 предложений и отражать основные моменты:\n\n" } } diff --git a/_locales/sk/messages.json b/_locales/sk/messages.json index 0967ef42..b076c05d 100644 --- a/_locales/sk/messages.json +++ b/_locales/sk/messages.json @@ -1 +1,20 @@ -{} +{ + "prefs_OptionText_auto_summary": { + "message": "Povoliť automatické AI zhrnutie pre náhľady správ" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "Ak je zaškrtnuté, ThunderAI automaticky vygeneruje a zobrazí AI zhrnutia nad e-mailovými správami, keď sú otvorené. Mějte na pamäti, že to znamená, že všetky správy, ktoré si prezeráte, budú okamžite odoslané do nakonfigurovanej AI služby." + }, + "auto_summary_title": { + "message": "Zhrnutie ThunderAI" + }, + "auto_summary_generating": { + "message": "Generovanie AI zhrnutia..." + }, + "auto_summary_failed": { + "message": "Zlyhanie generovania AI zhrnutia. Skontrolujte svoje nastavenia a skúste to znova." + }, + "auto_summary_prompt": { + "message": "Poskytnite stručné zhrnutie nasledujúcej e-mailovej správy. Zhrnutie by malo mať maximálne 3-5 viet a zachytiť hlavné body:\n\n" + } +} diff --git a/_locales/sv/messages.json b/_locales/sv/messages.json index c9e95c21..62a270e6 100644 --- a/_locales/sv/messages.json +++ b/_locales/sv/messages.json @@ -68,6 +68,24 @@ "prefs_OptionText_chatgpt_win_width": { "message": "Bredd" }, + "prefs_OptionText_auto_summary": { + "message": "Aktivera automatisk AI-sammanfattning för meddelandeförhandsvisningar" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "Om markerad kommer ThunderAI att generera och visa AI-sammanfattningar ovanför e-postmeddelanden när de öppnas. Observera att detta innebär att alla meddelanden du förhandsgranskar kommer att skickas omedelbart till den konfigurerade AI-tjänsten." + }, + "auto_summary_title": { + "message": "ThunderAI Sammanfattning" + }, + "auto_summary_generating": { + "message": "Genererar AI-sammanfattning..." + }, + "auto_summary_failed": { + "message": "Misslyckades med att generera AI-sammanfattning. Kontrollera dina inställningar och försök igen." + }, + "auto_summary_prompt": { + "message": "Ge en koncis sammanfattning av följande e-postmeddelande. Sammanfattningen bör vara max 3-5 meningar och fånga huvudpunkterna:\n\n" + }, "prompt_summarize_this": { "message": "Sammanfatta detta" }, diff --git a/_locales/zh_Hans/messages.json b/_locales/zh_Hans/messages.json index ccbdaa63..9f5aa903 100644 --- a/_locales/zh_Hans/messages.json +++ b/_locales/zh_Hans/messages.json @@ -919,5 +919,23 @@ }, "customPrompts_form_label_use_diff_viewer_title": { "message": "当操作设置为“替换文本”时,可以选择差异查看器。" + }, + "prefs_OptionText_auto_summary": { + "message": "在消息预览中显示自动摘要" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "如果选中,AI生成的摘要将自动显示在消息预览上方。" + }, + "auto_summary_title": { + "message": "ThunderAI 摘要" + }, + "auto_summary_generating": { + "message": "正在生成AI摘要..." + }, + "auto_summary_failed": { + "message": "生成AI摘要失败。请确认您的设置并重试。" + }, + "auto_summary_prompt": { + "message": "请提供以下电子邮件消息的简明摘要。摘要应最多包含3-5个句子,并捕捉主要要点:\n\n" } } diff --git a/_locales/zh_Hant/messages.json b/_locales/zh_Hant/messages.json index 22158154..59e2dfbc 100644 --- a/_locales/zh_Hant/messages.json +++ b/_locales/zh_Hant/messages.json @@ -1241,5 +1241,23 @@ }, "OpenAIComp_ClearModelsList_Confirm": { "message": "確定要清除模型清單嗎?這個動作無法復原。" + }, + "prefs_OptionText_auto_summary": { + "message": "啟用郵件預覽的自動 AI 摘要" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "如果勾選,ThunderAI 將自動生成並顯示 AI 摘要在電子郵件訊息上方。請注意,這意味著您預覽的所有訊息將立即被發送到已配置的 AI 服務。" + }, + "auto_summary_title": { + "message": "ThunderAI 摘要" + }, + "auto_summary_generating": { + "message": "正在產生 AI 摘要..." + }, + "auto_summary_failed": { + "message": "產生 AI 摘要失敗。請確認您的設定並重試。" + }, + "auto_summary_prompt": { + "message": "請提供以下電子郵件訊息的簡明摘要。摘要應最多包含3-5個句子,並捕捉主要要點:\n\n" } } diff --git a/messageDisplay/message-content-script.js b/messageDisplay/message-content-script.js new file mode 100644 index 00000000..7bb92c3d --- /dev/null +++ b/messageDisplay/message-content-script.js @@ -0,0 +1,107 @@ +async function showSummaryPane() { + // Check if auto-summary is enabled in user preferences + const result = await browser.storage.sync.get('auto_summary_enabled'); + + // If auto-summary is disabled or not set, don't show anything + if (!result.auto_summary_enabled) { + return; + } + + // Create the summary pane element + const summaryPane = document.createElement("div"); + summaryPane.className = "thunderai-summary-pane"; + + // Create the title element + const summaryTitle = document.createElement("div"); + summaryTitle.className = "thunderai-summary-title"; + summaryTitle.innerText = browser.i18n.getMessage("auto_summary_title"); + + // Create a loading indicator + const loadingIndicator = document.createElement("div"); + loadingIndicator.className = "thunderai-summary-content"; + loadingIndicator.innerText = browser.i18n.getMessage("auto_summary_generating"); + + // Create the content element (initially hidden) + const summaryContent = document.createElement("div"); + summaryContent.className = "thunderai-summary-content"; + summaryContent.style.display = 'none'; + + // Add title and loading indicator to the pane + summaryPane.appendChild(summaryTitle); + summaryPane.appendChild(loadingIndicator); + summaryPane.appendChild(summaryContent); + + // Insert it as the very first element in the message + document.body.insertBefore(summaryPane, document.body.firstChild); + + // Get the message content and generate summary + try { + const messageContent = getMessageContent(); + const aiSummary = await generateAISummary(messageContent); + + // Update the UI with the AI summary + loadingIndicator.style.display = 'none'; + summaryContent.innerText = aiSummary; + summaryContent.style.display = 'block'; + } catch (error) { + console.error("Error generating AI summary:", error); + loadingIndicator.innerText = browser.i18n.getMessage("auto_summary_failed"); + loadingIndicator.style.color = '#d70022'; + + } +} + +function getMessageContent() { + // Get the main message content from the page + // This selects the main message body content + const messageBody = document.querySelector('.moz-text-flowed, .moz-text-plain, body'); + if (messageBody) { + return messageBody.textContent || messageBody.innerText || ''; + } + + // Fallback: get the entire body content + return document.body.textContent || document.body.innerText || ''; +} + +function truncateMessageContent(content) { + // Clean up the content by removing excessive whitespace and newlines + const cleanedContent = content.replace(/\s+/g, ' ').trim(); + + // Truncate to a reasonable length for preview + const maxLength = 500; + if (cleanedContent.length <= maxLength) { + return cleanedContent; + } + + return cleanedContent.substring(0, maxLength) + '...'; +} + +async function generateAISummary(messageContent) { + // Clean up the message content + const cleanedContent = messageContent.replace(/\s+/g, ' ').trim(); + + // Create a simple summary prompt using localized string + const summaryPrompt = browser.i18n.getMessage("auto_summary_prompt") + cleanedContent; + + // Request AI summary from the background script + return new Promise((resolve, reject) => { + // Send message to background script to get AI summary + browser.runtime.sendMessage({ + command: "generate_summary", + content: cleanedContent, + prompt: summaryPrompt + }, (response) => { + if (response && response.summary) { + resolve(response.summary); + } else if (response && response.error) { + // Use the localized error message + reject(new Error(browser.i18n.getMessage("auto_summary_failed"))); + } else { + reject(new Error(browser.i18n.getMessage("auto_summary_failed"))); + } + }); + }); +} + +// Call the function to show the pane +showSummaryPane(); \ No newline at end of file diff --git a/messageDisplay/message-content-styles.css b/messageDisplay/message-content-styles.css new file mode 100644 index 00000000..6a4019c8 --- /dev/null +++ b/messageDisplay/message-content-styles.css @@ -0,0 +1,20 @@ +.thunderai-summary-pane { + background-color: #f0f0f0; + color: #333; + font-weight: 400; + padding: 0.5rem; + margin-bottom: 1rem; + border-radius: 4px; + border: 1px solid #ddd; +} + +.thunderai-summary-title { + font-weight: bold; + margin-bottom: 0.5rem; + color: #d70022; +} + +.thunderai-summary-content { + font-size: 0.9rem; + line-height: 1.4; +} \ No newline at end of file diff --git a/mzta-background.js b/mzta-background.js index e2161b66..a5cf2137 100644 --- a/mzta-background.js +++ b/mzta-background.js @@ -103,6 +103,13 @@ browser.composeScripts.register({ // Register the message display script for all newly opened message tabs. messenger.messageDisplayScripts.register({ js: [{ file: "js/mzta-compose-script.js" }], + css: [{ file: "messageDisplay/message-content-styles.css" }] +}); + +// Register our new ThunderAI summary script +messenger.messageDisplayScripts.register({ + js: [{ file: "messageDisplay/message-content-script.js" }], + css: [{ file: "messageDisplay/message-content-styles.css" }] }); // Inject script and CSS in all already open message tabs. @@ -118,6 +125,13 @@ for (let messageTab of messageTabs) { await browser.tabs.executeScript(messageTab.id, { file: "js/mzta-compose-script.js" }) + // Inject our ThunderAI summary script + await browser.tabs.executeScript(messageTab.id, { + file: "messageDisplay/message-content-script.js" + }) + await browser.tabs.insertCSS(messageTab.id, { + file: "messageDisplay/message-content-styles.css" + }); } catch (error) { console.error("[ThunderAI] Error injecting message display script:", error); console.error("[ThunderAI] Message tab:", messageTab.url); @@ -224,6 +238,38 @@ messenger.runtime.onMessage.addListener((message, sender, sendResponse) => { // handler function. if (message && message.hasOwnProperty("command")){ switch (message.command) { + case 'generate_summary': + async function _generate_summary(message) { + try { + // Get user preferences for AI connection + let prefs = await browser.storage.sync.get({ + connection_type: prefs_default.connection_type, + chatgpt_model: prefs_default.chatgpt_model, + chatgpt_api_key: prefs_default.chatgpt_api_key, + do_debug: prefs_default.do_debug + }); + + // Use the existing ThunderAI infrastructure + // We need to adapt to the new v3.8.0 settings structure + const summary = await generateAISummaryUsingThunderAIInfrastructure( + message.content, + message.prompt, + { + ...prefs, + // Add the dynamic settings that the new system expects + connection_type: prefs.connection_type, + // For summary, we don't have specific integration settings yet, + // so we'll use the global connection type + } + ); + + return { summary: summary }; + } catch (error) { + console.error("[ThunderAI] Error generating summary:", error); + return { error: "Failed to generate AI summary. Please confirm your settings and try again." }; + } + } + return _generate_summary(message); // case 'chatgpt_open': // openChatGPT(message.prompt,message.action,message.tabId); // return true; @@ -1183,3 +1229,77 @@ try { taLog.log("Using browser.messages.onNewMailReceived.addListener with one agrument for Thunderbird 115."); browser.messages.onNewMailReceived.addListener(newEmailListener); } + +/** + * AI summary generation function using ThunderAI infrastructure + */ +async function generateAISummaryUsingThunderAIInfrastructure(content, prompt, prefs) { + // Import the special command class + const { mzta_specialCommand } = await import('./js/mzta-special-commands.js'); + + // Create a prompt config for summary (similar to how other features do it) + // This adapts to the new v3.8.0 dynamic settings system + const summaryPromptConfig = { + id: 'auto_summary', + name: 'Auto Summary', + model: '', // Model will be determined by getConnectionType + connection_type: prefs.connection_type + }; + + // Determine which LLM to use based on user preferences using the new v3.8.0 pattern + const llmType = getConnectionType(prefs, summaryPromptConfig, 'auto_summary'); + + // Get the appropriate model based on the connection type using dynamic settings + let model = ''; + if (prefs.connection_type === 'chatgpt_api') { + model = prefs.chatgpt_model; + } else if (prefs.connection_type === 'ollama_api') { + model = prefs.ollama_model; + } else if (prefs.connection_type === 'openai_comp_api') { + model = prefs.openai_comp_model; + } else if (prefs.connection_type === 'google_gemini_api') { + model = prefs.google_gemini_model; + } else if (prefs.connection_type === 'anthropic_api') { + model = prefs.anthropic_model; + } + + // Create a special command instance with the correct v3.8.0 pattern + const summaryCommand = new mzta_specialCommand({ + prompt: prompt, + llm: llmType, + custom_model: model, + do_debug: prefs.do_debug, + config: summaryPromptConfig + }); + + try { + // Initialize the worker + await summaryCommand.initWorker(); + + // Send the prompt and get the AI response + const aiResponse = await summaryCommand.sendPrompt(); + + // Clean up the response - extract just the summary content + const cleanedResponse = cleanAISummaryResponse(aiResponse); + + return cleanedResponse; + } catch (error) { + console.error("[ThunderAI] Error in AI summary generation:", error); + throw error; // Re-throw to be handled by the caller + } +} + +/** + * Helper function to clean AI response + */ +function cleanAISummaryResponse(response) { + // Remove any markdown formatting or code blocks + let cleaned = response.replace(/```[\s\S]*?```/g, ''); + cleaned = cleaned.replace(/[\*#_~`]/g, ''); + cleaned = cleaned.replace(/\s+/g, ' ').trim(); + + // Remove any "Summary:" prefixes that the AI might add + cleaned = cleaned.replace(/^Summary:\s*/i, ''); + + return cleaned; +} diff --git a/options/mzta-options-default.js b/options/mzta-options-default.js index 66b24890..3acc4d16 100644 --- a/options/mzta-options-default.js +++ b/options/mzta-options-default.js @@ -133,5 +133,6 @@ export const prefs_default = { spamfilter_threshold: 70, spamfilter_context_menu: true, spamfilter_enabled_accounts: [], + auto_summary_enabled: false, // Enable automatic AI summarization for message previews ...generated_prefs } diff --git a/options/mzta-options.html b/options/mzta-options.html index 0e24f172..377f5fe2 100644 --- a/options/mzta-options.html +++ b/options/mzta-options.html @@ -125,6 +125,17 @@ + + + + + + __MSG_prefs_OptionText_add_tags__