-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Onfido] Fix use of locale in Onfido #17943
[Onfido] Fix use of locale in Onfido #17943
Conversation
Signed-off-by: Prince Mendiratta <prince.mendi@gmail.com>
@@ -105,7 +105,7 @@ class Onfido extends React.Component { | |||
Log.hmmm('Onfido user closed the modal'); | |||
}, | |||
language: { | |||
locale: this.props.preferredLocale, | |||
locale: this.props.preferredLocale === CONST.LOCALES.ES ? CONST.ONFIDO.ES_ES_LOCALE : CONST.LOCALES.EN, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion:
Expensify currently supports english and spanish.
But can we make it as below, so that other languages work if included in future
locale: this.props.preferredLocale === CONST.LOCALES.ES ? CONST.ONFIDO.ES_ES_LOCALE : this.props.preferredLocale
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @saiKumarGanji, that's a good idea. But I'm still unsure about the supported language for customization. In the doc example for en
, it's using en_US
. Also based on the repo https://github.com/onfido/onfido-sdk-ui/tree/master/locales the locals also have specific tags for other languages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mollfpr Let's keep it en
for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Prince-Mendiratta Is there any difference if we use en
without a tag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mollfpr Nope, works well with just en
as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Prince-Mendiratta Let's move it to a better place, and have a fallback to the preferredLocale
.
Signed-off-by: Prince Mendiratta <prince.mendi@gmail.com>
@mollfpr updated! |
src/CONST.js
Outdated
@@ -910,6 +910,7 @@ const CONST = { | |||
ES: 'es', | |||
|
|||
DEFAULT: 'en', | |||
ES_ES_ONFIDO: 'es_ES', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like its place below the ES_ES
; it's easy to notice the difference. Let's leave DEFAULT
alone 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mollfpr yeah that'd looks good, updated!
@@ -105,7 +105,7 @@ class Onfido extends React.Component { | |||
Log.hmmm('Onfido user closed the modal'); | |||
}, | |||
language: { | |||
locale: this.props.preferredLocale, | |||
locale: this.props.preferredLocale === CONST.LOCALES.ES ? CONST.LOCALES.ES_ES_ONFIDO : this.props.preferredLocale, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, let's add a description of why we can't use CONST.LOCALES.ES
here.
Signed-off-by: Prince Mendiratta <prince.mendi@gmail.com>
Signed-off-by: Prince Mendiratta <prince.mendi@gmail.com>
Reviewer Checklist
Screenshots/VideosMobile Web - ChromeMobile Web - SafariiOSAndroid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and tests well 👍
All yours @neil-marcellini
Thanks all! Sorry for the regression and delay on this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! I'm not sure how we missed it before, I could have sworn I tested it and it displayed properly in Spanish before.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/neil-marcellini in version: 1.3.9-12 🚀
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.12-0 🚀
|
Details
With this PR, we are adding the changes to ensure that the Onfido flow initialises in Spanish if the user locale is Spanish.
Fixed Issues
$ #17789
$ #17244 (comment)
PROPOSAL: #17789 (comment)
Tests
Back
for english.Volver
when hovering over the back button.Offline tests
N/A
QA Steps
Same as above.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
I have added screenshots only for the platforms affected. Let me know if you think otherwise and other are required as well.
Web
Desktop