multilanguage lang tag and JFactory::getDocument() conflict #20157
Steps to reproduce the issue
In a multilanguage website, create a system plugin with just that :
the lang html attribute does not update to the current language, still remains on the default language
instead of (for a french based website) when switching on the english language
System information (as much as possible)
PHP Version 7.1.8
You shouldn't fetch the document in the plugin constructor. That's the issue. With that, you force a document creation prior to when the CMS actually would do it.
Move that code to the plugin event where you actually use it, and then it will work fine.