New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 641852 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Away
Closed: Sep 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

On Android N, zh-Hant UI cannot be selected. zh-Hant-{TW,HK,MO} all fall back to English

Project Member Reported by js...@chromium.org, Aug 29 2016

Issue description

OS: Android N
Version: Chrome 54.0.2837.2 (dev channel)

* How to reproduce

1. Go to Settings app (Android OS) - Language
2. Add Traditional Chinese 
3. Pick Taiwan, Hong Kong or Macau (any of three will work)
4. Put it at the top of the list.  
5. Go back to Chrome
6. Touch on the 'hamburger' menu

* Expected

The UI is in Traditional Chinese

* Actual

The UI is in English 

* Additional information 
1. Simplified Chinese works fine (zh-Hans-CN, zh-Hans-SG, etc). When zh-Hans-SG is at the top of the list, zh-Hans UI is picked as it's supposed to be. 
2. Android N's locale fallback seems to work fine with other languages. 

a. I tried putting de-CH, fr-CH, es-AR (either at the top of the list or by itself without any other locales)  and they all fallback to de, fr, and es-419. Actually, I don't whether es-AR falls back to es-419 or es-ES because I didn't check. 

b. Moreover, when I put Hausa and a few other languages NOT supported by Chrome *before* one supported by Chrome (e.e. Korean, German, English, etc) in the locale preference list, the first supported UI language is picked as expected. 

However, with zh-Hant-{TW,HK,MO}, this did not work, either.   

I suspect that a fix for bug 555101 caused this issue. (which put Traditional Chinese resources in 'zh' directory ). ( https://codereview.chromium.org/1931093002 ) 

I believe that a proper fix would be :

1) Put Tradtional Chinese resources in zh-Hant directory  (move from zh)
2) Put Simplified Chinese resource in zh-Hans  (move from zh-CN). 

2) may not be strictly necessary, but it'd be better that way. 

A potential problem with this change is this may not work as intended on Android M or earlier. (or it may just work fine). Cc'ing roozbeh@ and mnita@ for that. 

This is a rather serious issue and I'm setting the priority to 1. A fix should be merged back to a branch. 

 

Comment 1 by js...@chromium.org, Aug 29 2016

Description: Show this description

Comment 2 by mnita@google.com, Aug 29 2016

Yes, 1931093002 is not a good fix. "zh" should contain Simplified Chinese, not Traditional.
Using zh-CN (for simplified) and zh-TW (for traditional) works for all version, N and before.

Comment 3 by mnita@google.com, Aug 29 2016

I am not sure I understand the problem that 1931093002 tries to fix:

  "Android does not support zh-HK, yet many vendors still
   ship devices with this locale. By default Android will
   fall back to English when it sees zh-HK."

For me this "does not support ... ship devices with this locale" is a contradiction. If one ships a devices with a locale, then that locale becomes supported. I think it is unclear  what "support" and "ship with" means in this case.
Either Roozbeh or I can take that offline and clarify.


Comment 4 by js...@chromium.org, Aug 29 2016

re: comment 3: Neither am I. And I'm on the same page as you. 

Another interesting observation: 

When I put 'zh-Hans-HK' (note I used 'Hans') before zh-Hant-TW in Settings - Language , Chrome's UI language is zh-TW (zh-Hant-TW) while all other apps are in zh-Hans (zh-CN/zh-Hans-CN). It should be zh-CN/zh-Hans-CN. 

Comment 5 by js...@chromium.org, Aug 29 2016

With zh-Hans-CN and zh-Hant-TW in Language settings (in that order), Chrome's UI language is zh-Hans-CN (zh-CN) like other apps. 

Comment 6 by mnita@google.com, Aug 29 2016

> When I put 'zh-Hans-HK' (note I used 'Hans') before zh-Hant-TW in
> Settings - Language , Chrome's UI language is zh-TW (zh-Hant-TW)
> while all other apps are in zh-Hans (zh-CN/zh-Hans-CN).
> It should be zh-CN/zh-Hans-CN. 

Explanation: Android assumes that zh is zh-Hans.
So zh-Hans-HK will try to load from zh-Hans-HK (not found), then from zh-Hans (not found), then from zh. And that finds Traditional Chinese because of 1931093002.

java/res/values-zh-rCN/generated_resources.xml"

> With zh-Hans-CN and zh-Hant-TW in Language settings (in that order),
> Chrome's UI language is zh-Hans-CN (zh-CN) like other apps.

Explanation:
Android will try to load from zh-Hans-CN (not found), then from zh-CN, found, Simplified Chinese, all good.


It is all as expected.
What is not expected is what 1931093002 did, storing Traditional Chinese in zh.
That is not correct. The implied script for zh is Hans.


Comment 7 by js...@chromium.org, Aug 29 2016

> What is not expected is what 1931093002 did, storing Traditional Chinese in zh.
> That is not correct. The implied script for zh is Hans.

Yup. That should be fixed. 

In bug 555101, it's claimed that zh-HK falls back to 'en' instead of zh-TW on *pre-N* Android when an app (in this case, Chrome) does not support zh-TW (that is, it has resource bundles in zh-rTW but not in zh-rHK).  

What's the Abdriud locale-fallback behavior on pre-N for zh-HK when there's no resource for zh-HK?  

> Android will try to load from zh-Hans-CN (not found), then from zh-CN, found, 
> Simplified Chinese, all good.

Does Android try zh-Hans before zh-CN given zh-Hans-CN?  

Comment 8 by ian...@chromium.org, Aug 29 2016

Owner: ian...@chromium.org
Status: Started (was: Untriaged)
https://codereview.chromium.org/2280143002 in review. This CL should fix the issue on N as well as translation for HK users before N.

Comment 9 by ian...@chromium.org, Aug 29 2016

Issue 641416 has been merged into this issue.

Comment 10 by mnita@google.com, Aug 29 2016

> What's the Abdriud locale-fallback behavior on pre-N for zh-HK when
> there's no resource for zh-HK?

Pre-N the fallback "cuts from the right"
So zh-HK => zh => default (whatever is in values)


> Does Android try zh-Hans before zh-CN given zh-Hans-CN?

Not before N.

For N it will do:
   zh-CN => zh-Hans-CN => zh-Hans => zh => default
or
   zh-Hans-CN => zh-CN => zh-Hans => zh => default
(because the user settings are in fact zh-Hans-CN, you can't select zh-CN)

Before N it will do
   zh-CN => zh => default

Project Member

Comment 11 by bugdroid1@chromium.org, Aug 30 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e5a4384de1d67657590646b306c6e66746f1174b

commit e5a4384de1d67657590646b306c6e66746f1174b
Author: Ian Wen <ianwen@chromium.org>
Date: Tue Aug 30 02:40:02 2016

Revert "[Android]Use zh instead of zh-rTW as output folder of zh_TW translation"

This reverts commit 21571ae1ee47d614541f814bd98dfbd71f561dbc, which was
committed in M52.

Reason for revert: in android N, locale is defined in finer granularity,
and simply falling back to zh will no longer work.

BUG= 641852 
Previously reviewed in https://codereview.chromium.org/1931093002

R=twellington@chromium.org
TBR=boliu@chromium.org, caitkp@chromium.org, dtrainor@chromium.org, grt@chromium.org, joedow@chromium.org, yfriedman@chromium.org

Review URL: https://codereview.chromium.org/2280143002 .

Cr-Commit-Position: refs/heads/master@{#415045}

[modify] https://crrev.com/e5a4384de1d67657590646b306c6e66746f1174b/android_webview/BUILD.gn
[modify] https://crrev.com/e5a4384de1d67657590646b306c6e66746f1174b/android_webview/java/strings/android_webview_strings.grd
[modify] https://crrev.com/e5a4384de1d67657590646b306c6e66746f1174b/blimp/client/BUILD.gn
[modify] https://crrev.com/e5a4384de1d67657590646b306c6e66746f1174b/blimp/client/app/android/java/strings/android_blimp_strings.grd
[modify] https://crrev.com/e5a4384de1d67657590646b306c6e66746f1174b/build/android/lint/suppressions.xml
[modify] https://crrev.com/e5a4384de1d67657590646b306c6e66746f1174b/chrome/android/BUILD.gn
[modify] https://crrev.com/e5a4384de1d67657590646b306c6e66746f1174b/chrome/android/java/strings/android_chrome_strings.grd
[modify] https://crrev.com/e5a4384de1d67657590646b306c6e66746f1174b/chrome/app/BUILD.gn
[modify] https://crrev.com/e5a4384de1d67657590646b306c6e66746f1174b/chrome/app/generated_resources.grd
[modify] https://crrev.com/e5a4384de1d67657590646b306c6e66746f1174b/components/components_locale_settings.grd
[modify] https://crrev.com/e5a4384de1d67657590646b306c6e66746f1174b/components/components_strings.grd
[modify] https://crrev.com/e5a4384de1d67657590646b306c6e66746f1174b/components/strings/BUILD.gn
[modify] https://crrev.com/e5a4384de1d67657590646b306c6e66746f1174b/content/public/android/BUILD.gn
[modify] https://crrev.com/e5a4384de1d67657590646b306c6e66746f1174b/content/public/android/java/strings/android_content_strings.grd
[modify] https://crrev.com/e5a4384de1d67657590646b306c6e66746f1174b/remoting/remoting_locales.gni
[modify] https://crrev.com/e5a4384de1d67657590646b306c6e66746f1174b/remoting/resources/remoting_strings.grd
[modify] https://crrev.com/e5a4384de1d67657590646b306c6e66746f1174b/ui/android/BUILD.gn
[modify] https://crrev.com/e5a4384de1d67657590646b306c6e66746f1174b/ui/android/java/strings/android_ui_strings.grd

Labels: Merge-Request-53 Merge-Request-54

Comment 13 by dimu@chromium.org, Aug 30 2016

Labels: -Merge-Request-53 Merge-Review-53 Hotlist-Merge-Review
[Automated comment] GRD changes detected, less than 3 weeks to before stable release of M53, manual review required.

Comment 14 by dimu@chromium.org, Aug 30 2016

Labels: -Merge-Request-54 Merge-Approved-54 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M54 (branch: 2840)

Comment 15 by dimu@chromium.org, Aug 30 2016

Labels: -Merge-Request-53 Merge-Review-53 Hotlist-Merge-Review
[Automated comment] GRD changes detected, less than 3 weeks to before stable release of M53, manual review required.
Project Member

Comment 16 by bugdroid1@chromium.org, Aug 30 2016

Labels: merge-merged-2785
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/02aba50ffa45769a82c505d579baed17b91bb8e4

commit 02aba50ffa45769a82c505d579baed17b91bb8e4
Author: Ian Wen <ianwen@google.com>
Date: Tue Aug 30 03:11:12 2016

Revert "[Android]Use zh instead of zh-rTW as output folder of zh_TW translation"

This reverts commit 21571ae1ee47d614541f814bd98dfbd71f561dbc, which was
committed in M52.

Reason for revert: in android N, locale is defined in finer granularity,
and simply falling back to zh will no longer work.

BUG= 641852 
Previously reviewed in https://codereview.chromium.org/1931093002

R=twellington@chromium.org
TBR=boliu@chromium.org, caitkp@chromium.org, dtrainor@chromium.org, grt@chromium.org, joedow@chromium.org, yfriedman@chromium.org

Review URL: https://codereview.chromium.org/2280143002 .

Review URL: https://codereview.chromium.org/2293753002 .

Cr-Original-Commit-Position: refs/heads/master@{#415045}
Cr-Commit-Position: refs/branch-heads/2785@{#785}
Cr-Branched-From: 68623971be0cfc492a2cb0427d7f478e7b214c24-refs/heads/master@{#403382}

[modify] https://crrev.com/02aba50ffa45769a82c505d579baed17b91bb8e4/android_webview/BUILD.gn
[modify] https://crrev.com/02aba50ffa45769a82c505d579baed17b91bb8e4/android_webview/java/strings/android_webview_strings.grd
[modify] https://crrev.com/02aba50ffa45769a82c505d579baed17b91bb8e4/blimp/client/BUILD.gn
[modify] https://crrev.com/02aba50ffa45769a82c505d579baed17b91bb8e4/blimp/client/app/android/java/strings/android_blimp_strings.grd
[modify] https://crrev.com/02aba50ffa45769a82c505d579baed17b91bb8e4/chrome/android/BUILD.gn
[modify] https://crrev.com/02aba50ffa45769a82c505d579baed17b91bb8e4/chrome/android/java/strings/android_chrome_strings.grd
[modify] https://crrev.com/02aba50ffa45769a82c505d579baed17b91bb8e4/chrome/app/BUILD.gn
[modify] https://crrev.com/02aba50ffa45769a82c505d579baed17b91bb8e4/chrome/app/generated_resources.grd
[modify] https://crrev.com/02aba50ffa45769a82c505d579baed17b91bb8e4/components/components_locale_settings.grd
[modify] https://crrev.com/02aba50ffa45769a82c505d579baed17b91bb8e4/components/components_strings.grd
[modify] https://crrev.com/02aba50ffa45769a82c505d579baed17b91bb8e4/components/strings/BUILD.gn
[modify] https://crrev.com/02aba50ffa45769a82c505d579baed17b91bb8e4/content/public/android/BUILD.gn
[modify] https://crrev.com/02aba50ffa45769a82c505d579baed17b91bb8e4/content/public/android/java/strings/android_content_strings.grd
[modify] https://crrev.com/02aba50ffa45769a82c505d579baed17b91bb8e4/remoting/remoting_locales.gni
[modify] https://crrev.com/02aba50ffa45769a82c505d579baed17b91bb8e4/remoting/resources/remoting_strings.grd
[modify] https://crrev.com/02aba50ffa45769a82c505d579baed17b91bb8e4/ui/android/BUILD.gn
[modify] https://crrev.com/02aba50ffa45769a82c505d579baed17b91bb8e4/ui/android/java/strings/android_ui_strings.grd

Project Member

Comment 17 by bugdroid1@chromium.org, Aug 30 2016

Labels: -merge-approved-54 merge-merged-2840
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/aae95a370846313b440c3146fdde6a5f67a6db43

commit aae95a370846313b440c3146fdde6a5f67a6db43
Author: Ian Wen <ianwen@chromium.org>
Date: Tue Aug 30 03:20:01 2016

Revert "[Android]Use zh instead of zh-rTW as output folder of zh_TW translation"

This reverts commit 21571ae1ee47d614541f814bd98dfbd71f561dbc, which was
committed in M52.

Reason for revert: in android N, locale is defined in finer granularity,
and simply falling back to zh will no longer work.

BUG= 641852 
Previously reviewed in https://codereview.chromium.org/1931093002

R=twellington@chromium.org
TBR=boliu@chromium.org, caitkp@chromium.org, dtrainor@chromium.org, grt@chromium.org, joedow@chromium.org, yfriedman@chromium.org

Review URL: https://codereview.chromium.org/2280143002 .

Cr-Commit-Position: refs/heads/master@{#415045}
(cherry picked from commit e5a4384de1d67657590646b306c6e66746f1174b)

Review URL: https://codereview.chromium.org/2292813002 .

Cr-Commit-Position: refs/branch-heads/2840@{#29}
Cr-Branched-From: 1ae106dbab4bddd85132d5b75c670794311f4c57-refs/heads/master@{#414607}

[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/android_webview/BUILD.gn
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/android_webview/java/strings/android_webview_strings.grd
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/blimp/client/BUILD.gn
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/blimp/client/app/android/java/strings/android_blimp_strings.grd
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/chrome/android/BUILD.gn
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/chrome/android/java/strings/android_chrome_strings.grd
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/chrome/app/BUILD.gn
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/chrome/app/generated_resources.grd
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/components/components_locale_settings.grd
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/components/components_strings.grd
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/components/strings/BUILD.gn
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/content/public/android/BUILD.gn
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/content/public/android/java/strings/android_content_strings.grd
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/remoting/remoting_locales.gni
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/remoting/resources/remoting_strings.grd
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/ui/android/BUILD.gn
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/ui/android/java/strings/android_ui_strings.grd

Labels: -Merge-Review-53
I had spoken with ianwen@ offline on this, merge was good.
Status: Fixed (was: Started)
Fixed the main problem. Yet the regression for HK users is tracked in 595628.
Project Member

Comment 20 by bugdroid1@chromium.org, Oct 27 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/aae95a370846313b440c3146fdde6a5f67a6db43

commit aae95a370846313b440c3146fdde6a5f67a6db43
Author: Ian Wen <ianwen@chromium.org>
Date: Tue Aug 30 03:20:01 2016

Revert "[Android]Use zh instead of zh-rTW as output folder of zh_TW translation"

This reverts commit 21571ae1ee47d614541f814bd98dfbd71f561dbc, which was
committed in M52.

Reason for revert: in android N, locale is defined in finer granularity,
and simply falling back to zh will no longer work.

BUG= 641852 
Previously reviewed in https://codereview.chromium.org/1931093002

R=twellington@chromium.org
TBR=boliu@chromium.org, caitkp@chromium.org, dtrainor@chromium.org, grt@chromium.org, joedow@chromium.org, yfriedman@chromium.org

Review URL: https://codereview.chromium.org/2280143002 .

Cr-Commit-Position: refs/heads/master@{#415045}
(cherry picked from commit e5a4384de1d67657590646b306c6e66746f1174b)

Review URL: https://codereview.chromium.org/2292813002 .

Cr-Commit-Position: refs/branch-heads/2840@{#29}
Cr-Branched-From: 1ae106dbab4bddd85132d5b75c670794311f4c57-refs/heads/master@{#414607}

[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/android_webview/BUILD.gn
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/android_webview/java/strings/android_webview_strings.grd
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/blimp/client/BUILD.gn
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/blimp/client/app/android/java/strings/android_blimp_strings.grd
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/chrome/android/BUILD.gn
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/chrome/android/java/strings/android_chrome_strings.grd
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/chrome/app/BUILD.gn
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/chrome/app/generated_resources.grd
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/components/components_locale_settings.grd
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/components/components_strings.grd
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/components/strings/BUILD.gn
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/content/public/android/BUILD.gn
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/content/public/android/java/strings/android_content_strings.grd
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/remoting/remoting_locales.gni
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/remoting/resources/remoting_strings.grd
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/ui/android/BUILD.gn
[modify] https://crrev.com/aae95a370846313b440c3146fdde6a5f67a6db43/ui/android/java/strings/android_ui_strings.grd

Sign in to add a comment