diff --git a/_locales/cs/messages.json b/_locales/cs/messages.json index 1ab9589e..12d8fafb 100644 --- a/_locales/cs/messages.json +++ b/_locales/cs/messages.json @@ -1130,5 +1130,11 @@ }, "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." } } diff --git a/_locales/de/messages.json b/_locales/de/messages.json index efd4f508..0a01f4f1 100644 --- a/_locales/de/messages.json +++ b/_locales/de/messages.json @@ -1303,4 +1303,29 @@ "prefs_anthropic_temperature_Info": { "message": "Grad der Zufälligkeit in der Antwort. Der Standardwert ist 1,0. Der Bereich liegt zwischen 0,0 und 1,0. Verwenden Sie eine Temperatur näher an 0,0 für analytische Aufgaben oder Multiple-Choice-Fragen und näher an 1,0 für kreative und generative Aufgaben. Beachten Sie, dass die Ergebnisse selbst bei einer Temperatur von 0,0 nicht vollständig deterministisch sind." } + }, + "customPrompts_export_include_api_settings": { + "message": "Do you want to include the API settings in the export? Be aware that also the API Key will be saved in the file!", + "description": "" + }, + "prefs_OptionText_auto_summary": { + "message": "Enable automatic AI summarization for message previews", + "description": "" + }, + "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.", + "description": "" + }, + "auto_summary_title": { + "message": "AI Summary", + "description": "" + }, + "auto_summary_generating": { + "message": "Generating summary...", + "description": "" + }, + "auto_summary_failed": { + "message": "Failed to generate summary", + "description": "" + } } diff --git a/_locales/en/messages.json b/_locales/en/messages.json index dc6f5b02..992989b1 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1808,5 +1808,25 @@ "customPrompts_export_include_api_settings": { "message": "Do you want to include the API settings in the export? Be aware that also the API Key will be saved in the file!", "description": "" + }, + "prefs_OptionText_auto_summary": { + "message": "Enable automatic AI summarization for message previews", + "description": "" + }, + "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.", + "description": "" + }, + "auto_summary_title": { + "message": "AI Summary", + "description": "" + }, + "auto_summary_generating": { + "message": "Generating summary...", + "description": "" + }, + "auto_summary_failed": { + "message": "Failed to generate summary", + "description": "" } } diff --git a/_locales/es/messages.json b/_locales/es/messages.json index 1db8b9bf..f36367d4 100644 --- a/_locales/es/messages.json +++ b/_locales/es/messages.json @@ -1287,4 +1287,29 @@ "reset": { "message": "Reiniciar" } + }, + "customPrompts_export_include_api_settings": { + "message": "Do you want to include the API settings in the export? Be aware that also the API Key will be saved in the file!", + "description": "" + }, + "prefs_OptionText_auto_summary": { + "message": "Enable automatic AI summarization for message previews", + "description": "" + }, + "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.", + "description": "" + }, + "auto_summary_title": { + "message": "AI Summary", + "description": "" + }, + "auto_summary_generating": { + "message": "Generating summary...", + "description": "" + }, + "auto_summary_failed": { + "message": "Failed to generate summary", + "description": "" + } } diff --git a/_locales/fr/messages.json b/_locales/fr/messages.json index c03ffae9..374e13d3 100644 --- a/_locales/fr/messages.json +++ b/_locales/fr/messages.json @@ -1303,4 +1303,29 @@ "reset": { "message": "Réinitialiser" } + }, + "customPrompts_export_include_api_settings": { + "message": "Do you want to include the API settings in the export? Be aware that also the API Key will be saved in the file!", + "description": "" + }, + "prefs_OptionText_auto_summary": { + "message": "Enable automatic AI summarization for message previews", + "description": "" + }, + "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.", + "description": "" + }, + "auto_summary_title": { + "message": "AI Summary", + "description": "" + }, + "auto_summary_generating": { + "message": "Generating summary...", + "description": "" + }, + "auto_summary_failed": { + "message": "Failed to generate summary", + "description": "" + } } diff --git a/_locales/it/messages.json b/_locales/it/messages.json index 158a65e4..101fb21c 100644 --- a/_locales/it/messages.json +++ b/_locales/it/messages.json @@ -1303,4 +1303,29 @@ "prefs_anthropic_temperature_Info": { "message": "Quantità di casualità iniettata nella risposta. Il valore predefinito è 1,0. L'intervallo va da 0,0 a 1,0. Utilizza una temperatura più vicina a 0,0 per compiti analitici o a scelta multipla, e più vicina a 1,0 per compiti creativi e generativi. Nota che, anche con una temperatura di 0,0, i risultati non saranno completamente deterministici." } + }, + "customPrompts_export_include_api_settings": { + "message": "Do you want to include the API settings in the export? Be aware that also the API Key will be saved in the file!", + "description": "" + }, + "prefs_OptionText_auto_summary": { + "message": "Enable automatic AI summarization for message previews", + "description": "" + }, + "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.", + "description": "" + }, + "auto_summary_title": { + "message": "AI Summary", + "description": "" + }, + "auto_summary_generating": { + "message": "Generating summary...", + "description": "" + }, + "auto_summary_failed": { + "message": "Failed to generate summary", + "description": "" + } } diff --git a/_locales/pl/messages.json b/_locales/pl/messages.json index c55f6d1d..45dc1346 100644 --- a/_locales/pl/messages.json +++ b/_locales/pl/messages.json @@ -890,5 +890,13 @@ }, "placeholder_selected_html": { "message": "Zaznaczony HTML" + }, + "prefs_OptionText_auto_summary": { + "message": "Włącz automatyczne podsumowanie AI dla podglądów wiadomości", + "description": "" + }, + "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.", + "description": "" } } diff --git a/_locales/pt-br/messages.json b/_locales/pt-br/messages.json index 9341402d..bdb71ff9 100644 --- a/_locales/pt-br/messages.json +++ b/_locales/pt-br/messages.json @@ -836,5 +836,11 @@ }, "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." } } diff --git a/_locales/pt/messages.json b/_locales/pt/messages.json index f6656907..fdd892a0 100644 --- a/_locales/pt/messages.json +++ b/_locales/pt/messages.json @@ -172,5 +172,13 @@ }, "chatgpt_win_send": { "message": "Enviar" + }, + "prefs_OptionText_auto_summary": { + "message": "Ativar resumo automático de IA para pré-visualizações de mensagens", + "description": "" + }, + "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.", + "description": "" } } diff --git a/_locales/ru/messages.json b/_locales/ru/messages.json index a4350b2b..7db20bbd 100644 --- a/_locales/ru/messages.json +++ b/_locales/ru/messages.json @@ -1205,5 +1205,11 @@ }, "OpenAIComp_ClearModelsList_Confirm": { "message": "Вы уверены, что хотите очистить список моделей? Это действие не может быть отменено." + }, + "prefs_OptionText_auto_summary": { + "message": "Показывать автоматическое резюме в просмотре сообщений" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "Если отмечено, резюме, сгенерированное ИИ, будет автоматически отображаться над сообщениями в просмотре." } } diff --git a/_locales/zh_Hans/messages.json b/_locales/zh_Hans/messages.json index deab75b7..49f15864 100644 --- a/_locales/zh_Hans/messages.json +++ b/_locales/zh_Hans/messages.json @@ -889,5 +889,11 @@ }, "customPrompts_form_label_use_diff_viewer_title": { "message": "当操作设置为“替换文本”时,可以选择差异查看器。" + }, + "prefs_OptionText_auto_summary": { + "message": "在消息预览中显示自动摘要" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "如果选中,AI生成的摘要将自动显示在消息预览上方。" } } diff --git a/messageDisplay/message-content-script.js b/messageDisplay/message-content-script.js index 30fc5763..b5ac35b8 100644 --- a/messageDisplay/message-content-script.js +++ b/messageDisplay/message-content-script.js @@ -1,4 +1,12 @@ 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"; diff --git a/options/mzta-options-default.js b/options/mzta-options-default.js index eb8cda9c..fc736313 100644 --- a/options/mzta-options-default.js +++ b/options/mzta-options-default.js @@ -132,5 +132,6 @@ export const prefs_default = { spamfilter_threshold: 70, spamfilter_enabled_accounts: [], summarize: false, + auto_summary_enabled: false, ...generated_prefs } diff --git a/options/mzta-options.html b/options/mzta-options.html index c809c1e3..08a143fa 100644 --- a/options/mzta-options.html +++ b/options/mzta-options.html @@ -125,6 +125,17 @@ + + + + + + __MSG_prefs_OptionText_add_tags__