-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[#13104] Accounts request form: auto-unify country names #13117
[#13104] Accounts request form: auto-unify country names #13117
Conversation
#13104 Waiting review... |
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.
Here are some thoughts on this.
'United States': 'USA', | ||
US: 'USA', | ||
America: 'USA', | ||
UK: 'United Kingdom', | ||
Deutschland: 'Germany', |
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.
Are these the only possibilities?
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 added some countries to the list with the change in the issue, and also included the possibility to correct any capitalization typos in the listed countries.
// Country Mapping | ||
const countryMapping: { [key: string]: string } = { | ||
'United States': 'USA', | ||
US: 'USA', | ||
America: 'USA', | ||
UK: 'United Kingdom', | ||
Deutschland: 'Germany', | ||
}; |
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 feel like there is a better place to put this. I am not completely sure where though; perhaps another reviewer has a better idea. However, maybe at the very least, it should be outside the function, like maybe it should be a class constant.
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 was thinking of creating another class so that the map can only be accessed with a method and cannot be modified, but I'm not sure if it's the correct apporach.
@franciscoSavala I have updated #13104 with a list of common replacements to include |
Folks, This PR seems to be stalling (no activities for the past 7 days). 🐌 😢 |
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
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
Part of #13104
Outline of Solution
Added common variations for countries with help of this dataset. I am waiting for a response from the core team to know the common variations in country names. Until then, this is an idea of what the solution could be.
The solution takes the country given by free text of the request account form and then maps it with known countries. Otherwise, it leaves it as is.