Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 26th, 2006, 11:19 PM
Registered User
Join Date: Mar 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help: how to detect client's system locale? Thanks

Hi buddies,

   Just like www.google.com, I'd like to detect the client's system locale and then redirect to pages in differect languages accordingly.
But what I get with the following codes is not what I really want, it is just the system language! Please help buddies, thanks a lot.

  SYS_LOCALE=Request.ServerVariables("HTTP_ACCEPT_LA NGUAGE")
  Select Case SYS_LOCALE
    Case "en-us":Response.Redirect "http://www.abcd.com/en/index.asp"
    Case else: Response.Redirect "http://www.abcd.com/ch/index.asp"
  End select

Yours truly

Old March 28th, 2006, 12:16 AM
Wrox Author
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons

hmmm you are using classic ASP so I am not sure that Classic has this kind of thing built in; what I would do in .NET would be Request.Languages(0) (the request.languages is an array as you can setup more then one language in your browser) anyway this will return the Default language of the browser then you could call your CASE from that.

In IE the language determines the Culture (There is English[United States], English[United Kingdom], etc) so this will tell you what locale you are working with and then can make your adjustments from there. Hope this helps.

"The one language all programmers understand is profanity."

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting the Locale within Web.Config rit01 ASP.NET 2.0 Basics 1 March 2nd, 2006 11:06 AM
How to Save a file on client's system suri_thanda Classic ASP Components 3 April 18th, 2005 02:44 PM
how to track IP of client's system VinodTewthia Pro JSP 2 December 11th, 2004 12:10 AM
i18n (Locale) support in HttpRequestDataBinder shoening BOOK: Expert One-on-One J2EE Design and Development 1 April 8th, 2004 01:21 PM
Support for an INDIA locale partho_choudhury J2EE 0 April 8th, 2004 01:26 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.