Open Bug 1765375 Opened 2 years ago Updated 4 months ago

GeckoView handling of secondary OS languages leads to sites ignoring primary language

Categories

(Core :: Internationalization, defect)

Unspecified
Android
defect

Tracking

()

People

(Reporter: tcampbell, Assigned: dminor)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

STR

  1. Set OS languages to English (Canada) followed by Simplified Chinese (China)/简体中文(中国) and no others. Note: You can search for "chinese" to get to right spot in ui list.
  2. Visit youtube.com
  3. Visit a test site to check accept-languages (such as https://manytools.org/http-html-text/browser-language/)

Expected:

  • YouTube uses primary languages and renders in English

Actual:

  • YouTube comes back in Chinese

A few notes

The lack of UI/pref control over this in Fenix seems to mean OS languages currently need to be overridden. Having computeAcceptLanguages only use the top language would solve my case of a regional-variant-of-otherwise-well-supported-language, but wouldn't be ideal for folks who rely on fallback chain regularly.

See Also: → 1543823

I should add that in this scenario I am simply trying to add the keyboard IME, but on Android that is done by adding language to system language list.

Chrome for Android seems to add language only tag after language Tag. Firefox desktop depends on localized language pack.

Moving this bug to the Internationalization component.

What behavior do we want on Fenix when the user adds secondary languages or keyboards?

In my Android phone's Settings > General management > Language, my default language is "English (United States)". If I add "Deutsch (Deutschland)" as a second option, then Chrome sends Accept-Language en-US,en;q=0.9,de-DE;q=0.8,de;q=0.7. Firefox 99 sends en-US,de-DE;q=0.5.

I tried adding a Chinese input language to my phone's Samsung keyboard, but that didn't affect Chrome's or Firefox's Accept-Language header.

Why doesn't Firefox Android include en as a fallback like desktop Firefox does (en-US,en;q=0.5)?

Component: General → Internationalization
OS: All → Android
Product: GeckoView → Core
Severity: -- → S3

(In reply to Makoto Kato [:m_kato] from comment #3)

Chrome for Android seems to add language only tag after language Tag. Firefox desktop depends on localized language pack.

Yes, it seems like we should try en if en-CA fails before moving to a different language.

There's a bit of design discussion about vertical fallbacking from the ICU4X project in [1]... in general, we should fallback from language+region to language before trying a different language. It seems like we could introduce this here [2] without too much trouble...

Flod, does this approach make sense to you?

[1] https://github.com/unicode-org/icu4x/blob/main/docs/design/locale_fallback_and_negotiation.md#vertical-fallback
[2] https://searchfox.org/mozilla-central/rev/0ffae75b690219858e5a45a39f8759a8aee7b9a2/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java#789

Flags: needinfo?(francesco.lodolo)

(In reply to Dan Minor [:dminor] from comment #6)

There's a bit of design discussion about vertical fallbacking from the ICU4X project in [1]... in general, we should fallback from language+region to language before trying a different language. It seems like we could introduce this here [2] without too much trouble...

Flod, does this approach make sense to you?

Yes, I think it makes sense. Ideally, I think it should be possible to customize that through the UI (like it happens in desktop), but this is at least an improvement over the current status.

Flags: needinfo?(francesco.lodolo)
Assignee: nobody → dminor
See Also: → 1785807

Dan, what are the next steps for this bug? In the review comments [1], you wondered whether this approach should be abandoned. Agi is no longer at Mozilla, so if you have questions, you can follow up with calu or owlish in the review.

[1] https://phabricator.services.mozilla.com/D144997#5025119

Flags: needinfo?(dminor)

I've been busy with other projects, but I would like to get back to this. I think the next step is to write some unit tests to verify the new behaviour.

Flags: needinfo?(dminor)
Blocks: 1818886

See also Bug 1813236 for implementing proper page content language UI.

See Also: → 1847303
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: