Support "x-*" language codes by removing length limit
Forcing language codes to be <= 5 characters does not allow for "x-*" codes, which can be arbitrarily long:
"The most widely used standard for identifying languages in Internet documents (such as in HTTP headers or HTML metadata or in the XML lang attribute) is RFC 4646 (formerly RFC 3066). In that standard, a three-letter identifier is interpreted as being a code from the ISO 639-2 standard. RFC 4646 offers an extension mechanism of tags beginning with x- to handle custom codes for languages not covered in the standard." (Source: http://www.ethnologue.com/codes/)
There are also "i-*" codes for grandfathered codes. See also the w3c HTML4 spec for the
lang attribute and RFC 17666.