How can you retrieve the language of a WordPress website, without the added region suffix attached to it? In other words, just get the language, without the entire locale.
E.g. <html lang="en"> instead of <html lang="en-US">
I saw a related question but it doesn't provide the exact solution, both of these are same:
<html <?php language_attributes();?>><html lang="<?php bloginfo("language"); ?>">
The reason I'm wondering this is for theming purposes, because I have noticed (after much testing) negative SEO impact on some websites that specify the region instead of just the language. Google has claimed repeatedly that this shouldn't be the case, and that they practically ignore the <html lang="en-US"> type of flags, but I have concluded this simply isn't true after reviewing lots of SERPs from various global locations, and would like to allow our WordPress theme users to simply have the language specified without the region.
I know this can be done with some PHP magic, but I'm wondering if any existing function?