Skip to content

[HOLD for payment 2023-04-17] Detect language on Sign In screen #16491

Closed

Description

@puneetlath

With this PR, we now pass the language the user sets on the SignIn screen to the API as part of the sign in flow so that the user will have that language set in their account when they land in their account.

However, the language selector is small and hard to find on the sign in screen. A further improvement would be to detect the device's language and set the language on that screen accordingly. Right now we only support English and Spanish, so that would mean that if the device is set to Spanish, use that, otherwise use English.

I happened across this library from our friend zoontek which seems to work on mobile and web, but maybe a library is not needed and we can just do this via JS.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e3324bba96a9482c
  • Upwork Job ID: 1640348697608478720
  • Last Price Increase: 2023-03-27

Activity

  1. self-assigned this
    on Mar 24, 2023
  2. MelvinBot commented on Mar 24, 2023

    @MelvinBot
    Contributor
  3. fabioh8010 commented on Mar 27, 2023

    @fabioh8010
    Contributor

    Hi, I'm Fabio from Callstack and I would like to work on this issue.

  4. added
    InternalRequires API changes or must be handled by Expensify staff
    on Mar 27, 2023
  5. MelvinBot commented on Mar 27, 2023

    @MelvinBot
    Contributor
  6. MelvinBot commented on Mar 27, 2023

    @MelvinBot
    Contributor

    Triggered auto assignment to Contributor Plus for review of internal employee PR - @sobitneupane (Internal)

  7. puneetlath commented on Mar 27, 2023

    @puneetlath
    ContributorAuthor

    Thanks @fabioh8010. Looking forward to your proposal.

  8. fabioh8010 commented on Mar 29, 2023

    @fabioh8010
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    In the SignIn screen the user can select the language to be used on the application using a picker, but it's quite hidden and will go unnoticed for most people (specially on mobile). We should have a way to select the language automatically based on user device's language preferences.

    What is the root cause of that problem?

    We have a language picker on SignIn screen that the user can use to change the application's language at will, but as stated it's hard to find and will go unnoticed for most people, specially on mobile because the user has to scroll all the way down to find it.

    What changes do you think we should make in order to solve the problem?

    We suggest using react-native-localize library as it will provide an easy and cross-platform way to get the user's preferred languages.

    In SignInScreen, we'll get the user's preferred languages during mounting using RNLocalize.findBestAvailableLanguage() method. This method returns a list of the best user device's available languages that could match the list of languages we are going to pass in the parameters. The method can return undefined, so we will default to en in this case. Here is a code snippet of how it could be: const userPreferredLanguage = lodashGet(RNLocalize.findBestAvailableLanguage(['en', 'es']), 'languageTag', 'en');.

    After that, we are going to use App.setLocale() method to set and persist the language in the application, updating the screens automatically.

    Solution was tested on all platforms.

    Screen.Recording.2023-03-29.at.13.29.42.mov
  9. 6 remaining items

  10. fabioh8010 commented on Mar 31, 2023

    @fabioh8010
    Contributor

    Update: Draft PR is ready and it is being reviewed internally.

  11. fabioh8010 commented on Apr 4, 2023

    @fabioh8010
    Contributor

    Update: PR is still under internal QA review, we found an issue regarding Android, but we are investigating if it's an issue with emulators or not.

  12. fabioh8010 commented on Apr 6, 2023

    @fabioh8010
    Contributor

    Update: PR is ready for review.

  13. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Apr 10, 2023
  14. changed the title [-]Detect language on Sign In screen[/-] [+][HOLD for payment 2023-04-17] Detect language on Sign In screen[/+] on Apr 10, 2023
  15. MelvinBot commented on Apr 10, 2023

    @MelvinBot
    Contributor

    Reviewing label has been removed, please complete the "BugZero Checklist".

  16. MelvinBot commented on Apr 10, 2023

    @MelvinBot
    Contributor

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.2.97-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2023-04-17. 🎊

    After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

    • External issue reporter n/a
    • Contributor that fixed the issue n/a
    • Contributor+ that helped on the issue and/or PR @sobitneupane

    As a reminder, here are the bonuses/penalties that should be applied for any External issue:

    • Merged PR within 3 business days of assignment - 50% bonus
    • Merged PR more than 9 business days after assignment - 50% penalty
  17. puneetlath commented on Apr 17, 2023

    @puneetlath
    ContributorAuthor
  18. puneetlath commented on Apr 17, 2023

    @puneetlath
    ContributorAuthor

    All paid. Thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2InternalRequires API changes or must be handled by Expensify staffNewFeatureSomething to build that is a new item.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions