language redirect

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • peter

    language redirect

    hello,

    who knows if there is ascript that detects de country or language. I need
    this to sent for example dutch people to a dutch site and german to a german
    site.

    thanx peter


  • Russell Turner

    #2
    Re: language redirect

    "peter" <peterbal@wanad oo.nl> wrote in message news:<ndq8b.301 585$0W5.8282400 @pollux.casema. net>...[color=blue]
    > hello,
    >
    > who knows if there is ascript that detects de country or language. I need
    > this to sent for example dutch people to a dutch site and german to a german
    > site.
    >
    > thanx peter[/color]

    Hi Peter,

    You could try using the free GeoDirection service at
    http://www.geobytes.com/GeoDirection.htm to redirect users based on
    their location to a page that has the appropriate language for their
    country.

    Kind Regards
    Russell Turner

    Comment

    • Dr John Stockton

      #3
      Re: language redirect

      JRS: In article <c1874a8a.03091 80826.28f36750@ posting.google. com>, seen
      in news:comp.lang. javascript, Russell Turner <russ@geobytes. com> posted
      at Thu, 18 Sep 2003 09:26:29 :-[color=blue]
      >"peter" <peterbal@wanad oo.nl> wrote in message news:<ndq8b.301 585$0W5.8282400 @po
      >llux.casema.ne t>...[/color]
      [color=blue][color=green]
      >> who knows if there is ascript that detects de country or language. I need
      >> this to sent for example dutch people to a dutch site and german to a german
      >> site.[/color][/color]
      [color=blue]
      >You could try using the free GeoDirection service at
      >http://www.geobytes.com/GeoDirection.htm to redirect users based on
      >their location to a page that has the appropriate language for their
      >country.[/color]

      And what language do you assume for the UK, or Switzerland, or Finland,
      or Belgium (where EU HQ is); or New York, where the UN HQ is - or even
      the USA, which has a large Hispanic component?

      Or any University or Laboratory, where one is very likely to find
      foreign visitors and students - often using natively-configured
      computers?

      Or an Internet Cafe?

      The ONLY sensible way is to allow the user to choose; and, moreover, to
      change that choice freely.

      --
      © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 MIME. ©
      Web <URL:http://www.merlyn.demo n.co.uk/> - FAQish topics, acronyms, & links.
      I find MiniTrue useful for viewing/searching/altering files, at a DOS prompt;
      free, DOS/Win/UNIX, <URL:http://www.idiotsdelig ht.net/minitrue/> Update soon?

      Comment

      • Edo van der Zouwen

        #4
        Re: language redirect

        "peter" <peterbal@wanad oo.nl> wrote in
        news:ndq8b.3015 85$0W5.8282400@ pollux.casema.n et:
        [color=blue]
        > hello,
        >
        > who knows if there is ascript that detects de country or language. I
        > need this to sent for example dutch people to a dutch site and german
        > to a german site.
        >
        > thanx peter
        >
        >[/color]


        The following script checks the language of the browser, and redirect
        people to index_en.html, index_nl.html etc. Not written myself by the way,
        found it on: http://tech.irt.org/articles/js082/index.htm and changed some
        bits myself.


        <SCRIPT LANGUAGE="JavaS cript1.2"><!--
        // The following only works in JavaScript 1.2 or greater:
        function showpage(code) {

        location = ("index_" + code + ".html");
        }


        if (navigator.appN ame == 'Netscape')
        var language = navigator.langu age;
        else
        var language = navigator.brows erLanguage;

        var code = language.substr ing(0,2);

        if (code == 'pl' || code == 'nl' || code == 'en')
        showpage(code);
        else
        showpage('en');
        //--></SCRIPT>


        I'm still looking for a way to check the preferred language setting (which
        you can set in the browsers preferences. I know it's in a tag
        HTTP_ACCEPT_LAN GUAGE. I know how to check it with PhP, but not in
        Javascript. Hope somebody can help me.

        Thanks,


        Edo.

        Comment

        • Edo van der Zouwen

          #5
          Re: language redirect

          Dr John Stockton <spam@merlyn.de mon.co.uk> wrote in
          news:DYw8a2GAeg a$EwUD@merlyn.d emon.co.uk:

          [color=blue]
          >
          > And what language do you assume for the UK, or Switzerland, or
          > Finland, or Belgium (where EU HQ is); or New York, where the UN HQ is
          > - or even the USA, which has a large Hispanic component?
          >
          > Or any University or Laboratory, where one is very likely to find
          > foreign visitors and students - often using natively-configured
          > computers?
          >
          > Or an Internet Cafe?
          >
          > The ONLY sensible way is to allow the user to choose; and, moreover,
          > to change that choice freely.
          >[/color]

          I think it is extra service to redirect visitors based on their browser
          language and especially on their preferred language settings (that's why
          they set it :).

          However I agree that you must always allow visitors to change this, by
          offering a link to different languages on each page.


          Edo.

          Comment

          • Stephen

            #6
            Re: language redirect

            Edo van der Zouwen wrote:[color=blue]
            > Dr John Stockton <spam@merlyn.de mon.co.uk> wrote in
            > news:DYw8a2GAeg a$EwUD@merlyn.d emon.co.uk:
            >
            >
            >[color=green]
            >>And what language do you assume for the UK, or Switzerland, or
            >>Finland, or Belgium (where EU HQ is); or New York, where the UN HQ is
            >>- or even the USA, which has a large Hispanic component?
            >>
            >>Or any University or Laboratory, where one is very likely to find
            >>foreign visitors and students - often using natively-configured
            >>computers?
            >>
            >>Or an Internet Cafe?
            >>
            >>The ONLY sensible way is to allow the user to choose; and, moreover,
            >>to change that choice freely.
            >>[/color]
            >
            >
            > I think it is extra service to redirect visitors based on their browser
            > language and especially on their preferred language settings (that's why
            > they set it :).
            >[/color]

            I belive this should be handled server-side by configuring your server
            to handle language-based content-negotiation in HTTP. That way selection
            of language content variation is transparent to both the web-site user
            and the web-site author. See your web server software documentation for
            details.
            [color=blue]
            > However I agree that you must always allow visitors to change this, by
            > offering a link to different languages on each page.
            >[/color]

            Yes, this is a sound idea.

            Regards,
            Stephen

            Comment

            • Russell Turner

              #7
              Re: language redirect

              Dr John Stockton <spam@merlyn.de mon.co.uk> wrote in message news:<DYw8a2GAe ga$EwUD@merlyn. demon.co.uk>...[color=blue]
              > JRS: In article <c1874a8a.03091 80826.28f36750@ posting.google. com>, seen
              > in news:comp.lang. javascript, Russell Turner <russ@geobytes. com> posted
              > at Thu, 18 Sep 2003 09:26:29 :-[color=green]
              > >"peter" <peterbal@wanad oo.nl> wrote in message news:<ndq8b.301 585$0W5.8282400 @po
              > >llux.casema.ne t>...[/color]
              >[color=green][color=darkred]
              > >> who knows if there is ascript that detects de country or language. I need
              > >> this to sent for example dutch people to a dutch site and german to a german
              > >> site.[/color][/color]
              >[color=green]
              > >You could try using the free GeoDirection service at
              > >http://www.geobytes.com/GeoDirection.htm to redirect users based on
              > >their location to a page that has the appropriate language for their
              > >country.[/color]
              >
              > And what language do you assume for the UK, or Switzerland, or Finland,
              > or Belgium (where EU HQ is); or New York, where the UN HQ is - or even
              > the USA, which has a large Hispanic component?
              >
              > Or any University or Laboratory, where one is very likely to find
              > foreign visitors and students - often using natively-configured
              > computers?
              >
              > Or an Internet Cafe?
              >
              > The ONLY sensible way is to allow the user to choose; and, moreover, to
              > change that choice freely.[/color]

              A good point Peter. Sorry if my post was felt to be out of place. I
              suggested our GeoDirection service because a client only recently
              wanted to use GeoDirection for this very reason, he wanted to redirect
              users from certain countries to language pages using our services. I
              thought my input may be helpful to others. GeoDirection won't restrict
              a visitors choice based on their location (unless the webmaster wants
              to) - it will select for the webmaster what he/she wants their
              visitors to see based upon their detected geographic location - it is
              the webmasters discretion to include links to other pages of any form.

              Kind Regards
              Russell Turner

              Comment

              Working...