Drupal8: CiviCRM menu does not use the correct locale
How to reproduce:
- Create a bilingual Drupal site, with the locale module
- Setup CiviCRM as multilingual, bilingual, using URL prefix language detection (example.org/fr/civicrm)
Result: the menu is always in the default CiviCRM language (or default Drupal language?).
Debugging the issue, in Drupal, the menu JS would be called this way:
https://example.org/en/civicrm/ajax/menujs/2/en_US/1/5H7zVVcT
However in D8 it is being called without the language prefix:
https://example.org/civicrm/ajax/menujs/2/en_US/1/5H7zVVcT
I suspect it is related to CRM_Utils_System::languageNegotiationURL()
, which seems to test for the locale
module.