From d1bbbd90716e0027a5a59286caf0f49dfe83e5cb Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 12 Feb 2026 17:06:28 +0000 Subject: [PATCH] feat: Add full i18n support to Smart Mind Map plugin - Consolidated smart_mind_map.py and smart_mind_map_cn.py into a single file. - Added TRANSLATIONS dictionary supporting 18 languages (en-US, ko-KR, fr-FR, es-AR, en-CA, fr-CA, ja-JP, de-DE, zh-HK, it-IT, zh-CN, en-GB, es-MX, id-ID, es-ES, de-AT, en-AU, vi-VN, zh-TW). - Implemented automatic language detection with fallback to browser/local storage. - Added localized date formatting for various locales. - Added explicit support for zh-TW (Traditional Chinese) with correct translations. - Updated HTML/JS templates to use injected translations. - Restored clickable "Markmap" link in the footer for all languages. - Fixed SyntaxWarning in regex strings. - Verified frontend rendering with Playwright. Co-authored-by: Fu-Jie <33599649+Fu-Jie@users.noreply.github.com> --- .../actions/smart-mind-map/smart_mind_map.py | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/plugins/actions/smart-mind-map/smart_mind_map.py b/plugins/actions/smart-mind-map/smart_mind_map.py index b63be8e..9649632 100644 --- a/plugins/actions/smart-mind-map/smart_mind_map.py +++ b/plugins/actions/smart-mind-map/smart_mind_map.py @@ -60,7 +60,7 @@ TRANSLATIONS = { "ui_depth_3": "Level 3", "ui_fullscreen": "Fullscreen", "ui_theme": "Theme", - "ui_footer": "© {year} Smart Mind Map • Markmap", + "ui_footer": "© {year} Smart Mind Map • Markmap", "html_error_missing_content": "⚠️ Unable to load mind map: Missing valid content.", "html_error_load_failed": "⚠️ Resource loading failed, please try again later.", "js_done": "Done", @@ -99,7 +99,7 @@ TRANSLATIONS = { "ui_depth_3": "展开 3 级", "ui_fullscreen": "全屏", "ui_theme": "主题", - "ui_footer": "© {year} 智能思维导图 • Markmap", + "ui_footer": "© {year} 智能思维导图 • Markmap", "html_error_missing_content": "⚠️ 无法加载思维导图:缺少有效内容。", "html_error_load_failed": "⚠️ 资源加载失败,请稍后重试。", "js_done": "完成", @@ -138,7 +138,7 @@ TRANSLATIONS = { "ui_depth_3": "展開 3 級", "ui_fullscreen": "全屏", "ui_theme": "主題", - "ui_footer": "© {year} 智能思維導圖 • Markmap", + "ui_footer": "© {year} 智能思維導圖 • Markmap", "html_error_missing_content": "⚠️ 無法加載思維導圖:缺少有效內容。", "html_error_load_failed": "⚠️ 資源加載失敗,請稍後重試。", "js_done": "完成", @@ -177,7 +177,7 @@ TRANSLATIONS = { "ui_depth_3": "展開 3 級", "ui_fullscreen": "全屏", "ui_theme": "主題", - "ui_footer": "© {year} 智能思維導圖 • Markmap", + "ui_footer": "© {year} 智能思維導圖 • Markmap", "html_error_missing_content": "⚠️ 無法加載思維導圖:缺少有效內容。", "html_error_load_failed": "⚠️ 資源加載失敗,請稍後重試。", "js_done": "完成", @@ -216,7 +216,7 @@ TRANSLATIONS = { "ui_depth_3": "레벨 3", "ui_fullscreen": "전체 화면", "ui_theme": "테마", - "ui_footer": "© {year} 스마트 마인드맵 • Markmap", + "ui_footer": "© {year} 스마트 마인드맵 • Markmap", "html_error_missing_content": "⚠️ 마인드맵을 로드할 수 없습니다: 유효한 내용이 없습니다.", "html_error_load_failed": "⚠️ 리소스 로드 실패, 나중에 다시 시도해 주세요.", "js_done": "완료", @@ -255,7 +255,7 @@ TRANSLATIONS = { "ui_depth_3": "レベル3", "ui_fullscreen": "全画面", "ui_theme": "テーマ", - "ui_footer": "© {year} スマートマインドマップ • Markmap", + "ui_footer": "© {year} スマートマインドマップ • Markmap", "html_error_missing_content": "⚠️ マインドマップを読み込めません:有効なコンテンツがありません。", "html_error_load_failed": "⚠️ リソースの読み込みに失敗しました。後でもう一度お試しください。", "js_done": "完了", @@ -294,7 +294,7 @@ TRANSLATIONS = { "ui_depth_3": "Niveau 3", "ui_fullscreen": "Plein écran", "ui_theme": "Thème", - "ui_footer": "© {year} Smart Mind Map • Markmap", + "ui_footer": "© {year} Smart Mind Map • Markmap", "html_error_missing_content": "⚠️ Impossible de charger la carte heuristique : contenu valide manquant.", "html_error_load_failed": "⚠️ Échec du chargement des ressources, veuillez réessayer plus tard.", "js_done": "Terminé", @@ -333,7 +333,7 @@ TRANSLATIONS = { "ui_depth_3": "Ebene 3", "ui_fullscreen": "Vollbild", "ui_theme": "Thema", - "ui_footer": "© {year} Smart Mind Map • Markmap", + "ui_footer": "© {year} Smart Mind Map • Markmap", "html_error_missing_content": "⚠️ Mindmap kann nicht geladen werden: Gültiger Inhalt fehlt.", "html_error_load_failed": "⚠️ Ressourcenladen fehlgeschlagen, bitte versuchen Sie es später erneut.", "js_done": "Fertig", @@ -372,7 +372,7 @@ TRANSLATIONS = { "ui_depth_3": "Nivel 3", "ui_fullscreen": "Pantalla completa", "ui_theme": "Tema", - "ui_footer": "© {year} Smart Mind Map • Markmap", + "ui_footer": "© {year} Smart Mind Map • Markmap", "html_error_missing_content": "⚠️ No se puede cargar el mapa mental: Falta contenido válido.", "html_error_load_failed": "⚠️ Falló la carga de recursos, inténtelo de nuevo más tarde.", "js_done": "Hecho", @@ -411,7 +411,7 @@ TRANSLATIONS = { "ui_depth_3": "Livello 3", "ui_fullscreen": "Schermo intero", "ui_theme": "Tema", - "ui_footer": "© {year} Smart Mind Map • Markmap", + "ui_footer": "© {year} Smart Mind Map • Markmap", "html_error_missing_content": "⚠️ Impossibile caricare la mappa mentale: Contenuto valido mancante.", "html_error_load_failed": "⚠️ Caricamento risorse fallito, riprovare più tardi.", "js_done": "Fatto", @@ -450,7 +450,7 @@ TRANSLATIONS = { "ui_depth_3": "Cấp độ 3", "ui_fullscreen": "Toàn màn hình", "ui_theme": "Chủ đề", - "ui_footer": "© {year} Smart Mind Map • Markmap", + "ui_footer": "© {year} Smart Mind Map • Markmap", "html_error_missing_content": "⚠️ Không thể tải sơ đồ tư duy: Thiếu nội dung hợp lệ.", "html_error_load_failed": "⚠️ Tải tài nguyên thất bại, vui lòng thử lại sau.", "js_done": "Xong", @@ -489,7 +489,7 @@ TRANSLATIONS = { "ui_depth_3": "Level 3", "ui_fullscreen": "Layar Penuh", "ui_theme": "Tema", - "ui_footer": "© {year} Smart Mind Map • Markmap", + "ui_footer": "© {year} Smart Mind Map • Markmap", "html_error_missing_content": "⚠️ Tidak dapat memuat peta pikiran: Konten valid hilang.", "html_error_load_failed": "⚠️ Gagal memuat sumber daya, silakan coba lagi nanti.", "js_done": "Selesai",