Dynamic content translation
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.
Enable it
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-draweror#search-results).Allowed URLs — restrict dynamic translation to specific URLs. Leave empty (or use
all) to run it everywhere.
Add selectors from your own code
You can also register selectors programmatically from your own plugin or module, using the plugin's Craft events. See Extending Weglot with events.
Last updated