HTML: Multiple language meta descriptions? - html

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" />

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:
https://www.rfc-editor.org/rfc/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

The lang attribute may be placed on any element, not just the root html element or meta name="description". So you can write <html lang="en"><body>The Chinese translation of Stack Overflow is <span lang="zh-Hans">堆叠溢位</span></body></html> and it's good to put those lang attributes in because it helps visual browsers to choose the correct fonts and audio browsers for blind people to choose the correct voice.
Some non-Google search engines still want the obsolete <meta http-equiv="content-language"> markup (in particular Bing and Baidu reportedly still want these) but I have no idea if their implementations are standards-compliant enough to cope with two or more languages listed in http-equiv="content-language" (try it and see).
As for whether search engines will honour multiple instances of meta name="description" in multiple languages (with appropriate lang attributes), that depends on the search engine. Google have indicated they don't like side-by-side translations, which is a pity for those of us discussing foreign languages.

Related

How to localise html5 meta tag information

I am building a website designed for 4 different languages, using Sinatra, and using the I18n libs to insert localised content, but I am wondering what to do about the standard HTML5 meta tags for things like description and keywords, and how Google and other search engines will treat them if I localise the content in those tags.
Ideally I want to be able to tell Google (et al), perhaps via information in a sitemap.xml file or something (though I'm not certain that's even possible), that the site may be parsed in these 4 languages, and so present correctly localised keywords, and descriptions to users depending on their locale preference.
Likewise I want to be able to localise the information going out to Twitter and Facebook by localising the relevant og meta tags, and twitter:card` meta tags.
Note: the actual page URLs will be the same no matter the language chosen, localised content is rendered in the Slim templates themselves.
Is it enough, for example, to specify
html lang='de_DE'
I'm after a best-practice and DRY way of achieving nicely localised search result summary information for my international users.
If the different language versions reside at the same URL, then what search engines get is what your server sends to a browser that does specify any language preferences. According to your description, it thus seems that they always get the default (English) version. No meta tags or lang attributes can affect this. (And search engines ignore lang attributes.)
So you should arrange thing so that each language version of a page has a URL of its own. (The difference could be in the query part only, e.g. ?lang=de-DE at the end.) Moreover, the versions should be interlinked, with link elements or with visible a links, so that when a search engine has found one version, it will find the other versions, too, just by following links.
P.S. Writing <meta name=keywords ...> tags is probably waste of time. Google has ignored them long ago.
You can provide meta elements with content in different languages on the same HTML document by using the lang attribute:
<meta name="description" lang="de" content="…" />
<meta name="description" lang="en" content="…" />
<meta name="description" lang="es" content="…" />
<meta name="description" lang="fr" content="…" />
If any third party services like Google or Facebook recognize this is a different question which cannot be answered in general, depends on the specific service, context and the point in time, as things might change rapidly.
However (as Jukka K. Korpela notes, too), in general you should use separate URLs for translations. Give users (and search enginges etc.) the ability to link to a specific language version.

more than one keywords metatag on the website

Is it correct approach to have more than one keywords metatag on the website ?
for example:
<meta name="keywords" content="test1" />
<meta name="keywords" content="test2" />
or is it an error ?
Thank You very much for help
As taken from Webmasters
The keywords meta tag doesn't do anything anymore, at least as far as most search engines are concerned. You're trying to solve a problem that doesn't exist. Search engines index by content nowadays, and they do that without your help.
See the Wikipedia article on the meta tag:
Search engines began dropping support for metadata provided by the meta element in 1998, and by the early 2000s, most search engines had veered completely away from reliance on meta elements. In July 2002, AltaVista, one of the last major search engines to still offer support, finally stopped considering them.
It is not an error; any number of meta tags may be used. But as #Nerd-Herd points out, keyword meta tags are hardly useful at all.
If you use such tags, there is usually no reason to use more than one of them per page, as it is simpler to write just <meta name="keywords" content="test1, test2">.
In theory, if you use keywords of different languages, then you have a reason to use more than one tag, because the language identification is per element, e.g.
<meta name="keywords" content="liberty" lang="en">
<meta name="keywords" content="liberté" lang="fr">
But this is just theoretical, since search engines probably ignore keyword meta tags, and almost surely ignore lang attributes in general.
Meta tags "description" and "keywords" are very important. They should be distinct for each page of website.
We read in "Google Search Engine Optimization Starter Guide"
Description meta tags are important because Google might use
them as snippets for your pages. Note that we say "might" because
Google may choose to use a relevant section of your page's visible
text if it does a good job of matching up with a user's query.
Adding description meta tags to each of your pages is always a good practice in case Google
cannot find a good selection of text to use in the snippet. -Page 6
Emphasise of theirs.

Difference between meta tag content and tag content?

What is the difference between meta tag content and the title ?
I know title will be displayed in the title bar and the meta tag will not be displayed and its for w3 stadards we are just adding it in our html code ...but why we should do that ? what are the uses of it ? I wish to know detailed and clear explanation about it ...anyone please clear me up
What is the difference between
<title>Title of the website</title>
AND
<meta name="keywords" content="This website is for online shopping" />
The <meta name="keywords" ...> element has been deprecated (it was never appropriate for what the <meta> tag was designed for anyway). From Wikipedia's article on Meta element:
Search engines began dropping support for metadata provided by the meta element in 1998, and by the early 2000s, most search engines had veered completely away from reliance on meta elements. In July 2002, AltaVista, one of the last major search engines to still offer support, finally stopped considering them.[2]
Meta elements in HTML can be used for a myriad of things, including linking to other files, like stylesheets or scripts, providing additional information about the content of the page, providing additional instructions to the browser, and much, much more.
A good place to start would be the Wikipedia entry on meta elements and branch out from the links and sources provided there.

SEO Language information

I was wondering if defining your language in HTML is better for search enigines. For example, I've got a French site, then i've got three options:
1.) have faith that google can say my site is french
2.) define language in the HTML tag
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="fr">
3.) define language in a meta tag
<meta http-equiv="content-language" content="FR-fr" />
Which option you believe is best? Or which combination of options?
language (language (i.e.: french) != location market (i.e. france)) detection is done on a per page basis (not per site).
it detects the language via the words used on the page (and in the URL), it does not care about the HTML tag (1) and the meta tag (2).
(you can test via the language detect api what language google thinks your page is using http://code.google.com/apis/language/translate/v1/using_rest_langdetect.html )
i always go for the 1 page === 1 language approche. i always make sure that i only have one language per page (translating all of the navigation, making sure that other language content does not and can not show up on the page)
It's probably better to define anything you can and have the search engine disregard it, than to not and leave it completely up to chance. The more information you give them the better.
Usually, I stick with the 3rd one, the content-language meta tag, as described here.
probabay should be on webmasters.stackexchange.com but anyways
You should combine 2 and 3. Faith does not work with bots/spiders.
2.) define language in the HTML tag
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="fr">
3.) define language in a meta tag
<meta http-equiv="content-language" content="FR-fr" />
good luck
On top of defining your language in the html you can signup for the Google Webmaster tools. On that site you can set your geographic target to France (Site configuration -> Settings).
http://www.google.com/webmasters/tools
andrewk is right - use 2 or 3 , but take into account that in most cases the language will be detected by the robot it self automatically.

What's the difference between the lang attribute and the <meta http-equiv="Content-Language" content="en-US"> tag?

I was wondering what's the significance of using the "lang" attribute and how that differs from using the meta "Content-Language" tag?
Consider the following code:
<html lang="en">
<head>
<meta http-equiv="Content-Language" content="en-US">
</head>...
My assumption is that the browser is reading the meta tag's value, but the DOM is concerned with the "lang" attribute. Is this correct? Are there any nuances I'm unaware of?
The lang attribute (on the HTML element) specifies the language for the document (unless overridden with another lang attribute which can change the language for a section of the document).
The Content-Language HTTP header specifies the language of the intended audience. This is not the same as the language the document is actually written in. For example, part of a French language course could consist of a page written in French, but Content-Language would be en as it was intended for English speakers learning French.
From the spec:
The Content-Language entity-header field describes the natural language(s) of the intended audience for the enclosed entity. Note that this might not be equivalent to all the languages used within the entity-body.
Meta HTTP-equiv is the poor man's HTTP header. It has all the meaning of the real HTTP header, but less respect (and support).
As a rule of thumb, Content-Language is of more interest to search engines and the lang attribute is of more interest to screen readers.
HTML5 update: meta http-equiv="Content-Language" is obsolete, and the lang attribute can be used on all elements.
They mean the same thing — setting the language of the content in question — however the lang attribute has a higher precedence. See 8.1.2 Inheritance of language codes. They handle different use cases — the lang attribute can be set <i lang=la>exempla gratis</i> on an individual element, while the Content-Language header can be configured globally by the server to apply to a whole set of documents.
Your examples show two equivalent ways to set the language of the html element, but since the lang attribute takes precedence, the value will be "en" and not "en-US".