From dcbf9d3dcddc3e7ebb5c1c5fad2408cf4956600e Mon Sep 17 00:00:00 2001 From: Ronald Klarenbeek Date: Fri, 26 Dec 2025 20:39:30 +0100 Subject: [PATCH 1/7] feat(summary): add AI-powered message summary feature Add new ThunderAI summary functionality that generates concise summaries for email messages using the existing ThunderAI infrastructure. Includes a new content script that creates a summary pane in the message display, associated CSS styling, and backend integration for AI summary generation. The feature shows a loading indicator while generating the summary and falls back to showing truncated message content if the AI generation fails. --- messageDisplay/message-content-script.js | 105 ++++++++++++++++++++++ messageDisplay/message-content-styles.css | 20 +++++ mzta-background.js | 84 +++++++++++++++++ 3 files changed, 209 insertions(+) create mode 100644 messageDisplay/message-content-script.js create mode 100644 messageDisplay/message-content-styles.css diff --git a/messageDisplay/message-content-script.js b/messageDisplay/message-content-script.js new file mode 100644 index 00000000..30fc5763 --- /dev/null +++ b/messageDisplay/message-content-script.js @@ -0,0 +1,105 @@ +async function showSummaryPane() { + // 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 = "ThunderAI Summary"; + + // Create a loading indicator + const loadingIndicator = document.createElement("div"); + loadingIndicator.className = "thunderai-summary-content"; + loadingIndicator.innerText = "Generating AI summary..."; + + // 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 = "Failed to generate AI summary. Showing message preview instead."; + loadingIndicator.style.color = '#d70022'; + + // Fallback to showing truncated message content + const messageContent = getMessageContent(); + loadingIndicator.innerText += "\n\n" + truncateMessageContent(messageContent); + } +} + +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 + const summaryPrompt = `Please provide a concise summary of the following email message. The summary should be 3-5 sentences maximum and capture the main points: + +${cleanedContent} + +Summary:`; + + // 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) { + reject(new Error(response.error)); + } else { + reject(new Error("Failed to get AI summary")); + } + }); + }); +} + +// 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 e1d63747..c0199a7d 100644 --- a/mzta-background.js +++ b/mzta-background.js @@ -99,6 +99,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. @@ -114,6 +121,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); @@ -220,6 +234,31 @@ 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 + const summary = await generateAISummaryUsingThunderAIInfrastructure( + message.content, + message.prompt, + prefs + ); + + return { summary: summary }; + } catch (error) { + console.error("[ThunderAI] Error generating summary:", error); + return { error: "Failed to generate AI summary: " + error.message }; + } + } + return _generate_summary(message); // case 'chatgpt_open': // openChatGPT(message.prompt,message.action,message.tabId); // return true; @@ -1177,3 +1216,48 @@ 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'); + + // Determine which LLM to use based on user preferences + const llmType = getConnectionType(prefs.connection_type, {}, ''); + + // Create a special command instance + const summaryCommand = new mzta_specialCommand({ + prompt: prompt, + llm: llmType, + custom_model: prefs.chatgpt_model, + do_debug: prefs.do_debug + }); + + // 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; +} + +/** + * 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; +} From bd66a37d354197390b8181d9dfaa89e63d8025eb Mon Sep 17 00:00:00 2001 From: Ronald Klarenbeek Date: Fri, 26 Dec 2025 22:20:13 +0100 Subject: [PATCH 2/7] feat(summary): add auto-summary preference for message previews - Add new preference option to enable automatic AI summarization - Update all localization files with new preference text - Implement preference check in message display script - Add default preference setting in options configuration - Include preference toggle in options UI This adds a user-configurable option to automatically generate and display AI summaries when viewing email messages, with appropriate warnings about data transmission to AI services. --- _locales/cs/messages.json | 6 ++++++ _locales/de/messages.json | 8 ++++++++ _locales/en/messages.json | 8 ++++++++ _locales/es/messages.json | 8 ++++++++ _locales/fr/messages.json | 8 ++++++++ _locales/it/messages.json | 8 ++++++++ _locales/pl/messages.json | 8 ++++++++ _locales/pt-br/messages.json | 6 ++++++ _locales/pt/messages.json | 8 ++++++++ _locales/ru/messages.json | 6 ++++++ _locales/zh_Hans/messages.json | 6 ++++++ messageDisplay/message-content-script.js | 8 ++++++++ options/mzta-options-default.js | 1 + options/mzta-options.html | 11 +++++++++++ 14 files changed, 100 insertions(+) diff --git a/_locales/cs/messages.json b/_locales/cs/messages.json index d0b12318..2ee16360 100644 --- a/_locales/cs/messages.json +++ b/_locales/cs/messages.json @@ -1166,5 +1166,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 11ae9c45..ec0bf31a 100644 --- a/_locales/de/messages.json +++ b/_locales/de/messages.json @@ -1311,5 +1311,13 @@ }, "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", + "description": "" + }, + "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.", + "description": "" } } diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 904229c1..99116405 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1700,5 +1700,13 @@ "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", + "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": "" } } diff --git a/_locales/es/messages.json b/_locales/es/messages.json index 92c85674..ea8bb1ca 100644 --- a/_locales/es/messages.json +++ b/_locales/es/messages.json @@ -187,5 +187,13 @@ }, "chatgpt_win_model_warning": { "message": "Por alguna razón, no es posible verificar si el modelo correcto está cargado. Por ahora, puedes pulsar el botón azul para continuar." + }, + "prefs_OptionText_auto_summary": { + "message": "Habilitar resumen automático de IA para vistas previas de mensajes", + "description": "" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "Si está activado, ThunderAI generará y mostrará automáticamente resúmenes de IA sobre los mensajes de correo electrónico cuando se abran. Ten en cuenta que esto significa que todos los mensajes que previsualices se enviarán inmediatamente al servicio de IA configurado.", + "description": "" } } diff --git a/_locales/fr/messages.json b/_locales/fr/messages.json index 2b3f8a52..140dc7e1 100644 --- a/_locales/fr/messages.json +++ b/_locales/fr/messages.json @@ -1311,5 +1311,13 @@ }, "Optional_Permission_Denied_Model_Fetching": { "message": "Vous avez refusé l’autorisation facultative nécessaire pour récupérer les modèles pour cette intégration." + }, + "prefs_OptionText_auto_summary": { + "message": "Activer la synthèse automatique par IA pour les aperçus de messages", + "description": "" + }, + "prefs_OptionText_auto_summary_Info": { + "message": "Si cette option est cochée, ThunderAI générera et affichera automatiquement des synthèses par IA au-dessus des messages électroniques lorsqu'ils sont ouverts. Notez que cela signifie que tous les messages que vous prévisualisez seront immédiatement envoyés au service IA configuré.", + "description": "" } } diff --git a/_locales/it/messages.json b/_locales/it/messages.json index ae811d3f..06744e9a 100644 --- a/_locales/it/messages.json +++ b/_locales/it/messages.json @@ -1314,5 +1314,13 @@ }, "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": "" } } diff --git a/_locales/pl/messages.json b/_locales/pl/messages.json index 0b7b90c1..592fdc55 100644 --- a/_locales/pl/messages.json +++ b/_locales/pl/messages.json @@ -908,5 +908,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 d9941262..8d8159bc 100644 --- a/_locales/pt-br/messages.json +++ b/_locales/pt-br/messages.json @@ -854,5 +854,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 3b17cff4..08be72f1 100644 --- a/_locales/ru/messages.json +++ b/_locales/ru/messages.json @@ -1223,5 +1223,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 ccbdaa63..37f8fc25 100644 --- a/_locales/zh_Hans/messages.json +++ b/_locales/zh_Hans/messages.json @@ -919,5 +919,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 6405c1a0..48174267 100644 --- a/options/mzta-options-default.js +++ b/options/mzta-options-default.js @@ -90,4 +90,5 @@ export const prefs_default = { spamfilter_openai_comp_model: '', spamfilter_google_gemini_model: '', spamfilter_anthropic_model: '', + auto_summary_enabled: false, // Enable automatic AI summarization for message previews } 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__
From a34394d4429f25fd4c3b616ef76cdf59e04bc7f8 Mon Sep 17 00:00:00 2001 From: Ronald Klarenbeek Date: Fri, 2 Jan 2026 21:57:51 +0100 Subject: [PATCH 3/7] feat(i18n): add auto summary preference strings for es, fr, and sv locales --- _locales/es/messages.json | 6 ++++++ _locales/fr/messages.json | 6 ++++++ _locales/sv/messages.json | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/_locales/es/messages.json b/_locales/es/messages.json index 3e461daf..cacd19b4 100644 --- a/_locales/es/messages.json +++ b/_locales/es/messages.json @@ -1301,5 +1301,11 @@ }, "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." } } diff --git a/_locales/fr/messages.json b/_locales/fr/messages.json index 89cc8a12..984c175d 100644 --- a/_locales/fr/messages.json +++ b/_locales/fr/messages.json @@ -1335,5 +1335,11 @@ }, "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é." } } diff --git a/_locales/sv/messages.json b/_locales/sv/messages.json index 501458e0..f6d2f861 100644 --- a/_locales/sv/messages.json +++ b/_locales/sv/messages.json @@ -67,5 +67,11 @@ }, "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." } } From 3f63cc358043790e969b148f729fe671429e2783 Mon Sep 17 00:00:00 2001 From: Ronald Klarenbeek Date: Fri, 2 Jan 2026 22:42:46 +0100 Subject: [PATCH 4/7] feat(summary): implement new configuration model, fix multilingual support and fix error display - Introduce localized UI strings for auto-summary feature across multiple languages - Standardize error messages and implement consistent error propagation - Refactor summary generation to align with v3.8.0 settings architecture - Enhance user experience with localized loading and error states - Improve code reliability through structured error handling and cleanup --- _locales/en/messages.json | 20 +++++++- _locales/es/messages.json | 16 ++++++ _locales/fr/messages.json | 19 ++++++- _locales/sv/messages.json | 16 ++++++ messageDisplay/message-content-script.js | 22 +++----- mzta-background.js | 64 ++++++++++++++++++------ 6 files changed, 126 insertions(+), 31 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index c94bc27c..77300ad7 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1742,7 +1742,23 @@ "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": "" + "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": "ThunderAI Summary", + "description": "Title for the auto-summary pane" + }, + "auto_summary_generating": { + "message": "Generating AI summary...", + "description": "Loading text shown while generating summary" + }, + "auto_summary_failed": { + "message": "Failed to generate AI summary. Please confirm your settings and try again.", + "description": "Error message when summary generation fails" + }, + "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", + "description": "Prompt template for AI summary generation" } } diff --git a/_locales/es/messages.json b/_locales/es/messages.json index cacd19b4..86df6187 100644 --- a/_locales/es/messages.json +++ b/_locales/es/messages.json @@ -1307,5 +1307,21 @@ }, "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", + "description": "Título del panel de resumen automático" + }, + "auto_summary_generating": { + "message": "Generando resumen de IA...", + "description": "Texto de carga mostrado mientras se genera el resumen" + }, + "auto_summary_failed": { + "message": "Error al generar el resumen de IA. Verifica tu configuración e inténtalo de nuevo.", + "description": "Mensaje de error cuando falla la generación del resumen" + }, + "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", + "description": "Plantilla de prompt para la generación de resúmenes de IA" } } diff --git a/_locales/fr/messages.json b/_locales/fr/messages.json index 984c175d..dd71b608 100644 --- a/_locales/fr/messages.json +++ b/_locales/fr/messages.json @@ -1340,6 +1340,23 @@ "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é." + "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é.", + "description": "" + }, + "auto_summary_title": { + "message": "Résumé ThunderAI", + "description": "Titre du panneau de résumé automatique" + }, + "auto_summary_generating": { + "message": "Génération du résumé IA...", + "description": "Texte de chargement affiché pendant la génération du résumé" + }, + "auto_summary_failed": { + "message": "Échec de la génération du résumé IA. Veuillez vérifier vos paramètres et réessayer.", + "description": "Message d'erreur lorsque la génération du résumé échoue" + }, + "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", + "description": "Modèle d'invite pour la génération de résumés IA" } } diff --git a/_locales/sv/messages.json b/_locales/sv/messages.json index f6d2f861..cee60b99 100644 --- a/_locales/sv/messages.json +++ b/_locales/sv/messages.json @@ -73,5 +73,21 @@ }, "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", + "description": "Titel för den automatiska sammanfattningspanelen" + }, + "auto_summary_generating": { + "message": "Genererar AI-sammanfattning...", + "description": "Laddningstext som visas medan sammanfattningen genereras" + }, + "auto_summary_failed": { + "message": "Misslyckades med att generera AI-sammanfattning. Kontrollera dina inställningar och försök igen.", + "description": "Felmeddelande när sammanfattningsgenereringen misslyckas" + }, + "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", + "description": "Promptmall för AI-sammanfattningsgenerering" } } diff --git a/messageDisplay/message-content-script.js b/messageDisplay/message-content-script.js index b5ac35b8..7bb92c3d 100644 --- a/messageDisplay/message-content-script.js +++ b/messageDisplay/message-content-script.js @@ -14,12 +14,12 @@ async function showSummaryPane() { // Create the title element const summaryTitle = document.createElement("div"); summaryTitle.className = "thunderai-summary-title"; - summaryTitle.innerText = "ThunderAI Summary"; + summaryTitle.innerText = browser.i18n.getMessage("auto_summary_title"); // Create a loading indicator const loadingIndicator = document.createElement("div"); loadingIndicator.className = "thunderai-summary-content"; - loadingIndicator.innerText = "Generating AI summary..."; + loadingIndicator.innerText = browser.i18n.getMessage("auto_summary_generating"); // Create the content element (initially hidden) const summaryContent = document.createElement("div"); @@ -45,12 +45,9 @@ async function showSummaryPane() { summaryContent.style.display = 'block'; } catch (error) { console.error("Error generating AI summary:", error); - loadingIndicator.innerText = "Failed to generate AI summary. Showing message preview instead."; + loadingIndicator.innerText = browser.i18n.getMessage("auto_summary_failed"); loadingIndicator.style.color = '#d70022'; - // Fallback to showing truncated message content - const messageContent = getMessageContent(); - loadingIndicator.innerText += "\n\n" + truncateMessageContent(messageContent); } } @@ -83,12 +80,8 @@ async function generateAISummary(messageContent) { // Clean up the message content const cleanedContent = messageContent.replace(/\s+/g, ' ').trim(); - // Create a simple summary prompt - const summaryPrompt = `Please provide a concise summary of the following email message. The summary should be 3-5 sentences maximum and capture the main points: - -${cleanedContent} - -Summary:`; + // 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) => { @@ -101,9 +94,10 @@ Summary:`; if (response && response.summary) { resolve(response.summary); } else if (response && response.error) { - reject(new Error(response.error)); + // Use the localized error message + reject(new Error(browser.i18n.getMessage("auto_summary_failed"))); } else { - reject(new Error("Failed to get AI summary")); + reject(new Error(browser.i18n.getMessage("auto_summary_failed"))); } }); }); diff --git a/mzta-background.js b/mzta-background.js index daab589e..826091a3 100644 --- a/mzta-background.js +++ b/mzta-background.js @@ -250,16 +250,23 @@ messenger.runtime.onMessage.addListener((message, sender, sendResponse) => { }); // 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 + { + ...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: " + error.message }; + return { error: "Failed to generate AI summary. Please confirm your settings and try again." }; } } return _generate_summary(message); @@ -1226,27 +1233,56 @@ async function generateAISummaryUsingThunderAIInfrastructure(content, prompt, pr // Import the special command class const { mzta_specialCommand } = await import('./js/mzta-special-commands.js'); - // Determine which LLM to use based on user preferences - const llmType = getConnectionType(prefs.connection_type, {}, ''); + // 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 + // Create a special command instance with the correct v3.8.0 pattern const summaryCommand = new mzta_specialCommand({ prompt: prompt, llm: llmType, - custom_model: prefs.chatgpt_model, - do_debug: prefs.do_debug + custom_model: model, + do_debug: prefs.do_debug, + config: summaryPromptConfig }); - // Initialize the worker - await summaryCommand.initWorker(); + try { + // Initialize the worker + await summaryCommand.initWorker(); - // Send the prompt and get the AI response - const aiResponse = await summaryCommand.sendPrompt(); + // 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); + // Clean up the response - extract just the summary content + const cleanedResponse = cleanAISummaryResponse(aiResponse); - return cleanedResponse; + return cleanedResponse; + } catch (error) { + console.error("[ThunderAI] Error in AI summary generation:", error); + throw error; // Re-throw to be handled by the caller + } } /** From 90efefd363aef0fdc4e34ebad0f0e1f7f74fde9c Mon Sep 17 00:00:00 2001 From: Ronald Klarenbeek Date: Fri, 2 Jan 2026 23:26:17 +0100 Subject: [PATCH 5/7] feat(i18n): add auto summary feature strings for multiple locales - Add new translation strings for auto summary feature in bg, de, el, eo, es, fr, hr, hu, it, pl, pt-br, pt, ro, sk, and sv locales - Include preference options, title, status messages, and prompt templates - Remove unnecessary description fields from existing strings --- _locales/bg/messages.json | 20 +++++++++++++++++++- _locales/de/messages.json | 18 ++++++++++++++---- _locales/el/messages.json | 20 +++++++++++++++++++- _locales/eo/messages.json | 18 ++++++++++++++++++ _locales/es/messages.json | 12 ++++-------- _locales/fr/messages.json | 15 +++++---------- _locales/hr/messages.json | 20 +++++++++++++++++++- _locales/hu/messages.json | 20 +++++++++++++++++++- _locales/it/messages.json | 12 ++++++++++++ _locales/pl/messages.json | 6 ++---- _locales/pt-br/messages.json | 12 ++++++++++++ _locales/pt/messages.json | 18 ++++++++++++++---- _locales/ro/messages.json | 20 +++++++++++++++++++- _locales/sk/messages.json | 21 ++++++++++++++++++++- _locales/sv/messages.json | 12 ++++-------- 15 files changed, 200 insertions(+), 44 deletions(-) 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/de/messages.json b/_locales/de/messages.json index ec0bf31a..3421145d 100644 --- a/_locales/de/messages.json +++ b/_locales/de/messages.json @@ -1313,11 +1313,21 @@ "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", - "description": "" + "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.", - "description": "" + "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" } } diff --git a/_locales/el/messages.json b/_locales/el/messages.json index a4ed4972..d6c9445a 100644 --- a/_locales/el/messages.json +++ b/_locales/el/messages.json @@ -1277,5 +1277,23 @@ }, "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" } -} + } 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 86df6187..f5efc168 100644 --- a/_locales/es/messages.json +++ b/_locales/es/messages.json @@ -1309,19 +1309,15 @@ "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", - "description": "Título del panel de resumen automático" + "message": "Resumen de ThunderAI" }, "auto_summary_generating": { - "message": "Generando resumen de IA...", - "description": "Texto de carga mostrado mientras se genera el resumen" + "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.", - "description": "Mensaje de error cuando falla la generación del resumen" + "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", - "description": "Plantilla de prompt para la generación de resúmenes de IA" + "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" } } diff --git a/_locales/fr/messages.json b/_locales/fr/messages.json index dd71b608..e117832c 100644 --- a/_locales/fr/messages.json +++ b/_locales/fr/messages.json @@ -1340,23 +1340,18 @@ "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é.", - "description": "" + "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", - "description": "Titre du panneau de résumé automatique" + "message": "Résumé ThunderAI" }, "auto_summary_generating": { - "message": "Génération du résumé IA...", - "description": "Texte de chargement affiché pendant la génération du résumé" + "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.", - "description": "Message d'erreur lorsque la génération du résumé échoue" + "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", - "description": "Modèle d'invite pour la génération de résumés IA" + "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" } } 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 06744e9a..c695914b 100644 --- a/_locales/it/messages.json +++ b/_locales/it/messages.json @@ -1322,5 +1322,17 @@ "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" } } diff --git a/_locales/pl/messages.json b/_locales/pl/messages.json index 592fdc55..88650f76 100644 --- a/_locales/pl/messages.json +++ b/_locales/pl/messages.json @@ -910,11 +910,9 @@ "message": "Zaznaczony HTML" }, "prefs_OptionText_auto_summary": { - "message": "Włącz automatyczne podsumowanie AI dla podglądów wiadomości", - "description": "" + "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.", - "description": "" + "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 8d8159bc..a27d6a8c 100644 --- a/_locales/pt-br/messages.json +++ b/_locales/pt-br/messages.json @@ -860,5 +860,17 @@ }, "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 fdd892a0..dfbe2fdf 100644 --- a/_locales/pt/messages.json +++ b/_locales/pt/messages.json @@ -174,11 +174,21 @@ "message": "Enviar" }, "prefs_OptionText_auto_summary": { - "message": "Ativar resumo automático de IA para pré-visualizações de mensagens", - "description": "" + "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.", - "description": "" + "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/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 cee60b99..8ded988f 100644 --- a/_locales/sv/messages.json +++ b/_locales/sv/messages.json @@ -75,19 +75,15 @@ "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", - "description": "Titel för den automatiska sammanfattningspanelen" + "message": "ThunderAI Sammanfattning" }, "auto_summary_generating": { - "message": "Genererar AI-sammanfattning...", - "description": "Laddningstext som visas medan sammanfattningen genereras" + "message": "Genererar AI-sammanfattning..." }, "auto_summary_failed": { - "message": "Misslyckades med att generera AI-sammanfattning. Kontrollera dina inställningar och försök igen.", - "description": "Felmeddelande när sammanfattningsgenereringen misslyckas" + "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", - "description": "Promptmall för AI-sammanfattningsgenerering" + "message": "Ge en koncis sammanfattning av följande e-postmeddelande. Sammanfattningen bör vara max 3-5 meningar och fånga huvudpunkterna:\n\n" } } From e5f5d08582251647d2c68ad4042e3c69169e43b6 Mon Sep 17 00:00:00 2001 From: Ronald Klarenbeek Date: Fri, 2 Jan 2026 23:40:35 +0100 Subject: [PATCH 6/7] feat(i18n): add auto summary strings for cs, ru, zh_Hans, and zh_Hant locales - Add new translation strings for auto summary feature - Include title, generating, failed, and prompt messages - Remove unnecessary description fields from en locale - Add missing auto summary preference strings for zh_Hant locale --- _locales/cs/messages.json | 12 ++++++++++++ _locales/en/messages.json | 6 ------ _locales/ru/messages.json | 12 ++++++++++++ _locales/zh_Hans/messages.json | 12 ++++++++++++ _locales/zh_Hant/messages.json | 18 ++++++++++++++++++ 5 files changed, 54 insertions(+), 6 deletions(-) diff --git a/_locales/cs/messages.json b/_locales/cs/messages.json index 2ee16360..3586bea0 100644 --- a/_locales/cs/messages.json +++ b/_locales/cs/messages.json @@ -1172,5 +1172,17 @@ }, "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/en/messages.json b/_locales/en/messages.json index 77300ad7..d15784e9 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1739,26 +1739,20 @@ }, "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": "ThunderAI Summary", - "description": "Title for the auto-summary pane" }, "auto_summary_generating": { "message": "Generating AI summary...", - "description": "Loading text shown while generating summary" }, "auto_summary_failed": { "message": "Failed to generate AI summary. Please confirm your settings and try again.", - "description": "Error message when summary generation fails" }, "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", - "description": "Prompt template for AI summary generation" } } diff --git a/_locales/ru/messages.json b/_locales/ru/messages.json index 08be72f1..6f93f42b 100644 --- a/_locales/ru/messages.json +++ b/_locales/ru/messages.json @@ -1229,5 +1229,17 @@ }, "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/zh_Hans/messages.json b/_locales/zh_Hans/messages.json index 37f8fc25..9f5aa903 100644 --- a/_locales/zh_Hans/messages.json +++ b/_locales/zh_Hans/messages.json @@ -925,5 +925,17 @@ }, "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" } } From af2ae047dd50c5bbee2bfd89476aab5f4c6f24b4 Mon Sep 17 00:00:00 2001 From: Ronald Klarenbeek Date: Fri, 2 Jan 2026 23:52:08 +0100 Subject: [PATCH 7/7] fix en locale structure breaking the extension --- _locales/en/messages.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index d15784e9..4a7e3984 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1738,21 +1738,21 @@ "description": "" }, "prefs_OptionText_auto_summary": { - "message": "Enable automatic AI summarization for message previews", + "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.", + "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", + "message": "ThunderAI Summary" }, "auto_summary_generating": { - "message": "Generating AI summary...", + "message": "Generating AI summary..." }, "auto_summary_failed": { - "message": "Failed to generate AI summary. Please confirm your settings and try again.", + "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", + "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" } }