localization - Get the language of user in android -
http://web.archiveorange.com/archive/v/fwvde0wn3xcvimtadw6x
it seems navigator.language property "en" in webview on androids. then, best way language of user? in native java code , pour webview javascript? or other better way?
the solution found problem set user agent through webview's settings:
websettings settings = wv.getsettings(); settings.setjavascriptenabled(true); settings.setuseragentstring(locale.getdefault().getlanguage());
in webcontent retrieve through:
var userlang = navigator.useragent;
this should used webview displaying local content.
Comments
Post a Comment