You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2023-04-17] Detect language on Sign In screen #16491
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.
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.
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
Activity
MelvinBot commentedon Mar 24, 2023
Triggered auto assignment to @johncschuster (
NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details.fabioh8010 commentedon Mar 27, 2023
Hi, I'm Fabio from Callstack and I would like to work on this issue.
MelvinBot commentedon Mar 27, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01e3324bba96a9482c
MelvinBot commentedon Mar 27, 2023
Triggered auto assignment to Contributor Plus for review of internal employee PR - @sobitneupane (
Internal)puneetlath commentedon Mar 27, 2023
Thanks @fabioh8010. Looking forward to your proposal.
fabioh8010 commentedon Mar 29, 2023
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 usingRNLocalize.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 returnundefined, so we will default toenin 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
6 remaining items
fabioh8010 commentedon Mar 31, 2023
Update: Draft PR is ready and it is being reviewed internally.
fabioh8010 commentedon Apr 4, 2023
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.
fabioh8010 commentedon Apr 6, 2023
Update: PR is ready for review.
[-]Detect language on Sign In screen[/-][+][HOLD for payment 2023-04-17] Detect language on Sign In screen[/+]MelvinBot commentedon Apr 10, 2023
Reviewinglabel has been removed, please complete the "BugZero Checklist".MelvinBot commentedon Apr 10, 2023
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.
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
puneetlath commentedon Apr 17, 2023
@sobitneupane sent you a contract: https://www.upwork.com/nx/wm/pre-hire/c/8577561/offer/24155032
puneetlath commentedon Apr 17, 2023
All paid. Thanks everyone!