When I try to access global 'locales' var with a wrong locale in url (example : www.mywebsite.com/sdlkgdsg/page/1 instead of a valid www.mywebsite.com/en/page/1), i get a
Twig_Error_Runtime in Template.php line 487: Variable "locales" does not exist in ...
For example, It happens when I use localeswitcher twig function.
So, after some tests, I found it can be resolved by setting a high priority on before in translateExtension registerServices :
Hello everybody,
When I try to access global 'locales' var with a wrong locale in url (example : www.mywebsite.com/sdlkgdsg/page/1 instead of a valid www.mywebsite.com/en/page/1), i get a
Twig_Error_Runtime in Template.php line 487: Variable "locales" does not exist in ...
For example, It happens when I use localeswitcher twig function.
So, after some tests, I found it can be resolved by setting a high priority on before in translateExtension registerServices :
I don't know if it's the best way to fix it. Anybody have a better suggestion ?
Another question : is it possible to define a default fallback route when locale in url is not valid ?
Thx !