|
Posted by Toby A Inkster on 04/11/07 09:03
Ikke wrote:
> I'd like to set up a new site, which has to be multilingual (english, and
> my native language). However, the entire site will be written in html.
I'd recommend switching to using some kind of server-side scripting rather
than HTML. PHP would be one example. This would allow you to build in
logic and redirection into your site, making the experience a bit more
smooth.
My recommended logic for a multi-lingual site:
if ("?lang=XX" found in page URL)
{
Set a cookie "lang"="XX";
Set L to "XX";
}
elseif ("lang" cookie found)
{
Set L to value of "lang" cookie;
}
elseif (HTTP Referer is a page on your site and includes "?lang=XX")
{
Set L to "XX";
}
elseif ("Accept-Language" HTTP header found)
{
Set L to value of Accept-Language header;
}
elseif (you have GeoIP installed)
{
Determine geographic location of visitor from IP address;
If it's a Dutch-speaking country, set L to "nl";
If it's a English-speaking country, set L to "en";
Otherwise, set L to some default language;
}
else
{
Set L to some default language;
}
Offer links to "thispage?lang=en", "thispage?lang=nl", etc;
Output page in language L;
That way, visitors can choose their preferred language, but they will
normally shown an appropriate language by default.
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
Navigation:
[Reply to this message]
|