content = (this._routingSegmentLoader.GetRoutingSegments(current.ContentLink, null).FirstOrDefault((IRoutable r) => string.Equals(r.RouteSegment, urlSegment, StringComparison.OrdinalIgnoreCase)) as IContent);
The call to GetRoutingSegments() returns all the language branches but it did not prioritize the list in any way. The subsequent call to FirstOrDefault() simply takes the first branch which might or might not match the visitor's current language.We're working around this bug by injecting in our custom IUrlSegmentRouter via IoC (subclassing DefaultUrlSegmentRouter). In our code, we sort the results from GetRoutingSegments so that the branch corresponding to the prefered language would come up top.Please advice if this is the correct approach (we've not encountered anything weird so far, but who knows :).And I've just noticed issue#90086 http://world.episerver.com/Support/Bug-list-beta/bug/90086/ in Patch 4 which sounds similar from the description. Can anyone confirm that the patch fixes this same issue?
How about hooking into the UrlRewriteProvider to one of the Convert to Internal events. And let the epslanguage query come from the cookie instead of the url segment?