diff --git a/js/mzta-utils.js b/js/mzta-utils.js index 6733f3c5..e22ac3eb 100644 --- a/js/mzta-utils.js +++ b/js/mzta-utils.js @@ -19,6 +19,7 @@ import { prefs_default, getDynamicSettingValue } from '../options/mzta-options-default.js'; const sparks_min = '1.2.0'; // Minimum version of ThunderAI-Sparks required for the add-on to work export const ChatGPTWeb_models = ['gpt-5','gpt-5-instant','gpt-5-t-mini','gpt-5-thinking']; // List of models available in ChatGPT Web +const MICZ_IT_LOCALIZED_LANGS = ['es', 'de', 'fr', 'it']; export const getMenuContextCompose = () => 'compose_action_menu'; export const getMenuContextDisplay = () => 'message_display_action_menu'; @@ -38,6 +39,12 @@ export function getLanguageDisplayName(languageCode) { return lang_string.charAt(0).toUpperCase() + lang_string.slice(1); } +export function getMiczItUrl(path) { + const lang = browser.i18n.getUILanguage().split('-')[0]; + const prefix = MICZ_IT_LOCALIZED_LANGS.includes(lang) ? `${lang}/` : ''; + return `https://micz.it/${prefix}${path}`; +} + function fixMsgHeader(msgHeader) { if (!msgHeader.bccList) { msgHeader.bccList = []; diff --git a/options/mzta-options.html b/options/mzta-options.html index 3a02a77d..fb792f86 100644 --- a/options/mzta-options.html +++ b/options/mzta-options.html @@ -20,8 +20,8 @@
__MSG_prefs_doc_title__
__MSG_prefs_doc_open_welcome__ diff --git a/options/mzta-options.js b/options/mzta-options.js index ffa9737b..289a5430 100644 --- a/options/mzta-options.js +++ b/options/mzta-options.js @@ -25,7 +25,8 @@ import { getChatGPTWebModelsList_HTML, isAPIKeyValue, getConnectionType, - setTomSelectBorder + setTomSelectBorder, + getMiczItUrl } from '../js/mzta-utils.js'; import { injectConnectionUI, @@ -240,6 +241,10 @@ document.addEventListener('DOMContentLoaded', async () => { } i18n.updateDocument(); + + document.getElementById('link_doc_guides').href = getMiczItUrl('thunderbird-addon-thunderai/guides/'); + document.getElementById('link_doc_tutorial').href = getMiczItUrl('thunderbird-addon-thunderai/tutorial/'); + document.querySelectorAll(".option-input").forEach(element => { element.addEventListener("change", saveOptions); }); diff --git a/pages/onboarding/onboarding.html b/pages/onboarding/onboarding.html index 54fef870..d2735fe6 100644 --- a/pages/onboarding/onboarding.html +++ b/pages/onboarding/onboarding.html @@ -26,8 +26,8 @@

ThunderAI

diff --git a/pages/onboarding/onboarding.js b/pages/onboarding/onboarding.js index ccb9a1ce..a3c81f4b 100644 --- a/pages/onboarding/onboarding.js +++ b/pages/onboarding/onboarding.js @@ -18,6 +18,7 @@ import { taLogger } from '../../js/mzta-logger.js'; import { prefs_default } from '../../options/mzta-options-default.js'; +import { getMiczItUrl } from '../../js/mzta-utils.js'; let taLog = null; @@ -28,6 +29,9 @@ document.addEventListener('DOMContentLoaded', async () => { }); taLog = new taLogger("mzta-popup",prefs.do_debug); i18n.updateDocument(); + + document.getElementById('link_doc_guides').href = getMiczItUrl('thunderbird-addon-thunderai/guides/'); + document.getElementById('link_doc_tutorial').href = getMiczItUrl('thunderbird-addon-thunderai/tutorial/'); if(prefs.connection_type === 'chatgpt_web'){ let permission_chatgpt = await messenger.permissions.contains({ origins: ["https://*.chatgpt.com/*"] }); if(permission_chatgpt === false){