The UrlAliasService:matchLanguageCode() doesn't works well with translations. (eZ/Publish/Core/Repository/URLAliasService.php
In foreach(), the languages are not ordered according to current siteaccess.
So, it returns the first match which isn't necessary in the current siteaccess's language.
- You have a article named "Media" with 2 translations, fre-FR, the main, and eng-GB
- The word "Media" is the same in french and english
- In the english siteaccess, from any page, you click on a link to the "Media" page
- In the matchLanguageCode(), fre-FR comes first and $pathElement match with $translation, so fre-FR is returned as the current language code, when in reality it's eng-GB