Filters the language attributes for display in the ‘html’ tag.
Parameters
$outputstring- A space-separated list of language attributes.
$doctypestring- The type of HTML document (
xhtml|html).
Source
return apply_filters( 'language_attributes', $output, $doctype );
Here is a function to force the locale of the HTML lang attribute without breaking the other attributes like dir