site in two languages

C

chlori

Hello

I will be making a site in German and English. I'm not
sure, what language should be default.

Pages like mozilla.org recognize my German Version
(Browser, Windows?) and suggest the download in German.

How do they do that?

Do you think it's a good idea for sites to check the
language of the user and give them their language as
default (with the option to change)? Disadvantages?

Thanks for your help.
 
P

Paul F. Johnson

Hi,
Pages like mozilla.org recognize my German Version (Browser, Windows?)
and suggest the download in German.

How do they do that?

Serverside - apache or a cgi script reads the users LANG setting and
acts accordingly
Do you think it's a good idea for sites to check the language of the
user and give them their language as default (with the option to
change)? Disadvantages?

Big disadvantage to it is say I move to Germany and speak blow all of
it. The server sees my locale is DE and everything is served up in German.

Much better idea is to have a multilingual site.

TTFN

Paul
 
J

Jukka K. Korpela

chlori said:
I will be making a site in German and English. I'm not
sure, what language should be default.

In principle, the language selected from the preferences that the user's
browser sends. (It's non-trivial, since there can be several languages in
those settings, with different q(uality) values, and they may need to be
compared with the q values of the versions on the server.)

In practice, English, unless you expect a definite majority of visitors to
have German as their native language. The point is that English is so
widespread on the Web that nobody gets too surprised.
Pages like mozilla.org recognize my German Version
(Browser, Windows?) and suggest the download in German.

How do they do that?

I don't know. At least mozilla.org doesn't do it the right way: I don't get
the German version even if I put German topmost in my preferences. They
might play some guessing game based on top level domain. That's a wrong way
of doing things, though not fatal, if each language version has explicit
links that point to the other versions.
Do you think it's a good idea for sites to check the
language of the user and give them their language as
default (with the option to change)?

In principle yes. In practice, you need to be a bit enthusiastic to bother
doing so. For a bilingual sites, it is reasonable (but necessary) to have
explicit links that link the two sites together. More on this, and on
working with user's preferences, see
http://www.cs.tut.fi/~jkorpela/multi/
Disadvantages?

The main disadvantage is that the user's language preferences are often
wrong, typically just the language of the browser's user interface - and
even if it happens to be the user's first preference, it's hardly the only
one. Though, in fact, I have heard rumors that some people really know one
language only.
 
J

Jan Faerber

chlori said:
Hello

I will be making a site in German and English. I'm not
sure, what language should be default.

Pages like mozilla.org recognize my German Version
(Browser, Windows?) and suggest the download in German.

How do they do that?

Do you think it's a good idea for sites to check the
language of the user and give them their language as
default (with the option to change)? Disadvantages?

Thanks for your help.

http://www.php.net/my.php

Here is a nice example of default english and the user can select another
language that will be stored in a cookie when cookies are enabled.
 
T

Toby Inkster

chlori said:
Do you think it's a good idea for sites to check the
language of the user and give them their language as
default (with the option to change)? Disadvantages?

Yes, I do.

Best way to do multi lingual:

- Check for a preferred language in the query string, eg:

http://www.example.org/somefile.php?lang=de

Send out the page in that language and set a cookie on the
browser: "lang=de".

- If there is no language in the query string, check for the
existance of a "lang" cookie. Send out the page in that
language.

- If there is no language cookie, check out the HTTP header
"Accept-Language". Send out the page in the user's preferred
language.

- For *every* page, make sure you include a form to let them
choose language.

Example form on foo.php:

<form action="foo.php" method="get">
<div>
<select name="lang">
<option value="en">English</option>
<option value="de">Deutsch</option>
</select>
<input type="submit" value=" -&gt; ">
</div>
</form>

Example form on bar.php:

<form action="bar.php" method="get">
<div>
<select name="lang">
<option value="en">English</option>
<option value="de">Deutsch</option>
</select>
<input type="submit" value=" -&gt; ">
</div>
</form>

That is, pages submit to themselves.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top