Modern HTML lang Attribute for Chinese Websites
Chinese is pretty complicated, same applies to <html lang="__WTF?__">
attribute.
Fortunately, I've already summarized it up:
zh-CN
/zh-TW
/zh-HK
/zh-SG
still works fine, even if there are opposite opinions;zh-cmn-Hans-CN
works best for contents localized for China Mainland users:zh
for backward compatibility since it's been widely adopted by mainstream websites and crawlers, etc;cmn
denotes Chinese Mandarin, the official speech of Chinese;Hans
denotes that the contents are in Simplified Chinese form;CN
denotes the contents were specifically adapted for China Mainland.
zh-Hant
works great for contents written in Traditional Chinese;- When in doubt, use bare
zh
.
Example
<!DOCTYPE html>
<html lang="zh-cmn-Hans-CN"> <meta charset="UTF-8"/>
<title>你好,世界!</title>
...