I'm sure this has been asked a million times before, and I've googled it a few times, but I'm struggling here and need your help.
Which is correct for the HTML5 LANG attribute? en-US or en_US?
For example;
<html lang="en-US">
or
<html lang="en_US">
Your opinions would be greatly appreciated
The spec uses a dash -
as a delimiter to specify language-extlang
: http://www.w3.org/International/articles/language-tags/ so:
<html lang="en-US">
This is almost always the case when specifying langauge. The exceptions are frameworks like Django they may use an _
instead on the backend.
According to BCP 47 (RFC 5646 and RFC 4647) "en-US" seems to be correct.
It refers to the IANA Language Subtag and Language Tag Extensions registries.
I suggest you should refer to the best practices.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With