LocaleBundle icon indicating copy to clipboard operation
LocaleBundle copied to clipboard

routing_dev.yml triggers locale change

Open jeroenvdgulik opened this issue 10 years ago • 2 comments

The call to _wdt route triggers a new locale update. If for instance your url schema is /nl/news but your browser is set to 'en_US', the "normal" request will set the locale to 'nl', but the dev route (without locale) will set the locale back to 'en_US', which in case you use a cookie will trigger 2 changes: first the correct 'nl', then the incorrect 'en_US'

jeroenvdgulik avatar Aug 26 '15 11:08 jeroenvdgulik

that would probably also affect any ajax calls that have no locale in the url.

but its strange, usually once the locale is determined and in the cookie, it should stick when no locale is explicitly found in the path/domain/whatever. could this problem be because of some specific setup you did?

dbu avatar Aug 26 '15 13:08 dbu

The problem is that it won't find a locale for the path guesser, but it will find a locale for the browser guesser, which is different than the cookie setting, thus triggering a change.

edit "fixed" the issues by giving cookie higher priority in the guesser list

jeroenvdgulik avatar Aug 26 '15 13:08 jeroenvdgulik