Extending Weglot with events
Register dynamic-content selectors from your own plugin or module.
Event
Purpose
Example
use yii\base\Event;
use weglot\craftweglot\Plugin;
use weglot\craftweglot\events\RegisterSelectorsEvent;
Event::on(
Plugin::class,
Plugin::EVENT_REGISTER_DYNAMICS_SELECTORS,
static function (RegisterSelectorsEvent $event): void {
$event->selectors[] = ['value' => '.my-dynamic-widget'];
}
);