htmll lang=”de” but admin page in English

This is fixed. I made a small script to get this working.

Because it was a multi language site I just named the site’s to the language they should be in. So the English page is named English, German page is called German etc. Made a small php script to check what the page name is so a variable will fill this one in.

PHP code:

# Check language of page
$currentLang = get_bloginfo(); 

if ($currentLang == 'English') {
   $htmlLang = "en-GB";
}
elseif ($currentLang == 'German') {
   $htmlLang = "de";
}
# etc