Jim Royal wrote:
> Living in Montreal, I am required to produce web content in both
> official languages. So, my English sites contain links to French
> content, and vice versa.
>
> For database-driven sites, pulling up the content in the right language
> is merely part of the query. But for static sites, all I've been able
> to do is provide a link to the main page in the alternate language, but
> that's a bit awkward for the site visitor.
But is it really all that likely your visitors will want to look at BOTH
languages? Just one or the other, surely?
I think the best option would be to use a LINK element and let the UAs deal
with it or not as they see fit. Something like this should do:
<LINK title="French version" type="text/html" rel="alternate" hreflang="fr"
href="/fr/services/general.shtml">
(see <http://www.w3.org/TR/REC-html40/struct/links.html#h-12.3.3>.)
Alternatively, if you're using an Apache server you should consider using
its content negotiation features.
> Is there a way to pick up the URL for the current page, rewrite it on
> the fly, and call up the equivalent page in the alternate language? For
> example, to change this:
>
> /en/services/general.shtml
>
> into this:
>
> /fr/services/general.shtml
>
> Javascript? PHP?
If you want to do it this way, add a form with a select menu
("French","English") and process it using client-side javascript (based on
the value of location.href) or server-side PHP (based on the value of
$_SERVER[¹HTTP_REFERER¹]).
Phil
--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/