Connecting Tech Pros Worldwide Forums | Help | Site Map

Changing ie language from web browser

Newbie
 
Join Date: Oct 2009
Posts: 5
#1: Oct 16 '09
Hi everyone,
I need to change a IE language to users when they load the form.
Is enyone experienced with this task, I am trying for months to acomplish this but without success. If possible should I use activex or what !!???
IT IS VERY IMPORTANT AND URGENT....
Thank you in advance for any instruction or advise....

Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,137
#2: Oct 16 '09

re: Changing ie language from web browser


What do you mean by "change an IE language to users when they load the form"???
Newbie
 
Join Date: Oct 2009
Posts: 5
#3: Oct 16 '09

re: Changing ie language from web browser


This is the task.
I am using Project Server and need to implement a language that is not part of server language pack. So I tried to translate an existing resource file to x language and it works fine.
But the thing is that project server check for client local language and it uses different resource files, based on client IE language.
So I need to add a controll to project server, and let users select their language, and change their local IE language.
I hope I answered
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,137
#4: Oct 16 '09

re: Changing ie language from web browser


There is no such thing as "client IE language". Anyways it sounds like you want let the user chose a language. Why don't you just provide a DropDownList of the available languages and set the Thread.CurrentThread.CurrentUICulture and the Thread.CurrentThread.CurrentCulture to the "culture"/language that the user has selected? You'll have to set this in your ASP.NET InitializeCulture event.
Newbie
 
Join Date: Oct 2009
Posts: 5
#5: Oct 16 '09

re: Changing ie language from web browser


Dear Frinavale, thank you for all ur responses.
The thing is that I dont use asp.net (in way to play with client culture) but it is project server, and everything is precompiled.
So the only thing is to change the local settings (language) to visitors from the web, I think there should be a way using activex or something else.
Besouce Project server only checks visitors culture and displays language based on that.
Thanks again.
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,137
#6: Oct 16 '09

re: Changing ie language from web browser


ASP.NET applications can automatically detect language/culture that the user has set up for the web-browser. I don't think that there is an ActiveX control that will be able to change the browser's settings. This is actually not even an ASP.NET question. I'm going to move it to JavaScript, maybe the experts there will have some idea....but I don't think this is possible.
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,660
#7: Oct 17 '09

re: Changing ie language from web browser


not sure if that’s what you mean, but you can get the preferred user language through the browser’s http request. it is submitted in the "Accept-Language" header and most server scripts have a way of reading that data.
Newbie
 
Join Date: Oct 2009
Posts: 5
#8: Oct 19 '09

re: Changing ie language from web browser


You got my question.
Server product ex. (SharePoint Project Server) they have web interface for clients, but there is difficult to play with cultures etc as on APS.NET.
So as you said I hope to find some httprequest or something similar, and this will solve my issue for sure.
Thank you
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,660
#9: Oct 19 '09

re: Changing ie language from web browser


the HTTP request variables are available through the server side scripts (although I only know how to do that in PHP)
Newbie
 
Join Date: Oct 2009
Posts: 5
#10: Oct 19 '09

re: Changing ie language from web browser


Dormilich,
Thank you very much, this will solve my problem for sure
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,137
#11: Oct 19 '09

re: Changing ie language from web browser


I don't think that Dorm's answer is going to help you because you stated that you don't have access to the server-side code...

You said that you are using a precompiled version of a website so you couldn't modify the server-side code.

You said you wanted to change the user's culture settings client side somehow.

Dorm suggested that you use the http request to determine the user's cultural settings.....

You access the http request is in the server-side .NET code (your VB or C# code). You use it in the Initialize Culture stage of the page life cycle you set the Current Thread's language/culture settings. Once you've done that the page will be rendered in the appropriate language/culture. It's really not complicated....the thing that makes it complicated is that you said you can't change the server-side code.


-Frinny
Reply

Tags
*****