-
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
feat: support Spanish emojis #20828
feat: support Spanish emojis #20828
Conversation
@0xmiroslav Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
src/CONST.js
Outdated
@@ -1331,20 +1331,20 @@ const CONST = { | |||
|
|||
QUICK_REACTIONS: [ | |||
{ | |||
name: '+1', | |||
shortcode: {en: '+1', es: '+1'}, |
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.
Can you stick to original structure? I don't see any reason why name
should be changed to shortcode
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.
This is for clarity. They are not names of emojis, just short codes of them. I mentioned this in issue before
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.
Strictly, they are "short name", not code.
If I follow you, code = '😄', short code = 'smile',
Why code
length should be smaller than short code
length?
As we don't support name for now, we can just use name
instead of short name
.
So let's keep original structure.
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 think that the name should always be in english. In the database we save the reactions like this:
{"emoji":"heart","users":[{"accountID":8505565,"skinTone":-1}...]
If we start changing that then you would be able to react with the same emoji in both english and spanish.
src/CONST.js
Outdated
code: '👍', | ||
types: ['👍🏿', '👍🏾', '👍🏽', '👍🏼', '👍🏻'], | ||
types: ['👍🏻', '👍🏼', '👍🏽', '👍🏾', '👍🏿'], |
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.
NAB but why orders changed?
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.
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 am also confused. As far as I can tell the types are already displayed in that order, so I don't understand why we need to change this
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.
As you can see below, skintone numbering is weird. I think this change is reasonable.
Lines 56 to 81 in 83ab016
const skinTones = [ | |
{ | |
code: '🖐', | |
skinTone: -1, | |
}, | |
{ | |
code: '🖐🏻', | |
skinTone: 4, | |
}, | |
{ | |
code: '🖐🏼', | |
skinTone: 3, | |
}, | |
{ | |
code: '🖐🏽', | |
skinTone: 2, | |
}, | |
{ | |
code: '🖐🏾', | |
skinTone: 1, | |
}, | |
{ | |
code: '🖐🏿', | |
skinTone: 0, | |
}, | |
]; |
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.
Please make sure that this order change doesn't cause any regressions even if it's minor.
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.
Yeah. I'm sure
@@ -12,7 +12,7 @@ const propTypes = { | |||
/** The emojis consisting emoji code and indices that the icons should link to */ | |||
headerEmojis: PropTypes.arrayOf( | |||
PropTypes.shape({ | |||
code: PropTypes.string.isRequired, | |||
name: PropTypes.string.isRequired, |
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.
Same here. I don't see any reason of code -> name
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.
Headers has no code unlike emojis. It has only name and icon. I wanted to add meanings to the properties
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.
We already have localized strings here:
Lines 1221 to 1233 in edf529e
headers: { | |
frequentlyUsed: 'Frequently Used', | |
smileysAndEmotion: 'Smileys & Emotion', | |
peopleAndBody: 'People & Body', | |
animalsAndNature: 'Animals & Nature', | |
foodAndDrink: 'Food & Drinks', | |
travelAndPlaces: 'Travel & Places', | |
activities: 'Activities', | |
objects: 'Objects', | |
symbols: 'Symbols', | |
flags: 'Flags', | |
}, | |
}, |
We can still use frequentlyUsed
, etc for code.
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.
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'll change the headers back to original Spanish.
But let's keep the current emoji data structure as is. We have all Spanish emojis in its own structure, and we treat headers as emojis as well. Why don't we translate headers in the same place? I don't understand why headers should be in en/es.js. We can safely remove all emojis from en/es.js. This is more clear and reasonable, I think.
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.
@stitesExpensify do you agree with this new structure?
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 think we should think about extension of supported languages, not about original structure.
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'm confused @s-alves10 what is the benefit of this change? In the future we're going to add other files like de.js
which with have german translations etc. for the whole app, so it seems like keeping the current structure makes more sense than changing it
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.
Your updated structure of name -> shortcode, header code -> name can be follow-up if needed.
In this PR, let's reduce code diff as much as possible and try to keep original structure but just add localization.
src/CONST.js
Outdated
@@ -1331,20 +1331,20 @@ const CONST = { | |||
|
|||
QUICK_REACTIONS: [ | |||
{ | |||
name: '+1', | |||
shortcode: {en: '+1', es: '+1'}, |
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.
Strictly, they are "short name", not code.
If I follow you, code = '😄', short code = 'smile',
Why code
length should be smaller than short code
length?
As we don't support name for now, we can just use name
instead of short name
.
So let's keep original structure.
@@ -12,7 +12,7 @@ const propTypes = { | |||
/** The emojis consisting emoji code and indices that the icons should link to */ | |||
headerEmojis: PropTypes.arrayOf( | |||
PropTypes.shape({ | |||
code: PropTypes.string.isRequired, | |||
name: PropTypes.string.isRequired, |
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.
We already have localized strings here:
Lines 1221 to 1233 in edf529e
headers: { | |
frequentlyUsed: 'Frequently Used', | |
smileysAndEmotion: 'Smileys & Emotion', | |
peopleAndBody: 'People & Body', | |
animalsAndNature: 'Animals & Nature', | |
foodAndDrink: 'Food & Drinks', | |
travelAndPlaces: 'Travel & Places', | |
activities: 'Activities', | |
objects: 'Objects', | |
symbols: 'Symbols', | |
flags: 'Flags', | |
}, | |
}, |
We can still use frequentlyUsed
, etc for code.
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'm a bit confused about some of these changes. I was under the impression that we were just adding spanish keywords to the file, and creating a spanish Trie. If you could clarify why other changes were necessary that would be great @s-alves10
src/CONST.js
Outdated
code: '👍', | ||
types: ['👍🏿', '👍🏾', '👍🏽', '👍🏼', '👍🏻'], | ||
types: ['👍🏻', '👍🏼', '👍🏽', '👍🏾', '👍🏿'], |
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 am also confused. As far as I can tell the types are already displayed in that order, so I don't understand why we need to change this
src/CONST.js
Outdated
@@ -1331,20 +1331,20 @@ const CONST = { | |||
|
|||
QUICK_REACTIONS: [ | |||
{ | |||
name: '+1', | |||
shortcode: {en: '+1', es: '+1'}, |
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 think that the name should always be in english. In the database we save the reactions like this:
{"emoji":"heart","users":[{"accountID":8505565,"skinTone":-1}...]
If we start changing that then you would be able to react with the same emoji in both english and spanish.
@@ -12,7 +12,7 @@ const propTypes = { | |||
/** The emojis consisting emoji code and indices that the icons should link to */ | |||
headerEmojis: PropTypes.arrayOf( | |||
PropTypes.shape({ | |||
code: PropTypes.string.isRequired, | |||
name: PropTypes.string.isRequired, |
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'm confused @s-alves10 what is the benefit of this change? In the future we're going to add other files like de.js
which with have german translations etc. for the whole app, so it seems like keeping the current structure makes more sense than changing it
@stitesExpensify @0xmiroslav Thank you for your feedback Emojis have its own data structure supporting multiple languages.
|
I am not opposed your suggestion but this was what I suggested. @stitesExpensify what do you suggest? |
I agree. I don't think that we need to make such big changes in this PR. All we really want from this PR is for typing |
@s-alves10 lint failing. Please make sure to test all possible cases. Though I already tested, there might still be any missing case. |
Will you take a look at the PR again? |
It's US holiday today. Let's wait one more day |
Hi there! Taking a look! |
@s-alves10 please fix conflict |
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.
Code is looking great! Just a couple of small questions before I approve
Please take a look at the changes. Thank you |
✋ 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/stitesExpensify in version: 1.3.39-0 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.39-11 🚀
|
Just coming from this issue that fixed a bug that this PR introduced that caused duplicate suggestions to appear. Since we add the English Trie node with the suggestion's name in English, this won't match the equivalent Spanish emoji name, so it gets added as a separate match here: Line 381 in 3f9f1e6
|
Details
Fixed Issues
$ #16086
PROPOSAL: #16086 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.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
Web
16086_mac_chrome.mp4
Mobile Web - Chrome
16086_anrdoid_chrome.mp4
Mobile Web - Safari
16086_ios_safari.mp4
Desktop
16086_mac_desktop.mp4
iOS
16086_ios_native.mp4
Android
16086_anroid_native.mp4