Head <link> and language switch

windows

Guest
Stumbled over this code on alternate language versions for insertion to the head of a document:<br />
<br />
<link rel="alternate" href=http://www.webdeveloper.com/forum/archive/index.php/"index.fr.html" hreflang="fr" lang="fr" title="Version fran閺癷se"><br />
<br />
Question: What does this code actually do? What can it be used for?<br />
<br />
Secondly: Is there a server side script to sniff visitors language setting and prompt the appropriate page for their language setting?<br />
<br />
Finally: Is there a non-javascript way of giving the visitor the possibilty of chosing another language version of the page?<br />
<br />
TIA :)<br />
<br />
Edit: Well, the last line reads silly when rationalizing it. I could simple use SSI to include hyperlinks to language versions in the same directory, like: index.shtml for the English language version and index.fr.shtml for the French language version.<br />
The problem then would be, that search engines would index the pages with their full URL (complete extentions) as where I try to get search engines to index directory URL's only, so I can change either file structure or the underlying technology (HTML to PHP or ASP) without having to worry about new search engine indexing.<!--content-->1) Tells search engines where to find this page in an alternative language (French). W3C (<!-- m --><a class="postlink" href="http://www.w3.org/TR/html401/struct/links.html#h-12.3.3">http://www.w3.org/TR/html401/struct/links.html#h-12.3.3</a><!-- m -->)<br />
Browsers should be able to select the appropriate language page for the user according to their default selection. I did a simple test on this - didn't work :rolleyes: <br />
2) No.<!--content-->Fang,<br />
<br />
Thanks for your reply. :)<br />
<br />
As to the non-javascript thing. After a bit of thinking I came to the conclusion a server side include with a simple hyperlink would do the trick - when using href=http://www.webdeveloper.com/forum/archive/index.php/"language/" as path.<br />
<br />
Then, the URL would end up looking like this for the alternative language version:<br />
<br />
domain.ext/directory/language/<br />
<br />
And like this for the default language version:<br />
<br />
domain.ext/directory/<br />
<br />
Opens up for parallel alternative language versions on the same server with no search engine confusion since one would be consistent in naming the default language files "index.shtml" and the alternative language files "index.language.shtml".<br />
<br />
Finally, let the htaccess DirectoryIndex command do the indexing work. Really neat. :D <br />
<br />
BTW... No need for the <link> thingy - since it isn't proactive.<!--content-->
 
Back
Top