If you look at [this page on W3C's website](http://www.w3.org/TR/html401/struct/dirlang.html#h-8.1.1) you will see that this "subcode" is used to define differences from versions of a given language ("fr-FR" vs. "fr-CA" or "en-GB" vs. "en-US"). But you're right, it *can* be omitted.

```getDocLanguage()``` just retreive the locale name loaded. @nicosomb if you think there is a problem with "en-EN" it must be on the name of english locale.

By the way, @tcitworld the last substring is not a related to a "counrty" but a language version. See "cockney", for example ...


You can check the W3C Markup validator with those HTML codes:
```
<!DOCTYPE html>
<html lang="fr">
<head>
<title>Test</title>
</head>
<body>
</body>
</html>
```
```
<!DOCTYPE html>
<html lang="fr-FR">
<head>
<title>Test</title>
</head>
<body>
</body>
</html>
```
```
<!DOCTYPE html>
<html lang="fr-XXX">
<head>
<title>Test</title>
</head>
<body>
</body>
</html>
```