Lang= "ZH-CN", lang= "en", lang= "Zh-cmn-hans"

Source: Internet
Author: User
Tags pear
Page Header Statement lang= "ZH-CN", lang= "en", lang= "Zh-cmn-hans" DifferenceWww.111cn.net Editor: Swteen Source: Reprint We now use the software will automatically add a statement in front, then in the head of the page statement lang= "ZH-CN", lang= "en", lang= "Zh-cmn-hans" What is the difference? Let's take a look at it below.

Single en and ZH-CN are obsolete usages.

The main problem is that en is now not a language code, but Macrolang, can be used as a language code is CMN (Mandarin), Yue (Cantonese), Wuu (WU) and so on. I usually recommend writing zh-cmn rather than CMN, mainly considering compatibility (at least to match en), and many software and frameworks have not been updated accordingly.

ZH-CN's problem is that in fact, most of the cases are marked with Simplified Chinese, but improper use of the region, which causes the same in Simplified Chinese zh-sg (Singapore), etc. can not match. The more typical is ZH-TW and ZH-HK. So in fact, you should use Zh-hans/zh-hant to express simplified and traditional. So the complete writing is Zh-cmn-hans, which represents the Mandarin/Mandarin written in Simplified Chinese. In general, there is no need to add the area code, unless you want to indicate regional specificity, generally the vocabulary is not the same (for example, Wikipedia's Continental simplified and new Simplified).

How to mark an example:

Simplified Chinese page: HTML Lang=zh-cmn-hans
Traditional Chinese page: HTML lang=zh-cmn-hant
English page: HTML lang=en

The need to add the region code is generally less, unless in order to emphasize the different areas of Chinese use differences. Like what:

<p lang= "Zh-cmn-hans" >
<b lang= "ZH-CMN-HANS-CN" > Pineapple </b> and <b lang= "zh-cmn-hant-tw" "pear </b> is actually the same kind of fruit. Only the mainland and Taiwan appellation is different, and new horse appellation is also different, called <b lang= "zh-cmn-hans-sg" > Yellow pear </b>.
</p>
Of course, for historical reasons, it is sometimes necessary to continue to use ZH-CN. For example, Chinese Wikipedia encyclopedia, the traditional zh-cn/zh-hk/zh-sg/zh-tw (according to the standard should use ZH-CMN-HANS-CN, ZH-CMN-HANT-HK, ZH-CMN-HANS-SG, ZH-CMN-HANT-TW). At this time, the reasonable software behavior, is transforms the ZH-CN and so on to Zh-cmn-hans (namely translates into the most common misuse the corresponding actual standard formulation).

In fact, the relevant standards, there is a certain lag. For example, the css: lang selector, does not support the choice of only simplified/Traditional Chinese (whether cmn or Yue or min and other Chinese dialects). Ideally, the CSS3 is upgraded to the syntax of the Lang selector, the advanced matching algorithm in BCP 47, supported by: lang (*-hans).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.