折腾:
【整理】web的app中的manifest.json的作用和参数含义
期间,看到:
提到了lang的写法。
本来以为应该是,之前常看到的zh-CN
但是进去官网定义:
https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
却搜不到zh-cn
但是找到了个zh-cmn开头的一些定义:
然后去搜:
zh-cmn-Hans zh-cn
搞清楚到底用哪个
lang=”zh-cn”、lang=“zh”、lang=“zh-cmn-Hans – weixin_36082485的博客 – CSDN博客
看到说是:
zh-cmn之类的都是已经不符合规范的。
以为其说错了呢。
结果再去官网
https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
确认后,才注意到,zh-cmn之类的,后面都有个Deprecated,表示已经废弃了:
%% Type: redundant Tag: zh-cmn Description: Mandarin Chinese Added: 2005-07-15 Deprecated: 2009-07-29 Preferred-Value: cmn %% Type: redundant Tag: zh-cmn-Hans Description: Mandarin Chinese (Simplified) Added: 2005-07-15 Deprecated: 2009-07-29 Preferred-Value: cmn-Hans %% Type: redundant Tag: zh-cmn-Hant Description: Mandarin Chinese (Traditional) Added: 2005-07-15 Deprecated: 2009-07-29 Preferred-Value: cmn-Hant |
其实官方写的够清楚了:
zh-cmn表示Mandarin Chinese,大陆中文,2005年添加进来的,2009年就废弃不用了,推荐改为cmn
zh-cmn-Hans表示Mandarin Chinese,大陆简体中文,2005年添加进来的,2009年就废弃不用了,推荐改为cmn-Hans
zh-cmn-Hant表示Mandarin Chinese,大陆繁体中文,2005年添加进来的,2009年就废弃不用了,推荐改为cmn-Hant
而对应的cmn之类的官网定义是:
%% Type: language Subtag: cmn Description: Mandarin Chinese Added: 2009-07-29 Macrolanguage: zh %% Type: extlang Subtag: cmn Description: Mandarin Chinese Added: 2009-07-29 Preferred-Value: cmn Prefix: zh Macrolanguage: zh %% Type: grandfathered Tag: zh-guoyu Description: Mandarin or Standard Chinese Added: 1999-12-18 Deprecated: 2005-07-15 Preferred-Value: cmn %% Type: redundant Tag: zh-cmn Description: Mandarin Chinese Added: 2005-07-15 Deprecated: 2009-07-29 Preferred-Value: cmn %% Type: redundant Tag: zh-cmn-Hans Description: Mandarin Chinese (Simplified) Added: 2005-07-15 Deprecated: 2009-07-29 Preferred-Value: cmn-Hans %% Type: redundant Tag: zh-cmn-Hant Description: Mandarin Chinese (Traditional) Added: 2005-07-15 Deprecated: 2009-07-29 Preferred-Value: cmn-Hant |
另外的:
zh-Hans
和
zh-Hant
%% Type: redundant Tag: zh-Hans Description: simplified Chinese Added: 2003-05-30 %% Type: redundant Tag: zh-Hans-CN Description: PRC Mainland Chinese in simplified script Added: 2005-04-13 %% Type: redundant Tag: zh-Hans-HK Description: Hong Kong Chinese in simplified script Added: 2005-04-11 %% Type: redundant Tag: zh-Hans-MO Description: Macao Chinese in simplified script Added: 2005-04-11 %% Type: redundant Tag: zh-Hans-SG Description: Singapore Chinese in simplified script Added: 2005-04-11 %% Type: redundant Tag: zh-Hans-TW Description: Taiwan Chinese in simplified script Added: 2005-04-11 %% Type: redundant Tag: zh-Hant Description: traditional Chinese Added: 2003-05-30 %% Type: redundant Tag: zh-Hant-CN Description: PRC Mainland Chinese in traditional script Added: 2005-04-13 %% Type: redundant Tag: zh-Hant-HK Description: Hong Kong Chinese in traditional script Added: 2005-04-11 %% Type: redundant Tag: zh-Hant-MO Description: Macao Chinese in traditional script Added: 2005-04-11 %% Type: redundant Tag: zh-Hant-SG Description: Singapore Chinese in traditional script Added: 2005-04-11 %% Type: redundant Tag: zh-Hant-TW Description: Taiwan Chinese in traditional script Added: 2005-04-11 %% Type: redundant Tag: zh-wuu Description: Shanghaiese or Wu Added: 1999-12-18 Deprecated: 2009-07-29 Preferred-Value: wuu %% Type: redundant Tag: zh-yue Description: Cantonese Added: 1999-12-18 Deprecated: 2009-07-29 Preferred-Value: yue |
【总结】
此处的,
想要表示,中国大陆中的简体中文(Mandarin Chinese (Simplified)),则
根据最新最官方:
https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
http://www.ietf.org/rfc/rfc4646.txt
的说法:
zh-cmn-Hans是旧的写法,不建议继续使用,建议改为cmn-Hans
但是根据:
language-script-region-variant-extension-privateuse
的逻辑,所以还是另外的:
zh-Hans-CN
比较易懂和明了。
而别处写的
zh
zh-CN
其实都不是标准写法。不建议继续使用。
【结论】
使用:
zh-Hans-CN
去表示:
中国大陆的简体中文
=中华人民共和国的简体中文
==Mandarin Chinese (Simplified)
==PRC Mainland Chinese in simplified
当然:如果考虑到其他的兼容性,其实也还是可以暂时继续使用:zh-CN的写法的。