teammates
teammates copied to clipboard
Accounts request form: auto-unify country names
Current:
- Users type in the country name as free text, which means the same country can be represented in many ways e.g.,
United States
,USA
,US
, etc. - For the sake of keeping data somewhat uniform, the admin manually edits the country field to a common one e.g.,
USA
for the above example.
Suggested:
- Hardcode an internal map of commonly used variations and replace them automatically when saving the account request. This is a bit hackish, but can reduce the manual editing the admin needs to do. If taking this route, ask me for such common variations that should be tackled (probably less than 10, but happens frequently). Here is the list:
-
USA
:U.S.A
,United States
,America
, ... -
UK
: ... -
UAE
: ... -
Germany
:Deutschland
-
Netherlands
: ... -
Belgium
:België
-
Brazil
:Brasil
-
Spain
:España
-
Mexico
:México
-
Italy
:Italia
-
- Alternatively, we can also think of allowing users to choose from a drop-down but this has it's own issues e.g., disagreements of which are considered countries. In any case, some institutions are not anchored into one country, which means we still have to provide the free text route.
I would like to contribute with the first alternative, it would be useful to have the common variations of the countries
@damithc I think we can implement a search bar for Country/Region that allows the user to input a value and choose a match from a drop-down menu. If the input doesn't match with any item, then we can simply store the user input? If you think it's a good idea, I can work on it.
example:
@damithc I think we can implement a search bar for Country/Region that allows the user to input a value and choose a match from a drop-down menu. If the input doesn't match with any item, then we can simply store the user input? If you think it's a good idea, I can work on it.
@Shihuihuang1103 Thanks for your interest in this issue. I'm curious as to which list of countries do you propose to use?
@damithc I found these two sources for list of countries and regions:
- https://en.wikipedia.org/wiki/List_of_countries_and_territories_by_the_United_Nations_geoscheme
- https://www.ucl.ac.uk/global/regional-activity/countries-and-regions-directory
Please let me know if you think either of the above lists would be a good reference for this feature, or if you have another list in mind. Thank you!
@damithc @Shihuihuang1103 Hi, I was doing some research related to this issue, and I think that the ISO 3166 standard would be a good reference point for implementing this feature, as it is a universally accepted standard for country identification, and are easily integrated into the existing codebase with libraries such as iso-3166-1-alpha-2 and iso-3166-1.
@damithc @Shihuihuang1103 Hi, I was doing some research related to this issue, and I think that the ISO 3166 standard would be a good reference point for implementing this feature, as it is a universally accepted standard for country identification, and are easily integrated into the existing codebase with libraries such as iso-3166-1-alpha-2 and iso-3166-1.
@itstrueitstrueitsrealitsreal Sorry, I missed this earlier. Yes, this seems like a good way to go, provided users will still have the option to type their own as well.