Closed ssi-com-pl closed 1 year ago
The multisite feature handles this natively now, so it may be conflicting. Check these events that the multisite feature uses to set the locale internally. If you make an event with least priority (eg: -1) then it should always put your desired locale in place:
// Reset locale when active and edit sites change
Event::listen('system.site.setEditSite', function() {
$this->activeLocale = ...;
});
Event::listen('system.site.setActiveSite', function() {
$this->activeLocale = ...;
});
Hopefully it helps.
Sorry, forgot to mention I'm using October v2. How can I achieve this in October 2?
Hi! I use this code to change language based on domain:
Unfortunately my language switcher has stopped working:
How to make it work again?