Broken language switch when moving in browser history

If the language in the url changes via a history.back, the language selector and the language of the page do not change.

This was caused by 3ecacadc.