Re: Redundant lang and dir attributes
On Wed, 26 Feb 2014, Tibor Simko wrote: However, I see for instance that google.com.hk still uses zh-CN... Maybe let's quick check with Xiaoli to see what the current practices are? So Xiaoli had a look at major Chinese web sites and she says that they use the old language codes. Hence I'm not sure whether we have to accelerate anything in this direction. Probably not worth the trouble yet? Best regards -- Tibor Simko
Re: Redundant lang and dir attributes
Le mar 25 fév 2014 16:46:07 CET, Tibor Simko a écrit : On Tue, 25 Feb 2014, Yoan Blanc wrote: The master, 1.1 and 1.0 branches are quite similar, only the lang is repeated though: [...] Is there a good reason for having (or keeping) those duplications? I have the feeling that having it only in the html tag is good enough. Yes, I think it should be sufficient. Looking at the commit history, lang/dir were first added to body for RTL support (in 3d4215b6), and later lang came independently to html for Open Graph support (in fa16d5f0). It may be enough to have both lang/dir in html only. Can you please prepare a branch for master so that we'd test how a few popular browsers behave? http://invenio-software.org/repo/personal/invenio-yblanc/log/?h=master-lang-dir I've also moved the content-type higher to be on the safe side¹. Even though, the content-type is already sent by the webserver so we could simply remove it. -- Yoan http://www.w3.org/TR/html5/document-metadata.html#charset
Re: Redundant lang and dir attributes
Le mer 26 fév 2014 14:58:33 CET, Yoan Blanc a écrit : Le mar 25 fév 2014 16:46:07 CET, Tibor Simko a écrit : On Tue, 25 Feb 2014, Yoan Blanc wrote: The master, 1.1 and 1.0 branches are quite similar, only the lang is repeated though: [...] Is there a good reason for having (or keeping) those duplications? I have the feeling that having it only in the html tag is good enough. Yes, I think it should be sufficient. Looking at the commit history, lang/dir were first added to body for RTL support (in 3d4215b6), and later lang came independently to html for Open Graph support (in fa16d5f0). It may be enough to have both lang/dir in html only. Can you please prepare a branch for master so that we'd test how a few popular browsers behave? http://invenio-software.org/repo/personal/invenio-yblanc/log/?h=master-lang-dir I've also moved the content-type higher to be on the safe side¹. Even though, the content-type is already sent by the webserver so we could simply remove it. -- Yoan http://www.w3.org/TR/html5/document-metadata.html#charset A related problem with the `ln_iso_639_a` and the way it's built (next uses both the short and the long versions). We have the information about traditional vs simplified chinese and yet display the same language for both: zh. It's totally okay to have the full one in the lang attribute. Also, some stuff changed in the past years regarding zh_TW and zh_CN being relabelled as zh-Hant and zh-Hans. Use zh-Hans and zh-Hant for Simplified and Traditional Chinese, respectively, in language attribute values, and possibly also for Content-Language values. Simplified vs. Traditional Chinese is a distinction based on script. Until recently there was no provision for using script information in language tags, so zh-CN (Chinese spoken in Mainland China) was commonly used to label Simplified Chinese writing, and zh-TW (Chinese spoken in Taiwan) was commonly used for Traditional Chinese writing. Apart from the fact that this is mislabeled, you could not guarantee that others would recognize these conventions, or even follow them. For example, some people used zh-HK to represent Traditional Chinese. You should start using the new tags as soon as possible in order to introduce widespread interoperability quickly. There is already substantial use of these codes. http://www.w3.org/TR/i18n-html-tech-lang/#ri20040429.113217290 -- Yoan
Re: Redundant lang and dir attributes
On Wed, 26 Feb 2014, Yoan Blanc wrote: http://invenio-software.org/repo/personal/invenio-yblanc/log/?h=master-lang-dir Thanks, reviewed, cherry-picked, amended commit log, and merged to master. Please check and delete your personal branch. Best regards -- Tibor Simko
Re: Redundant lang and dir attributes
On Wed, 26 Feb 2014, Yoan Blanc wrote: A related problem with the `ln_iso_639_a` and the way it's built (next uses both the short and the long versions). We have the information about traditional vs simplified chinese and yet display the same language for both: zh. It's totally okay to have the full one in the lang attribute. Also, some stuff changed in the past years regarding zh_TW and zh_CN being relabelled as zh-Hant and zh-Hans. OK, why don't we try using the new names? To ease the process, we can still keep using zh_CN locale names (as in most GNU/Linux locales so far) and use zh-Han* names only for the web. However, I see for instance that google.com.hk still uses zh-CN... Maybe let's quick check with Xiaoli to see what the current practices are? Best regards -- Tibor Simko