Welcome Guest Search | Active Topics | Sign In | Register

EO.WebBrowser navigator.language Options
Jason
Posted: Monday, November 9, 2015 9:00:09 PM
Rank: Member
Groups: Member

Joined: 6/2/2015
Posts: 11
Just curious if there are anyway to change EO.WebBrowser's navigator.language property?

https://developer.mozilla.org/en-US/docs/Web/API/NavigatorLanguage/languages

I have changed WebView.AcceptLanguage and Runtime.UILanguage. None of them affect that javascript property result.
eo_support
Posted: Tuesday, November 10, 2015 9:28:56 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

Runtime.UILanguage is the correct property for this purpose. However Runtime.UILanguage must be set BEFORE you create any WebView. Once a WebView is created, you can not change its UILanguage.

We will have a new build this week that will allow you to customize this option on the "Browser Engine" level. Currently we only have one global browser engine and all WebViews are created through that engine. Our next build will allow you to create additional engines and set options such as UILanguage on the engine object. This way if you wish to change the options, you can stop the engine, create a new engine with the new options and then start the new engine. Note that you will still need to recreate the WebViews through the new engine (since all WebViews associated to an engine is destroyed when the engine stops. Also you can not restart an engine once it's stopped). However the ability of creating a new engine will allow you to recreate the WebViews without restarting your application.

Thanks!
Jason
Posted: Tuesday, November 10, 2015 2:57:07 PM
Rank: Member
Groups: Member

Joined: 6/2/2015
Posts: 11
I have checked again. UILanguage doesn't change `navigator.language` property.

https://mega.nz/#!OJMSWYQD!SWZHKwiHgSU2PLJ3kSzR6tIq6u3rnJzwAjfZGMIkl6s

I have uploaded a sample project here you can take look. Browser version is 15.3.1
eo_support
Posted: Tuesday, November 10, 2015 3:35:55 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

This is because only certain languages are supported. "en-NZ" is not one of them. If you use two letter languages (for example, "en", "fr") then it will work. We will work to add more languages.

Thanks!
Jason
Posted: Tuesday, November 10, 2015 4:42:46 PM
Rank: Member
Groups: Member

Joined: 6/2/2015
Posts: 11
For us probably less to do with UI language but more with `navigator.language` itself. Some of website use that to determine time format. It's very ugly. Of course we have no control on change those behavior only thing we can do is try to support it.

Will there be chance `navigator.language` or `navigator.languages` could be support without any limitation?
eo_support
Posted: Wednesday, November 11, 2015 7:56:21 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

We have posted a new build that would allow you to set UILanguage to any language. Please see your private message for the download location.

Note that this does not address "languages" collection. That collection will still return empty.

Thanks!
Jason
Posted: Wednesday, November 11, 2015 8:26:18 PM
Rank: Member
Groups: Member

Joined: 6/2/2015
Posts: 11
Many thanks for help out.
Jason
Posted: Thursday, November 12, 2015 2:41:52 PM
Rank: Member
Groups: Member

Joined: 6/2/2015
Posts: 11
I have just tried that build, it works perfectly. Thanks.
eo_support
Posted: Thursday, November 12, 2015 3:13:33 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Great. Thanks for confirming that it works!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.