Hi,
Please help me with the issue.
I had installed the dependency by executing composer command, I have Lunatics package now in my vendor folder and I did configuration too.
My Config:
lunetics_locale:
guessing_order:
- cookie
allowed_locales:
- en
- fr
guessing_excluded_pattern: ^/admin
cookie:
set_on_change: true
switcher:
#use_controller: true
show_current_locale: true
#use_referrer: true
redirect_to_route: fallback_route
redirect_statuscode: 302
disable_vary_header: true
I added the {{ locale_switcher() }} code to load the template of Locale Switcher.
When I change the language it is changing in URL ?_locale=en or _locale=fr but it is not changing translation even not sonata page as per requested language.
As you can see i set guessing as a cookie but it is not stored in a cookie too, i tryied to debug the event function in lunetics\locale-bundle\Lunetics\LocaleBundle\EventListener LocaleUpdateListener.php
public function onLocaleChange(FilterLocaleSwitchEvent $event)
{
echo $this->locale = $event->getLocale();die();
$this->updateCookie($event->getRequest(), $this->localeCookie->setCookieOnChange());
$this->updateSession();
}
but the listener is not calling, I don't know maybe I missed some configuration or anything.
Please help me to solve this problem and hope my site will one in cookie locale instead of default locale always.
Thanks In Advance
Hi,
Please help me with the issue.
I had installed the dependency by executing composer command, I have Lunatics package now in my vendor folder and I did configuration too.
My Config:
I added the {{ locale_switcher() }} code to load the template of Locale Switcher.
When I change the language it is changing in URL ?_locale=en or _locale=fr but it is not changing translation even not sonata page as per requested language.
As you can see i set guessing as a cookie but it is not stored in a cookie too, i tryied to debug the event function in lunetics\locale-bundle\Lunetics\LocaleBundle\EventListener LocaleUpdateListener.php
but the listener is not calling, I don't know maybe I missed some configuration or anything.
Please help me to solve this problem and hope my site will one in cookie locale instead of default locale always.
Thanks In Advance