By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,758 Members | 1,250 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,758 IT Pros & Developers. It's quick & easy.

language redirect

P: n/a
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
Jul 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
"peter" <pe******@wanadoo.nl> wrote in message news:<nd**********************@pollux.casema.net>. ..
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


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
Jul 20 '05 #2

P: n/a
JRS: In article <c1**************************@posting.google.com >, seen
in news:comp.lang.javascript, Russell Turner <ru**@geobytes.com> posted
at Thu, 18 Sep 2003 09:26:29 :-
"peter" <pe******@wanadoo.nl> wrote in message news:<ndq8b.301585$0W5.8282400@po
llux.casema.net>...
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.

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.


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.demon.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.idiotsdelight.net/minitrue/> Update soon?
Jul 20 '05 #3

P: n/a
"peter" <pe******@wanadoo.nl> wrote in
news:nd**********************@pollux.casema.net:
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

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="JavaScript1.2"><!--
// The following only works in JavaScript 1.2 or greater:
function showpage(code) {

location = ("index_" + code + ".html");
}
if (navigator.appName == 'Netscape')
var language = navigator.language;
else
var language = navigator.browserLanguage;

var code = language.substring(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_LANGUAGE. I know how to check it with PhP, but not in
Javascript. Hope somebody can help me.

Thanks,
Edo.
Jul 20 '05 #4

P: n/a
Dr John Stockton <sp**@merlyn.demon.co.uk> wrote in
news:DY**************@merlyn.demon.co.uk:


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.


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.
Jul 20 '05 #5

P: n/a
Edo van der Zouwen wrote:
Dr John Stockton <sp**@merlyn.demon.co.uk> wrote in
news:DY**************@merlyn.demon.co.uk:
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.
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 :).


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.
However I agree that you must always allow visitors to change this, by
offering a link to different languages on each page.


Yes, this is a sound idea.

Regards,
Stephen

Jul 20 '05 #6

P: n/a
Dr John Stockton <sp**@merlyn.demon.co.uk> wrote in message news:<DY**************@merlyn.demon.co.uk>...
JRS: In article <c1**************************@posting.google.com >, seen
in news:comp.lang.javascript, Russell Turner <ru**@geobytes.com> posted
at Thu, 18 Sep 2003 09:26:29 :-
"peter" <pe******@wanadoo.nl> wrote in message news:<ndq8b.301585$0W5.8282400@po
llux.casema.net>...

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.

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.


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.


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
Jul 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.