The lang attribute is not included by default, but you can add it with the following approach:
- Make a copy of the following file  ~/CMSPages/PortalTemplate.aspx, (for example, naming it something like CustomPortalTemplate.aspx)
- Edit the CustomPortalTemplate.aspx file
- In the <html>tag, add the following:lang = <% = Lang%>
- Edit the CustomPortalTemplate.aspx.cs file
- Add a Lang property:
protected string Lang {get; set; }
- 
In the OnPreRendermethod, set the Lang property, for example based on the document culture:Lang = this.CurrentPage.DocumentCulture;(if you only want a 2-letter code, use CurrentPage.DocumentCulture.Substring (0, 2))
 
- 
Save the files and edit the main web.config file, adding the following key:
<add key = "CMSPortalTemplatePage" value = "~/CMSPages/CustomPortalTemplate.aspx">
 
After these changes, you should see a lang attribute on all pages.