首頁 美術繪圖 | 美術設計 | 熱門標籤 | 首選 | 首頁宣傳 | 近期作品 論壇: 發表 | 美術工作 | 美術比賽 | 展覽活動 | 美術相關 | 一般討論 | 美術同好 CG 討論 :: Photoshop | Painter | 3D 行動 | AMP

【 立即註冊 】 : 更改個人資料 : : 登入

會員名稱: 登入密碼: 保持登入

HTML Lang 屬性使用 "zh-Hant(zh-Hans)" 或 "zh-TW(zh-CN)" 該用哪一種

發表新主題 回覆主題 討論區 Windows, Linux, Perl, PHP, C/C++, Driver, Web 理論、應用、硬體、軟體

| 1頁, 共1
人氣點閱:13527 發表人
HTML Lang 屬性使用 "zh-Hant(zh-Hans)" 或 "zh-TW(zh-CN)" 該用哪一種 2014-10-01 16:35
/ / /

HTML Lang 屬性使用 "zh-Hant(zh-Hans)" 或 "zh-TW(zh-CN)" 或 "zh-Hant-TW(zh-Hans-CN)"




*** 以下觀察測試使用 2014 Google Chrome 繁體中文瀏覽器:: view-source:example.com ***
使用不同的瀏覽器,設定不同的語言偏好,可能會導致「完全不同」的結果。

結果僅供參考!


使用 lang="zh" 的中文網站


=> http://linkdlin.com (lang="zh"
=> http://bing.com (lang="zh"


使用 lang="zh-Hant" 的中文網站


=> http://www.facebook.com (lang="zh-Hant"
=> http://live.com (lang="zh-Hant", www.hotmail.com 都一樣


使用 lang="zh-TW" or lang="zh-CN" 的中文網站


=> http://www.google.com.tw (zh-TW)
=> http://tw.yahoo.com (zh-TW)
=> http://twitter.com (zh-TW)
=> http://www.appledaily.com.tw (zh-TW)
=> http://mobile01.com (zh-TW)
=> http://yam.com (zh-TW)
=> http://nownews.com (zh-TW)
=> http://tw.msn.com (zh-TW)
=> http://www.apple.com/tw/ (zh-TW)
=> http://www.pixnet.net (注意:2008 ~ 2014, pixnet 都是用 zh_TW 而非 zh-TW
=> http://qq.com (zh-CN)


沒有指定 html::lang 屬性的中文網站


=> http://mail.google.com/
=> http://blogspot.com or http://blogspot.tw
=> http://www.ettoday.net
=> http://xuite.net
=> http://www.ltn.com.tw
=> http://www.pchome.com.tw or http://shopping.pchome.com.tw
=> http://udn.com
=> http://www.chinatimes.com
=> http://www.104.com.tw
=> http://www.gamer.com.tw
=> http://tw.taobao.com
=> http://tw.baidu.com or http://baidu.com/



Q: 理論上...?
Ans: 目前觀察沒有定論,但從 w3c.org 等網站文件來看,理論上應該是要用 zh-Hant or zh-Hant-TW (or, zh-Hans + zh-Hans-CN)

REF: W3C http://www.w3.org/International/questions/qa-lang-why
REF: IANA http://www.iana.org/assignments/lang-tags/zh-Hant
REF: IANA http://www.iana.org/assignments/lang-tags/zh-Hant-TW (就是沒有 zh-TW
HTML 4.01: http://www.w3.org/TR/html401/struct/dirlang.html
HTML 5: http://www.w3.org/TR/html5/dom.htm
IETF BCP47: http://www.ietf.org/rfc/bcp/bcp47.txt

Q: 但實際上呢?
Ans: 用 "zh-TW" or "zh-CN" or 甚至沒指定的網站反而是多數;猜測可能為了兼顧相容性。

Q: 這對 SEO/SERP 是否有影響?
Ans: 不明,這是值得實驗測試的問題。


Q: 類似 lang="zh_TW" 的寫法 OK 嗎? (e.g. www.pixnet.net )
Ans: "zh_TW" (underline 底線)理論上是錯的,應該「至少」改成 "zh-TW"(dash 減號)。
但猜測「現代/最新」瀏覽器應該還是可以處理這類相容問題。
zh_XX(底線)看起來就是 bash/C/Perl/PHP 等等 C-like language constant/variant 的用法,
並非 w3c 建議字串格式。

service



繪圖畫廊設計藝廊
攝影相簿留言板
最愛收藏分類標籤
暱稱: staff
註冊: 2007-03-30
發表: 48

V幣: 2703
/ / /














資訊相關理論、技術、管理、應用、產品等
發表新主題 回覆主題