-
Notifications
You must be signed in to change notification settings - Fork 2
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
Country code conversion review #3
Open
mousebaiker
wants to merge
6
commits into
master
Choose a base branch
from
develop
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2418ea6
Refactor for automatic country processing.
mousebaiker 08ad70f
Merge pull request #1 from mousebaiker/master
UladBohdan 8df9d8c
Add full country name to ISO code conversion.
mousebaiker ecebb0b
Display flags for provinces
mousebaiker d5df99e
Aggregate provinces of a single country to a single table row.
mousebaiker a3a6751
Merge pull request #4 from UladBohdan/aggregation
UladBohdan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,251 @@ | ||
var countryToCodeMap = { | ||
'Afghanistan': 'AF', | ||
'Åland Islands': 'AX', | ||
'Albania': 'AL', | ||
'Algeria': 'DZ', | ||
'American Samoa': 'AS', | ||
'Andorra': 'AD', | ||
'Angola': 'AO', | ||
'Anguilla': 'AI', | ||
'Antarctica': 'AQ', | ||
'Antigua and Barbuda': 'AG', | ||
'Argentina': 'AR', | ||
'Armenia': 'AM', | ||
'Aruba': 'AW', | ||
'Australia': 'AU', | ||
'Austria': 'AT', | ||
'Azerbaijan': 'AZ', | ||
'Bahrain': 'BH', | ||
'Bahamas': 'BS', | ||
'Bangladesh': 'BD', | ||
'Barbados': 'BB', | ||
'Belarus': 'BY', | ||
'Belgium': 'BE', | ||
'Belize': 'BZ', | ||
'Benin': 'BJ', | ||
'Bermuda': 'BM', | ||
'Bhutan': 'BT', | ||
'Bolivia, Plurinational State of': 'BO', | ||
'Bonaire, Sint Eustatius and Saba': 'BQ', | ||
'Bosnia and Herzegovina': 'BA', | ||
'Botswana': 'BW', | ||
'Bouvet Island': 'BV', | ||
'Brazil': 'BR', | ||
'British Indian Ocean Territory': 'IO', | ||
'Brunei Darussalam': 'BN', | ||
'Bulgaria': 'BG', | ||
'Burkina Faso': 'BF', | ||
'Burundi': 'BI', | ||
'Cambodia': 'KH', | ||
'Cameroon': 'CM', | ||
'Canada': 'CA', | ||
'Cape Verde': 'CV', | ||
'Cayman Islands': 'KY', | ||
'Central African Republic': 'CF', | ||
'Chad': 'TD', | ||
'Chile': 'CL', | ||
'China': 'CN', | ||
'Christmas Island': 'CX', | ||
'Cocos (Keeling) Islands': 'CC', | ||
'Colombia': 'CO', | ||
'Comoros': 'KM', | ||
'Congo': 'CG', | ||
'Congo, the Democratic Republic of the': 'CD', | ||
'Cook Islands': 'CK', | ||
'Costa Rica': 'CR', | ||
'Côte d\'Ivoire': 'CI', | ||
'Croatia': 'HR', | ||
'Cuba': 'CU', | ||
'Curaçao': 'CW', | ||
'Cyprus': 'CY', | ||
'Czech Republic': 'CZ', | ||
'Denmark': 'DK', | ||
'Djibouti': 'DJ', | ||
'Dominica': 'DM', | ||
'Dominican Republic': 'DO', | ||
'Ecuador': 'EC', | ||
'Egypt': 'EG', | ||
'El Salvador': 'SV', | ||
'Equatorial Guinea': 'GQ', | ||
'Eritrea': 'ER', | ||
'Estonia': 'EE', | ||
'Ethiopia': 'ET', | ||
'Falkland Islands (Malvinas)': 'FK', | ||
'Faroe Islands': 'FO', | ||
'Fiji': 'FJ', | ||
'Finland': 'FI', | ||
'France': 'FR', | ||
'French Guiana': 'GF', | ||
'French Polynesia': 'PF', | ||
'French Southern Territories': 'TF', | ||
'Gabon': 'GA', | ||
'Gambia': 'GM', | ||
'Georgia': 'GE', | ||
'Germany': 'DE', | ||
'Ghana': 'GH', | ||
'Gibraltar': 'GI', | ||
'Greece': 'GR', | ||
'Greenland': 'GL', | ||
'Grenada': 'GD', | ||
'Guadeloupe': 'GP', | ||
'Guam': 'GU', | ||
'Guatemala': 'GT', | ||
'Guernsey': 'GG', | ||
'Guinea': 'GN', | ||
'Guinea-Bissau': 'GW', | ||
'Guyana': 'GY', | ||
'Haiti': 'HT', | ||
'Heard Island and McDonald Islands': 'HM', | ||
'Holy See (Vatican City State)': 'VA', | ||
'Honduras': 'HN', | ||
'Hong Kong': 'HK', | ||
'Hungary': 'HU', | ||
'Iceland': 'IS', | ||
'India': 'IN', | ||
'Indonesia': 'ID', | ||
'Iran, Islamic Republic of': 'IR', | ||
'Iraq': 'IQ', | ||
'Ireland': 'IE', | ||
'Isle of Man': 'IM', | ||
'Israel': 'IL', | ||
'Italy': 'IT', | ||
'Jamaica': 'JM', | ||
'Japan': 'JP', | ||
'Jersey': 'JE', | ||
'Jordan': 'JO', | ||
'Kazakhstan': 'KZ', | ||
'Kenya': 'KE', | ||
'Kiribati': 'KI', | ||
'Korea, Democratic People\'s Republic of': 'KP', | ||
'Korea, Republic of': 'KR', | ||
'Kuwait': 'KW', | ||
'Kyrgyzstan': 'KG', | ||
'Lao People\'s Democratic Republic': 'LA', | ||
'Latvia': 'LV', | ||
'Lebanon': 'LB', | ||
'Lesotho': 'LS', | ||
'Liberia': 'LR', | ||
'Libya': 'LY', | ||
'Liechtenstein': 'LI', | ||
'Lithuania': 'LT', | ||
'Luxembourg': 'LU', | ||
'Macao': 'MO', | ||
'Macedonia, the Former Yugoslav Republic of': 'MK', | ||
'Madagascar': 'MG', | ||
'Malawi': 'MW', | ||
'Malaysia': 'MY', | ||
'Maldives': 'MV', | ||
'Mali': 'ML', | ||
'Malta': 'MT', | ||
'Marshall Islands': 'MH', | ||
'Martinique': 'MQ', | ||
'Mauritania': 'MR', | ||
'Mauritius': 'MU', | ||
'Mayotte': 'YT', | ||
'Mexico': 'MX', | ||
'Micronesia, Federated States of': 'FM', | ||
'Moldova, Republic of': 'MD', | ||
'Monaco': 'MC', | ||
'Mongolia': 'MN', | ||
'Montenegro': 'ME', | ||
'Montserrat': 'MS', | ||
'Morocco': 'MA', | ||
'Mozambique': 'MZ', | ||
'Myanmar': 'MM', | ||
'Namibia': 'NA', | ||
'Nauru': 'NR', | ||
'Nepal': 'NP', | ||
'Netherlands': 'NL', | ||
'New Caledonia': 'NC', | ||
'New Zealand': 'NZ', | ||
'Nicaragua': 'NI', | ||
'Niger': 'NE', | ||
'Nigeria': 'NG', | ||
'Niue': 'NU', | ||
'Norfolk Island': 'NF', | ||
'Northern Mariana Islands': 'MP', | ||
'Norway': 'NO', | ||
'Oman': 'OM', | ||
'Pakistan': 'PK', | ||
'Palau': 'PW', | ||
'Palestine, State of': 'PS', | ||
'Panama': 'PA', | ||
'Papua New Guinea': 'PG', | ||
'Paraguay': 'PY', | ||
'Peru': 'PE', | ||
'Philippines': 'PH', | ||
'Pitcairn': 'PN', | ||
'Poland': 'PL', | ||
'Portugal': 'PT', | ||
'Puerto Rico': 'PR', | ||
'Qatar': 'QA', | ||
'Réunion': 'RE', | ||
'Romania': 'RO', | ||
'Russian Federation': 'RU', | ||
'Rwanda': 'RW', | ||
'Saint Barthélemy': 'BL', | ||
'Saint Helena, Ascension and Tristan da Cunha': 'SH', | ||
'Saint Kitts and Nevis': 'KN', | ||
'Saint Lucia': 'LC', | ||
'Saint Martin (French part)': 'MF', | ||
'Saint Pierre and Miquelon': 'PM', | ||
'Saint Vincent and the Grenadines': 'VC', | ||
'Samoa': 'WS', | ||
'San Marino': 'SM', | ||
'Sao Tome and Principe': 'ST', | ||
'Saudi Arabia': 'SA', | ||
'Senegal': 'SN', | ||
'Serbia': 'RS', | ||
'Seychelles': 'SC', | ||
'Sierra Leone': 'SL', | ||
'Singapore': 'SG', | ||
'Sint Maarten (Dutch part)': 'SX', | ||
'Slovakia': 'SK', | ||
'Slovenia': 'SI', | ||
'Solomon Islands': 'SB', | ||
'Somalia': 'SO', | ||
'South Africa': 'ZA', | ||
'South Georgia and the South Sandwich Islands': 'GS', | ||
'South Sudan': 'SS', | ||
'Spain': 'ES', | ||
'Sri Lanka': 'LK', | ||
'Sudan': 'SD', | ||
'Suriname': 'SR', | ||
'Svalbard and Jan Mayen': 'SJ', | ||
'Swaziland': 'SZ', | ||
'Sweden': 'SE', | ||
'Switzerland': 'CH', | ||
'Syrian Arab Republic': 'SY', | ||
'Taiwan, Province of China': 'TW', | ||
'Tajikistan': 'TJ', | ||
'Tanzania, United Republic of': 'TZ', | ||
'Thailand': 'TH', | ||
'Timor-Leste': 'TL', | ||
'Togo': 'TG', | ||
'Tokelau': 'TK', | ||
'Tonga': 'TO', | ||
'Trinidad and Tobago': 'TT', | ||
'Tunisia': 'TN', | ||
'Turkey': 'TR', | ||
'Turkmenistan': 'TM', | ||
'Turks and Caicos Islands': 'TC', | ||
'Tuvalu': 'TV', | ||
'Uganda': 'UG', | ||
'Ukraine': 'UA', | ||
'United Arab Emirates': 'AE', | ||
'United Kingdom': 'GB', | ||
'United States': 'US', | ||
'United States Minor Outlying Islands': 'UM', | ||
'Uruguay': 'UY', | ||
'Uzbekistan': 'UZ', | ||
'Vanuatu': 'VU', | ||
'Venezuela, Bolivarian Republic of': 'VE', | ||
'Viet Nam': 'VN', | ||
'Virgin Islands, British': 'VG', | ||
'Virgin Islands, U.S.': 'VI', | ||
'Wallis and Futuna': 'WF', | ||
'Western Sahara': 'EH', | ||
'Yemen': 'YE', | ||
'Zambia': 'ZM', | ||
'Zimbabwe': 'ZW', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,21 @@ | ||
var countries = { | ||
common: [ | ||
'BY', | ||
'UA', | ||
'RU', | ||
'PL', | ||
'Germany', | ||
'BG', | ||
'CZ', | ||
'LT', | ||
'LV', | ||
'EE', | ||
'Moldova', | ||
'CH', | ||
'FR', | ||
'LI', | ||
'SE', | ||
'RU-MOW', | ||
'RU-SPE', | ||
'RU-LEN', | ||
'Iran', | ||
'Denmark' | ||
], | ||
ulad: ['GB', 'PT', 'US', 'US-CA', 'US-WA', 'MX', 'CU', 'RU-KDA', 'GE', 'US-NV', 'US-MA', 'US-NY', 'US-OR', 'Canada', 'CA-BC', 'US-HI', 'CA-ON', 'CA-QC', 'RU-MOS'], | ||
marie: ['IT', 'NO', 'TR', 'RU-KR', 'Finland', 'RU-MUR', 'RU-PSK', 'RU-NGR'] | ||
var users = { | ||
ulad: { | ||
displayNames: { | ||
en: 'Ulad', | ||
}, | ||
countries: ['Belarus', 'Ukraine', 'Poland', 'Germany', 'Bulgaria', 'Czech Republic', 'Lithuania', 'Latvia', 'Estonia', | ||
'Moldova, Republic of', 'Switzerland', 'France', 'Liechtenstein', 'Sweden', 'RU-MOW', 'RU-SPE', 'RU-LEN', 'Iran, Islamic Republic of', | ||
'Denmark', 'United Kingdom', 'Portugal', 'US-CA', 'US-WA', 'Mexico', 'Cuba', 'RU-KDA', 'Georgia', | ||
'US-NV', 'US-MA', 'US-NY', 'US-OR', 'CA-BC', 'US-HI', 'CA-ON', | ||
'CA-QC', 'RU-MOS'], | ||
}, | ||
marie: { | ||
displayNames: { | ||
en: 'Marie', | ||
}, | ||
countries: ['Belarus', 'Ukraine', 'Poland', 'Germany', 'Bulgaria', 'Czech Republic', 'Lithuania', 'Latvia', 'Estonia', | ||
'Moldova, Republic of', 'Switzerland', 'France', 'Liechtenstein', 'Sweden', 'RU-MOW', 'RU-SPE', 'RU-LEN', 'Iran, Islamic Republic of', | ||
'Denmark', 'Italy', 'Norway', 'Turkey', 'RU-KR', 'Finland', 'RU-MUR', 'RU-PSK', | ||
'RU-NGR'], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 unsure about the spellings of some countries and if google charts can recognize them - such as
Holy See (Vatican City State)
,Côte d\'Ivoire
,Åland Islands
etc., but I did verify they work just fine.Good job!
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.
Thank you for review and actual verification. I did not check if they worked myself; just believed that Wikipedia listing will have them named in a proper manner and decided that they countries are not the most popular and can be checked when somebody actually visits them.