|
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/languagesI have changed WebView.AcceptLanguage and Runtime.UILanguage. None of them affect that javascript property result.
|
|
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!
|
|
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
|
|
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!
|
|
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?
|
|
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!
|
|
Rank: Member Groups: Member
Joined: 6/2/2015 Posts: 11
|
Many thanks for help out.
|
|
Rank: Member Groups: Member
Joined: 6/2/2015 Posts: 11
|
I have just tried that build, it works perfectly. Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Great. Thanks for confirming that it works!
|
|