HTML: Multiple language meta descriptions?

Zsolt Janes picture Zsolt Janes · Mar 31, 2015 · Viewed 21.5k times · Source

How can I set two language meta descriptions to my website?

Is this code google valid?

<meta name="description" lang="en" content="english blablabla" />
<meta name="description" lang="hu" content="hungary blablabla" />

Answer

exoddus picture exoddus · Mar 31, 2015

Check this post from Google Webmaster Central Blog: http://googlewebmastercentral.blogspot.com.es/2010/03/working-with-multilingual-websites.html

"Google tries to determine the main languages of each one of your pages. You can help to make language recognition easier if you stick to only one language per page and avoid side-by-side translations. Although Google can recognize a page as being in more than one language, we recommend using the same language for all elements of a page: headers, sidebars, menus, etc. Keep in mind that Google ignores all code-level language information, from “lang” attributes to Document Type Definitions (DTD). Some web editing programs create these attributes automatically, and therefore they aren’t very reliable when trying to determine the language of a webpage."

Some info about multi languages websites:

Since html "lang" attribute doesn't allow define multiple languages, and meta attribute for specify language is obsolete, according to W3 recommendations, it's better to specify language in the HTTP header.

HTTP/1.1·200·OK
Date:·Sat,·23·Jul·2011·07:28:50·GMT
Server:·Apache/2
Content-Location:·qa-http-and-lang.en.php
Vary:·negotiate,accept-language,Accept-Encoding
TCN:·choice
P3P:·policyref="http://www.w3.org/2001/05/P3P/p3p.xml"
Connection:·close
Transfer-Encoding:·chunked
Content-Type:·text/html; charset=utf-8
Content-Language:·en

Like the meta element with the http-equiv attribute set to Content-Language, the value of the HTTP header can be a comma-separated list of language tags

See: http://tools.ietf.org/html/rfc2616#section-14.12

As RFC2616 says:

Multiple languages MAY be listed for content that is intended for
   multiple audiences. For example, a rendition of the "Treaty of
   Waitangi," presented simultaneously in the original Maori and English
   versions, would call for

       Content-Language: mi, en

If you go to http://validator.w3.org/check and try to validate this:

<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<meta http-equiv="Content-Language" content="en,hu">
<meta charset="UTF-8">
</head>
<body>
<p>Test</p>
</body>
</html>

W3 validator tool says:

Line 5, Column 52: Using the meta element to specify the document-wide default language is obsolete. Consider specifying the language on the root element instead.

Then, if lang attribute on html tag doens't allow multiple languages, I think your best try will be specify it in HTTP header