Dynamic content translation
Translate content added to the page after it loads.
Translate content added to the page after it loads.
By default, Weglot translates the HTML your server returns. Content that appears after the page has loaded — menus, pop-ups, results injected by JavaScript or AJAX — needs dynamic translation.
In the plugin settings, turn on Enable dynamic content, then tell Weglot which parts of the page to watch:
Whitelist selectors — CSS selectors for the DOM regions to translate dynamically (for example .cart-drawer or #search-results).
Allowed URLs — restrict dynamic translation to specific URLs. Leave empty (or use all) to run it everywhere.
Dynamic translation runs in the browser and calls Weglot as content changes. Keep your selectors as specific as possible to avoid translating more than you need.
You can also register selectors programmatically from your own plugin or module, using the plugin's Craft events. See Extending Weglot with events.