Define multiple languages in html root element's lang attribute?

前端 未结 5 1120
执念已碎
执念已碎 2021-02-01 03:52

I want to determine more than one language for a document, because it\'s available in more than one language. If I use:



        
5条回答
  •  你的背包
    2021-02-01 04:45

    The meaning of the Content-Language HTTP header, and hence its meta tag surrogate, is that it declares the languages of the document, or the languages of the intended audience (the relevant RFCs are contradicting), not the languages of some other documents (like translations of the current document). The practical effect of header is small, probably limited to using the first language named as the language of the document, if there is no language information in HTML markup.

    To indicate that a document is available in other languages, you can use tags like

     
    

    See 12.3.3 Links and search engines in HTML 4.01 spec.

    There is no guarantee that this will have any effect. It might affect search engines, but not more than a normal link would do. Some old browser versions had commands for selecting alternate versions of a document, based on elements like this, but the feature seems to have been dropped.

提交回复
热议问题