Filters the language attributes for display in the ‘html’ tag.
Parameters
$output
string- A space-separated list of language attributes.
$doctype
string- 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