setLocale

  • Thread starter Thread starter lemax
  • Start date Start date
L

lemax

Hello,

Does anyone know if there is a way to programmatically set the
Language which is used when a web page is displayed. The one you can
change under InternetOptions->Language.

I couldn't find any whay do do this. Only ways to get the Languages
but not any setter Mechanism.

Regards
Thomas
 
Hi Lemax,

You write the encode settings to the registry and then use the SendMessage
api to tell the browser that the setting has changed.

This should be automatic though and there should be no need for programatic
intervention and language preferences should be decalared in the meta tags
of web pages.

If you are seeking to provide some kind of page translation then a better
method is to use a translation service like babblefish.

You may find more detailed advice from the IE7 extensions development forum

http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=924&SiteID=1

This is a public forum and is better suited for technical questions.

Regards.
 
Thanks Rob,

(i needed to change my email account, so i have a new nick now)

Thank you for your suggestions. I also figured it out in the
meanwhile. I post my solution here i case somebody else needs it too.

Because IE does not provide any interface Methdods for changing the
prefered language you need to go through "windows-registry-patching"

1. store the original Value of "HKEY_CURRENT_USER\\Software\\Microsoft\
\Internet Explorer\\International\\AcceptLanguage " somewhere
2. change the value of "HKEY_CURRENT_USER\\Software\\Microsoft\
\Internet Explorer\\International\\AcceptLanguage" to for example "de"
3. Call SendMessage(HWND_BROADCAST,WM_SETTINGCHANGE , 0, (LPARAM)
(LPCTSTR)"HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\
\International\\AcceptLanguage"); do notify about the Registry Change
4. Do what ever you want in the browser
5. After finishing the work in the Browser reset the Registry-Value to
the Original Value you stored in 1.

Regards,
Thomas Max
 
Back
Top