Question

I need to set the language in a TWebBrowser component according to some properties of your program. The problem is that i have to show, for example, dates according to the specific country dateformat. I already tried to find some hints in the docs, but without success.

So my question is:
Is there some possibility to set the language of a TWebBrowser like i can do in a normal instance of Internet Explorer?

Was it helpful?

Solution

We now solved it with a little workaround:

I pass an additional parameter with the URL, describing the language of the User. With this language we decide via Javascript which Formats to use.

Of course this is just a workaround and only possible if you can customize the website to call, but i haven't yet found another solution to manage this with Delphi.

I would be glad to read some other / better / simpler solutions.

OTHER TIPS

Try this e.g. for de = German Language like:

header_string := 'Accept: text/html,application/xhtml+xml,'
                 + 'application/xml;q=0.9,image/webp,*/*;q=0.8' 
                 +  chr(13) + chr(10)  // Linefeed
                 + 'Accept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4'
                 +  chr(13) + chr(10); // Linefeed 

WebBrowser1.Navigate(url,16,0,header_string);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top