Super-fast Google Translate with instant SPA/AJAX support, no hiding
Translate all sites into English upon detection of different languages
🔥Key focuses:
Speed up: Async script loading, lazy init, minimal overhead.
Dynamic content: Use MutationObserver to detect and re-translate new elements instantly (e.g., for single-page apps like React/Vue where content loads via AJAX).
No toolbar hiding—let it show naturally if Google Translate decides to.
2️⃣ Core Optimizations
Faster init: Load script async, init only when ready, use pageLanguage 'auto' for quick detection.
Dynamic translation: MutationObserver watches for DOM changes and triggers re-translation on new content.
SPA/AJAX handling: Observer subtree/childList to catch async-loaded elements; call Google's translate methods on mutations.
Minimal footprint: No extra CSS, no observers for hiding—just for translation triggers.
Still Google Translate: Keeps the fast engine.
Note: Google Translate's API doesn't have a direct "re-translate" method for subsets, so i have simulated by re-initializing or using their internal refresh if available, but optimized to avoid full page reloads.