HTMLViewer - WebKit - Contextmenu Displaylanguage

Hey ho,

I’ve got a little but important question.
How is it possible, that my application - using some HTMLViewers - display context menus in a different language from that I choosed in Build time.
e.g.:

The App compile with the language ‘German’ - on Mac any context menus within the HTMLViewer are displayed in german,
but on Windows, it’s everytime english - wether the system is setup with german language or french.
The loaded local HTML files have the <html lang=“de” … > Tag, so any browser provided function should be displayed in german, right?

How is this possible?

Thanks in advance.

See http://blog.xojo.com/2014/03/05/picking_a_language_at_runtime/

Thanks for the answer, but this did not address my issue.
To be more clear, this is what I have to deal with:

On Mac the HTMLViewer Contextmenu looks like this: (everything is fine)


But on Windows it looks like this:

The systems language is german but the context menu, of the HTMLViewer is english.

Is the browser and Windows in English ?

Nope, WIndows is German

No idea what is going on.

A possible solution is to replace the contextual menu by your own.

Place this in the Show event of the Webpage :

self.ExecuteJavaScript("document.body.setAttribute('oncontextmenu','return false');")

Then in the page or control :

Sub MouseDown(X As Integer, Y As Integer, Details As REALbasic.MouseEvent) If Details.Button = RealBasic.MouseEvent.RightMouseButton then msgbox "right click" end if End Sub

Instead of MsgBox build and display your contextual menu. That way you are in full control of the language.

The JS workaround is one possibility I thought of.
BTW it’s not a WebApp, it’s a DesktopApp so no chance of using Webframework classes - I guess.

I’m working on a DHTML Editor, so far:

Of course, sorry. Anyway you can just as well use RectControl.ConstructContextualMenu.Could you check with a regular TextField if you also get the English menu ?

That could very well be specific to the WebHTMLViewer. You may also want to check if the same phenomenon occurs with the HTMLViewer renderer set as native. It is possible that the bug be specific to WebKit.

Everywhere in the app the language specific contents are displayed correct.
Seems to be a WebKit Bug, even though there’s a locales/ folder within the Libs/ folder containing any language .pak…
I might use the JS workaround. Thanks. :wink:

[quote=271941:@Patric Lee Atrott]Everywhere in the app the language specific contents are displayed correct.
Seems to be a WebKit Bug, even though there’s a locales/ folder within the Libs/ folder containing any language .pak…
I might use the JS workaround. Thanks. ;)[/quote]

Any reason you cannot use the native renderer ?

You may want to have a lok here http://blog.xojo.com/use-newer-version-of-internet-explorer-with-webbrowser-and-htmlviewer

To enabled Internet Explorer 11 in native renderer mode.

I have not tried this, but you may be able to replace the English pak with the German one of you have no English users.

It is necessary to use Webkit because I need some of its rendering and manipulation abilities.

@Greg O’Lone I will try this, this should be possible with a Buildscript to delete all .paks but the german one, right?

I wouldn’t delete them. Just try replacing it manually for now.

FYI - if you control the html, you can add a header to convince the native htmlviewer to use the latest version installed in Windows and that may solve your needs as well.

http://blog.xojo.com/blog/htmlviewer_engines_on_windows

[quote=271949:@Greg O’Lone]FYI - if you control the html, you can add a header to convince the native htmlviewer to use the latest version installed in Windows and that may solve your needs as well.

http://blog.xojo.com/blog/htmlviewer_engines_on_windows[/quote]

Well I’ve read that article sometime ago - but it’s not an option to use IE||Edge anyway.
I will stick to create a js contextmenu.