Site with choice of languages

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

What is the best way to create a site where the user can choose English
or Spanish?

Re: Site with choice of languages

Luigi P wrote:

Quoted text here. Click to load it

David Dorward       < <
                     Home is where the ~/.bashrc is

Re: Site with choice of languages

Quoted text here. Click to load it
I have been recently working on a multi-language survey site.  I'm not
finished thoroughly researching the issue, but you are welcome to visit the
project and I'll try to answer any questions.  I am curious to get feedback
from different browsers and people who speak other languages.



Re: Site with choice of languages

Quoted text here. Click to load it

Hi Luigi,
"Best" I can't say for sure, but here's what worked for me on a site
that had all of its content in English, Ukrainian and Russian --

The site has three subdomains called, and For new users arriving at the language-neutral home page, I read the HTTP_ACCEPT_LANGUAGE header and
redirect them to a language-specific subdomain as appropriate. If
there's such header, the site defaults to English.

The site is all PHP/database driven; one set of code builds pages for
all three subdomains. Each page on the site checks its URL and reads
content from the database based on the subdomain portion of the URL
('en', 'uk' or 'ru'). In other words, these three URLs all run the same
PHP script:

It's nice to have only one set of pages to maintain. The disadvantage is
that it demands that each page of content exists in each language. That
hasn't been a big problem on this site, but the opportunity for
awkwardness exists. For instance, I might want to add a page about the
Ukrainian Linux distro BLin Linux like so:

But the English and Russian versions of that page have to exist, too, so
what content to put on there? I'm not sure that visitors with their
language preference set to  English would be very interested in a
Cyrillic Linux distro.

Each page on the site has a link to the same version of the page in the
other two languages.

That's just one way to do it. I hope it helps you a bit.

Good luck

Philip /
Bulk HTML validation, link checking and more

Site Timeline