site in two languages

Discussion in 'HTML' started by chlori, Jan 20, 2005.

  1. chlori

    chlori Guest

    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.

    --
    chlori
    chlori, Jan 20, 2005
    #1
    1. Advertising

  2. Hi,

    chlori wrote:
    >
    > 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

    --

    http://www.all-the-johnsons.co.uk

    Joy!
    Paul F. Johnson, Jan 20, 2005
    #2
    1. Advertising

  3. chlori <> wrote:

    > 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.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Jan 20, 2005
    #3
  4. chlori

    Jan Faerber Guest

    chlori wrote:

    > 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.




    --
    Jan

    http://linux.janfaerber.com
    Jan Faerber, Jan 20, 2005
    #4
  5. chlori

    Toby Inkster Guest

    chlori wrote:

    > 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.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Jan 21, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shapper
    Replies:
    10
    Views:
    561
    TDAVISJR
    Apr 25, 2005
  2. Jean Pierre Daviau

    meta for two languages

    Jean Pierre Daviau, Aug 10, 2005, in forum: HTML
    Replies:
    3
    Views:
    662
    Neredbojias
    Aug 11, 2005
  3. Karol Strugala

    two languages on jsp-page

    Karol Strugala, Apr 10, 2004, in forum: XML
    Replies:
    1
    Views:
    348
    Ashmodai
    Apr 13, 2004
  4. GenxLogic
    Replies:
    3
    Views:
    1,243
    andrewmcdonagh
    Dec 6, 2006
  5. Steven T. Hatton
    Replies:
    39
    Views:
    849
    Steven T. Hatton
    Jul 22, 2005
Loading...

Share This Page