Page MenuHomePhabricator

Detect and show suggested languages to Android app users
Closed, ResolvedPublic2 Story Points

Description

NOTE: Scope updated after outcome of spike T144316

Why are we doing this?

As part of enabling better support for multilingual users, we want to make it as easy as possible for users to add languages already in use on their device to the app by surfacing them as "Suggested" languages.

Proposed solution

Show a list of suggested languages when a user

(a) Installs the app for the first time (T190922)
(b) Goes to add more languages in Settings (T190838)
  • Suggested languages detected will be shown in order of:
    1. System languages detected
    2. Keyboard input languages
    3. Location-based languages (using GeoIP)
  • Suggested languages list are de-duplicated (for example, if "Traditional Chinese" is a system language, and "Traditional Chinese > Macau" is a keyboard input language, "Traditional Chinese" only shows up once in the the list
  • zh.wiki continues to be treated as 2 separate Wikipedia languages split into Traditional (zh-hant) and Simplified (zh-hant)
  • Any language that is already on in the list of app languages no longer appears in "Suggested"
  • For NEW users, device and keyboard input languages will be added to the app by default.

QA required

  • Check that 'Suggested languages' are per device language settings

Refer to T190922 and T190838 for comprehensive workflow steps.

Event Timeline

RHo created this task.Apr 5 2018, 9:53 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 5 2018, 9:53 AM
RHo updated the task description. (Show Details)Apr 5 2018, 9:56 AM
RHo updated the task description. (Show Details)Apr 5 2018, 10:05 AM
RHo updated the task description. (Show Details)Apr 9 2018, 4:20 PM
RHo updated the task description. (Show Details)Apr 13 2018, 2:07 PM
Charlotte set the point value for this task to 2.Apr 17 2018, 4:05 PM

Change 426323 had a related patch set uploaded (by Cooltey; owner: Cooltey):
[apps/android/wikipedia@master] [WIP] Add multiple language selection to app Settings

https://gerrit.wikimedia.org/r/426323

@RHo

If a user has added all the suggested languages, should we keep or hide the suggested languages section (including the section header)?

RHo added a comment.Apr 19 2018, 11:02 PM

hi @cooltey - in the similar way that suggested languages list are de-duplicated, anything that is already an app language should not be shown in the Suggested languages section.
If there are no Suggested languages, then the entire list including the section header should be hidden.

@RHo I see, thank you!

@RHo
Looks like we cannot get a correct language list from keyboard apps. For example, the G-board keyboard app will return 25+ languages even if only enabled the Traditional Chinese.

Is it possible to implement only the System languages detected part at this time? and create a backlog ticket of implementing the function of fetching keyboard languages?

RHo added a subscriber: Dbrant.Apr 25 2018, 12:33 PM

hi @cooltey - can we discuss with @Dbrant since I was under the impression that system and keyboard language detection selection was possible per the outcome of his investigation in T144316.
Keyboard languages detection is highly desirable to catch those multilingual users whose devices only allow setting one system language, but enables multiple keyboard selection. This is the case for example on my Nexus 5 running on Marshmallow.

And FWIW, keyboard and system lang detection is something that occurs in the iOS version of the app right now, so another reason to have the same capability.

Whether or not keyboard language detection is possible, it shouldn't block the completion of this feature (We can plug in any improvements to language detection after everything is merged). It looks like Cooltey has made some headway in detecting keyboard languages, but let's separate that out from finishing the UX first.

Change 426323 merged by jenkins-bot:
[apps/android/wikipedia@master] Add multiple language selection to app Settings

https://gerrit.wikimedia.org/r/426323

Hi @cooltey - couple of issues:

  • when pinyin keyboard is on for the Nexus 5 (6.0.1), only Simplified Chinese is being shown as a suggested language
  • Gboard languages are not being detected

  • when updating the app, languages should not be added by default to the app

https://youtu.be/y7VSvYhz_Ns

Hi @RHo

when pinyin keyboard is on for the Nexus 5 (6.0.1), only Simplified Chinese is being shown as a suggested language

While fetching the language code from keyboard apps, the Pinyin keyboard app returns zh_CN code, which would be shown as Simplified Chinese.

Gboard languages are not being detected

For most of the time, the latest version of Gboard keyboard app does not return keyboard language codes to the app.

In the emulator, we can turn off the Gboard's option User system languages and manually select languages, and those languages could be detected by our apps. However, the Gboard app in the emulator is an older version.

when updating the app, languages should not be added by default to the app

Not sure which alpha app version you have before upgrading to the current alpha version, but in our previous alpha version, we already have the "underpinnings" codes of the multilingual supports in the app.
T191332

App version before implementing multilingual underpinning codes

  1. Settings -> Wikipedia language -> select Japanese
  2. Upgrade to the current alpha version
  3. Settings -> you will only have Japanese in your Wikipedia languages

App version after implementing multilingual underpinning codes

  1. Settings -> Wikipedia language -> select Japanese -> back to Explore feed -> go to Settings and select Traditional Chinese

(At this moment, you only see Traditional Chinese as your Wikipedia language, but we actually have added all the languages you've been selected into our new language preferences store)

  1. Upgrade to the current alpha version
  2. Settings -> you will have Japanese and Traditional Chinese in your Wikipedia languages

Please let me know if you need a previous version of the alpha app (which does not include the multilingual underpinning codes) to test.

RHo added a comment.May 4 2018, 1:30 PM

Hi @RHo

when pinyin keyboard is on for the Nexus 5 (6.0.1), only Simplified Chinese is being shown as a suggested language

While fetching the language code from keyboard apps, the Pinyin keyboard app returns zh_CN code, which would be shown as Simplified Chinese.

  • Can we make it so that Traditional is shown as well? It would be a bad sign to Traditional speakers who likely have pinyin keyboard to only see Simplified shown as suggested.

Gboard languages are not being detected

For most of the time, the latest version of Gboard keyboard app does not return keyboard language codes to the app.
In the emulator, we can turn off the Gboard's option User system languages and manually select languages, and those languages could be detected by our apps. However, the Gboard app in the emulator is an older version.

  • Fair enough.

when updating the app, languages should not be added by default to the app

Not sure which alpha app version you have before upgrading to the current alpha version, but in our previous alpha version, we already have the "underpinnings" codes of the multilingual supports in the app.
T191332

  • I tested updating a version that did not have multilingual support (version 2.7.231-alpha-2018-04-12). For a user who updates from a previous version of the app that only supported a single language, when updating to the new multilingual-supported version, additional languages should not be added by default. See another demo of this issue: https://youtu.be/sCtDSuDgo0U
  • Also, I'd like to confirm that users who update from a multilingual supported version to a newer version are only getting whatever languages are in the app from before, and not having all system detected languages automatically added?

Scenario: User has English and French set in their Wikipedia app. In their device language settings, they have English and Danish. When updating their app, the Wikipedia app languages post-update should still only show as English and French (Danish should NOT be added).

Change 430956 had a related patch set uploaded (by Cooltey; owner: Cooltey):
[apps/android/wikipedia@master] Tweak: Detect and show suggested languages to Android app users

https://gerrit.wikimedia.org/r/430956

@RHo

Can we make it so that Traditional is shown as well? It would be a bad sign to Traditional speakers who likely have pinyin keyboard to only see Simplified shown as suggested.

Yes

  • I tested updating a version that did not have multilingual support (version 2.7.231-alpha-2018-04-12). For a user who updates from a previous version of the app that only supported a single language, when updating to the new multilingual-supported version, additional languages should not be added by default. See another demo of this issue: https://youtu.be/sCtDSuDgo0U

After couple tests I found that I missed a part that if a user has never changed the app language.
Now it should match the scenario correctly after the patch got merged.

  • Also, I'd like to confirm that users who update from a multilingual supported version to a newer version are only getting whatever languages are in the app from before, and not having all system detected languages automatically added?

Yes, only new users (fresh install, not update) will have all system detected languages automatically added.

Change 430956 merged by jenkins-bot:
[apps/android/wikipedia@master] Tweak: Detect and show suggested languages to Android app users

https://gerrit.wikimedia.org/r/430956

LGTM on Nexus 5, Wikipedia v2.7.232-alpha-2018-05-07, moving back for further QA

This looks ok on 2.7.232-alpha-2018-05-14


I did run into what could be considered an issue or I may have misread desired de-duplication behavior.
I set the device up thusly:

Installed the app and I am seeing this in onboarding:

@RHo and/or @cooltey what do you think?

cooltey added a comment.EditedMay 14 2018, 11:41 PM

@ABorbaWMF
Thanks! I think this is a bug that should be fixed, will create a patch to fix it.

簡體中文 => Simplified Chinese

繁體中文 => Traditional Chinese

Change 433091 had a related patch set uploaded (by Cooltey; owner: Cooltey):
[apps/android/wikipedia@master] Fix: Hide duplicate variants in the suggested languages of "Add a language" page

https://gerrit.wikimedia.org/r/433091

Change 433091 merged by jenkins-bot:
[apps/android/wikipedia@master] Fix: Hide duplicate variants in the suggested languages of "Add a language" page

https://gerrit.wikimedia.org/r/433091

@RHo
Have made changes to fix the bug of showing duplicate variants in the list.

moving for QA signoff since there's no specific design signoff required

Dbrant closed this task as Resolved.Jun 27 2018, 8:04 PM