New issue
Advanced search Search tips

Issue 816902 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug-Regression



Sign in to add a comment

Incorrect runtime language in WebView with Intl.NumberFormat

Reported by ninn...@gmail.com, Feb 27 2018

Issue description

Steps to reproduce the problem:
1. Create an Activity with a simple WebView in it
2. Enable Javascript in the WebView
3. Create an instance of Intl.NumberFormat w/o a specific locale in its constructor and read Intl.NumberFormat.resolvedOptions().locale value
4. Change device language through Settings application
5. Repeat step 3

What is the expected behavior?
Intl.NumberFormat.resolvedOptions().locale should match the user's preferred language/locale.

What went wrong?
Intl.NumberFormat.resolvedOptions().locale is always set to "en-US" no matter which is the preferred user's language/locale.

Did this work before? Yes Android 7.1.1

Chrome version: 64.0.3282.137  Channel: stable
OS Version: 8.0.0
Flash Version: 

Intl.NumberFormat.resolvedOptions().locale matches user's language/locale on API < 26.
 

Comment 1 by ninn...@gmail.com, Feb 27 2018

Please find attached an example apk to reproduce the issue.
WebViewLocaleTest.zip
130 KB Download

Comment 2 by rbyers@chromium.org, Feb 27 2018

Components: -Blink Mobile>WebView
Verified this pen works fine when switching languages in Chrome: https://codepen.io/rbyers/full/jZQJaq, so not a generic Chrome issue.

Over to WebView triage to confirm a WebView-specific regression.

Comment 3 by torne@chromium.org, Feb 27 2018

Chromium doesn't really support changing locale without restarting the process. Chrome handles this by exiting itself when you switch locale, so that when you come back to Chrome it restarts with the new locale, but WebView can't do that on the application's behalf.

Can you reproduce this issue after making sure that the application process has entirely exited?

Comment 4 by ninn...@gmail.com, Feb 27 2018

Yes, I still can reproduce after killing the whole application process altogether (via adb shell run-as <application-package> and killing the process from there).

Please note that navigator.language (and navigator.languages) are correctly updated each time I edit device locales.

Labels: Needs-triage-Mobile
Cc: pnangunoori@chromium.org
Labels: Triaged-Mobile Needs-Feedback
ninniuz@ -- Thanks for reporting this issue with the sample file to reproduce. Unfortunately from the attachment .apk file is not found. Could you please compile to Android APK and share. Also, could you please provide the screen cast of the issue. That would help us in understanding and triaging the issue further.

Thanks in advance!

Comment 7 by ninn...@gmail.com, Feb 28 2018

Please find attached an Android APK to reproduce the issue and a screencast grabbed from a Nexus 5X emulator with Android 8.0.0.

Let me know if you need further info!
bug_chromium_816902_screencast.mp4
9.0 MB View Download
WebViewLocaleTest_chromium_bug_816902.apk
1.5 MB Download
Project Member

Comment 8 by sheriffbot@chromium.org, Feb 28 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Components: UI>Localization UI>Internationalization
Labels: -Triaged-Mobile FoundIn-66 WV-Triaged M-66 Target-66 FoundIn-64 FoundIn-65
Status: Untriaged (was: Unconfirmed)
Tested the issue in Android and able to reproduce the issue. Similar behavior is observed since Chrome #58.0.3029.83

Steps Followed:
1. Install the .apk file provided in the Comment #7. 
2. From the device settings, change the language to any language other than English. Eg.: Arabic/Spanish/Urdu etc.
3. Launch the application installed in Step-1
4. Observed that the component "Intl.Numberformat locale" is always displayed as en-US.

Chrome versions tested:
58.0.3029.83, 64.0.3282.137(Stable), 66.0.3355.0(Canary)

OS:
Android 7.0.0

Android Devices:
Samsung J7

This seems to be a Non-Regression issue as same behavior is seen since M58. Untriaged for further input's on this issue.

Please navigate to below link for log's and video--
go/chrome-androidlogs/816902

Thanks!

Comment 10 by ninn...@gmail.com, Mar 1 2018

I cannot reproduce on emulator running Android 7.0.0 and Chrome stable 64.0.3282.137
Cc: ntfschr@chromium.org
Labels: Needs-Feedback
I can reproduce this. I also see that the locale is always "en-US", even if I reboot the device or reinstall WebView.

> Did this work before? Yes Android 7.1.1

I've tried this on N and O with 64.0.3282.137. I consistently see the bug, I haven't been able to repro the correct behavior, even after rebooting the device.

ninniuz@ Can you upload a screenrecord of you reproducing the correct behavior? Also in the recording, please show the build fingerprint (Settings > About phone > Build number).

If this really is a regression between Android 7.1.1 (N-MR1) and Android 8.0.0 (O), then this possibly points to a change in a framework API.
Components: -UI>Localization UI>Browser
Labels: Needs-TestConfirmation
Hi,

Thank you for reporting this issue. However, this is not a localization issue.
Unable to reproduce the steps as well.

We will be looping in the Engineering Team for review.

Regards!

Comment 13 by ninn...@gmail.com, Mar 7 2018

@ntfschr please find attached a screenrecord of a working example with a Moto Z Play device running Android 7.1.1
bug_chromium_816902_7.1.1_working.mp4
15.7 MB Download

Comment 14 by ninn...@gmail.com, Mar 7 2018

Another screencast from an emulator running Android 7.0
bug_chromium_816902_emualtor_7.0_working.mp4
5.9 MB View Download

Comment 15 by ctzsm@chromium.org, Mar 16 2018

Labels: -Needs-Feedback
Removing needs feedback label, somehow monarail is not working correctly.

Comment 16 by ctzsm@chromium.org, Mar 16 2018

Yep, I can repro this with Android O and see the correct behavior with Android 7.1.2.
Labels: -Pri-2 -M-66 Pri-3
Status: Available (was: Untriaged)

Sign in to add a comment