If you look down one line, there's a comment about order requirements for LocaleURLMiddleware. I suggest doing something like that.