You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Simon MacDonald (JIRA)" <ji...@apache.org> on 2012/09/10 23:42:08 UTC

[jira] [Commented] (CB-1405) navigator.language

    [ https://issues.apache.org/jira/browse/CB-1405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452477#comment-13452477 ] 

Simon MacDonald commented on CB-1405:
-------------------------------------

I have a fix for this issue but I'm waiting until after the 2.1.0 code freeze before pushing the change. This will be fixed in 2.2.0.
                
> navigator.language
> ------------------
>
>                 Key: CB-1405
>                 URL: https://issues.apache.org/jira/browse/CB-1405
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.0.0
>         Environment: Android ICS 4.0.3
>            Reporter: Jonathan Bond-Caron
>            Assignee: Simon MacDonald
>             Fix For: 2.2.0
>
>
> When switching language in 'settings / language & input', from en-US -> fr-FR:
> console.log(navigator.language);
> console.log(navigator.userAgent);
> 09-09 09:51:31.923: I/Web Console(11225): Navigator:en-US at file:///android_asset/www/index.html:83
> 09-09 09:51:31.923: I/Web Console(11225): User Agent:Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; Build/ICS.f04ref.20120204) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 at file:///android_asset/www/index.html:84
> The language doesn't appear has having changed in the webView.
> This is a known android bug:
> http://code.google.com/p/android/issues/detail?id=4641
> But the fix is oddly simple:
> appView.getSettings().getUserAgentString();
> super.loadUrl("file:///android_asset/www/index.html");
> See the code here:
> https://github.com/android/platform_frameworks_base/blob/master/core/java/android/webkit/WebSettingsClassic.java#L1476

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira