Skip to content

AI turns documents or topics into real, native PowerPoint decks—with native shapes, transitions and animations, data-backed charts and tables on demand, audio narration from speaker notes, and support for your own .pptx templates. · by Hugo He

fix(ui): switching language keeps typed annotations and live status text

Kevin402a92fa3c0c
diff --git a/skills/ppt-master/scripts/confirm_ui/static/app.js b/skills/ppt-master/scripts/confirm_ui/static/app.js
index 0e619229..87fc1240 100644
--- a/skills/ppt-master/scripts/confirm_ui/static/app.js
+++ b/skills/ppt-master/scripts/confirm_ui/static/app.js
@@ -4407,6 +4407,7 @@
document.getElementById("sections").style.display = "none";
document.getElementById("actionbar").style.display = "none";
var l = document.getElementById("loading");
+ l.setAttribute("data-i18n", "deriving");
l.textContent = t("deriving");
l.style.display = "block";
}
@@ -4536,7 +4537,7 @@
if (requested !== "zh" && requested !== "en" && requested !== "ja" &&
requested !== "zh-TW") return;
var hasStored = false;
- try { hasStored = !!window.localStorage.getItem("ppt_lang"); } catch (e) { /* ignore */ }
+ try { hasStored = ["zh", "en", "ja", "zh-TW"].indexOf(window.localStorage.getItem("ppt_lang")) >= 0; } catch (e) { /* ignore */ }
if (hasStored) return;
LANG = requested;
applyStaticTranslations();
@@ -4587,11 +4588,12 @@
setMenuOpen(false);
toggleBtn.focus();
if (v !== "ja" && v !== "en" && v !== "zh" && v !== "zh-TW") return;
+ try { window.localStorage.setItem("ppt_lang", v); } catch (e2) { /* ignore */ }
if (v === LANG) return;
LANG = v;
- try { window.localStorage.setItem("ppt_lang", LANG); } catch (e2) { /* ignore */ }
applyStaticTranslations();
refreshLangToggle(toggleBtn);
+ document.getElementById("confirm-status").textContent = "";
if (REC && CAT) {
renderAll(); // STATE persists → selections preserved
}
diff --git a/skills/ppt-master/scripts/svg_editor/static/app.js b/skills/ppt-master/scripts/svg_editor/static/app.js
index 7de44028..ebf21c51 100644
--- a/skills/ppt-master/scripts/svg_editor/static/app.js
+++ b/skills/ppt-master/scripts/svg_editor/static/app.js
@@ -375,7 +375,9 @@
applyI18n();
refreshLangUI(lang);
// Re-render dynamic regions so they pick up the new language
+ var annotationDraft = annotationText.value;
updateSelectionPanel();
+ annotationText.value = annotationDraft;
updateAnnotationList();
updateUndoButton();
updatePendingStatus();
@@ -590,6 +592,12 @@
if (navLastBtn) navLastBtn.disabled = !hasCurrent || idx2 >= total - 1;
}
+ // Keep data-i18n on the shown key so applyI18n() re-translates it instead of resetting it.
+ function setPlaceholder(key) {
+ svgPlaceholder.setAttribute("data-i18n", key);
+ svgPlaceholder.textContent = t(key);
+ }
+
// ================================================================
// 1. loadSlides -- GET /api/slides
// ================================================================
@@ -610,9 +618,7 @@
slideListEl.appendChild(empty);
if (!currentSlide) {
svgPlaceholder.style.display = "block";
- svgPlaceholder.textContent = liveMode
- ? t("placeholder_live_ready")
- : t("empty_no_slides");
+ setPlaceholder(liveMode ? "placeholder_live_ready" : "empty_no_slides");
svgContent.style.display = "none";
}
updateNavLabel();
@@ -694,7 +700,7 @@
if (!liveMode || name !== currentSlide) return;
waitingForSlide = name;
svgPlaceholder.style.display = "block";
- svgPlaceholder.textContent = t("placeholder_slide_writing");
+ setPlaceholder("placeholder_slide_writing");
svgContent.style.display = "none";
}
@@ -774,7 +780,7 @@
if (!rootSvg || !hasContent) {
showError(t("err_empty_svg"));
svgPlaceholder.style.display = "block";
- svgPlaceholder.textContent = t("err_empty_svg");
+ setPlaceholder("err_empty_svg");
svgContent.style.display = "none";
return;
}