From f6f2c4b5e19eb55e6f895f97b3f89d083d809074 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Sat, 3 Oct 2020 11:21:44 -0700 Subject: [PATCH] Add country name download script. --- lang/{uk_UA.json => uk-UA.json} | 0 package.json | 3 ++- public/country/id-ID.json | 1 + public/country/uk-UA.json | 1 + scripts/download-country-names.js | 39 +++++++++++++++++++++++++++++++ 5 files changed, 43 insertions(+), 1 deletion(-) rename lang/{uk_UA.json => uk-UA.json} (100%) create mode 100644 public/country/id-ID.json create mode 100644 public/country/uk-UA.json create mode 100644 scripts/download-country-names.js diff --git a/lang/uk_UA.json b/lang/uk-UA.json similarity index 100% rename from lang/uk_UA.json rename to lang/uk-UA.json diff --git a/package.json b/package.json index 54512997..9c6e899e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "umami", - "version": "0.73.0", + "version": "0.74.0", "description": "A simple, fast, website analytics alternative to Google Analytics. ", "author": "Mike Cao ", "license": "MIT", @@ -32,6 +32,7 @@ "format-lang": "node scripts/format-lang.js", "compile-lang": "formatjs compile-folder --ast build lang-compiled", "check-lang": "node scripts/check-lang.js", + "download-country-names": "node scripts/download-country-names.js", "loadtest": "node scripts/loadtest.js", "loadtest:medium": "node scripts/loadtest.js --weight=medium", "loadtest:heavy": "node scripts/loadtest.js --weight=heavy --verbose" diff --git a/public/country/id-ID.json b/public/country/id-ID.json new file mode 100644 index 00000000..13a6220a --- /dev/null +++ b/public/country/id-ID.json @@ -0,0 +1 @@ +{"AF":"Afganistan","ZA":"Afrika Selatan","AL":"Albania","DZ":"Aljazair","US":"Amerika Serikat","AD":"Andorra","AO":"Angola","AI":"Anguilla","AQ":"Antarktika","AG":"Antigua dan Barbuda","SA":"Arab Saudi","AR":"Argentina","AM":"Armenia","AW":"Aruba","AU":"Australia","AT":"Austria","AZ":"Azerbaijan","BS":"Bahama","BH":"Bahrain","BD":"Bangladesh","BB":"Barbados","NL":"Belanda","BQ":"Belanda Karibia","BY":"Belarus","BE":"Belgia","BZ":"Belize","BJ":"Benin","BM":"Bermuda","BT":"Bhutan","BO":"Bolivia","BA":"Bosnia dan Herzegovina","BW":"Botswana","BR":"Brasil","BN":"Brunei","BG":"Bulgaria","BF":"Burkina Faso","BI":"Burundi","TD":"Cad","CZ":"Ceko","CL":"Cile","CI":"C\u00f4te d\u2019Ivoire","CW":"Cura\u00e7ao","DK":"Denmark","DM":"Dominika","EC":"Ekuador","SV":"El Salvador","ER":"Eritrea","EE":"Estonia","SZ":"eSwatini","ET":"Etiopia","FJ":"Fiji","PH":"Filipina","FI":"Finlandia","GA":"Gabon","GM":"Gambia","GE":"Georgia","GS":"Georgia Selatan & Kep. Sandwich Selatan","GH":"Ghana","GI":"Gibraltar","GD":"Grenada","GL":"Grinlandia","GP":"Guadeloupe","GU":"Guam","GT":"Guatemala","GG":"Guernsey","GN":"Guinea","GQ":"Guinea Ekuatorial","GW":"Guinea-Bissau","GY":"Guyana","GF":"Guyana Prancis","HT":"Haiti","HN":"Honduras","HK":"Hong Kong DAK Tiongkok","HU":"Hungaria","IN":"India","ID":"Indonesia","GB":"Inggris Raya","IQ":"Irak","IR":"Iran","IE":"Irlandia","IS":"Islandia","IL":"Israel","IT":"Italia","JM":"Jamaika","JP":"Jepang","DE":"Jerman","JE":"Jersey","DJ":"Jibuti","NC":"Kaledonia Baru","KH":"Kamboja","CM":"Kamerun","CA":"Kanada","KZ":"Kazakstan","KE":"Kenya","AX":"Kepulauan Aland","KY":"Kepulauan Cayman","CC":"Kepulauan Cocos (Keeling)","CK":"Kepulauan Cook","FK":"Kepulauan Falkland","FO":"Kepulauan Faroe","MP":"Kepulauan Mariana Utara","MH":"Kepulauan Marshall","NF":"Kepulauan Norfolk","PN":"Kepulauan Pitcairn","SB":"Kepulauan Solomon","SJ":"Kepulauan Svalbard dan Jan Mayen","UM":"Kepulauan Terluar A.S.","TC":"Kepulauan Turks dan Caicos","VI":"Kepulauan Virgin Amerika Serikat","VG":"Kepulauan Virgin Britania Raya","WF":"Kepulauan Wallis dan Futuna","KG":"Kirgistan","KI":"Kiribati","CO":"Kolombia","KM":"Komoro","CG":"Kongo - Brazzaville","CD":"Kongo - Kinshasa","KR":"Korea Selatan","KP":"Korea Utara","CR":"Kosta Rika","HR":"Kroasia","CU":"Kuba","KW":"Kuwait","LA":"Laos","LV":"Latvia","LB":"Lebanon","LS":"Lesotho","LR":"Liberia","LY":"Libia","LI":"Liechtenstein","LT":"Lituania","LU":"Luksemburg","MG":"Madagaskar","MO":"Makau DAK Tiongkok","MK":"Makedonia Utara","MV":"Maladewa","MW":"Malawi","MY":"Malaysia","ML":"Mali","MT":"Malta","MA":"Maroko","MQ":"Martinik","MR":"Mauritania","MU":"Mauritius","YT":"Mayotte","MX":"Meksiko","EG":"Mesir","FM":"Mikronesia","MD":"Moldova","MC":"Monako","MN":"Mongolia","ME":"Montenegro","MS":"Montserrat","MZ":"Mozambik","MM":"Myanmar (Burma)","NA":"Namibia","NR":"Nauru","NP":"Nepal","NE":"Niger","NG":"Nigeria","NI":"Nikaragua","NU":"Niue","NO":"Norwegia","OM":"Oman","PK":"Pakistan","PW":"Palau","PA":"Panama","PG":"Papua Nugini","PY":"Paraguay","PE":"Peru","PL":"Polandia","PF":"Polinesia Prancis","PT":"Portugal","FR":"Prancis","PR":"Puerto Riko","BV":"Pulau Bouvet","HM":"Pulau Heard dan Kepulauan McDonald","IM":"Pulau Man","CX":"Pulau Natal","QA":"Qatar","CF":"Republik Afrika Tengah","DO":"Republik Dominika","RE":"R\u00e9union","RO":"Rumania","RU":"Rusia","RW":"Rwanda","EH":"Sahara Barat","BL":"Saint Barth\u00e9lemy","SH":"Saint Helena","KN":"Saint Kitts dan Nevis","LC":"Saint Lucia","MF":"Saint Martin","PM":"Saint Pierre dan Miquelon","VC":"Saint Vincent dan Grenadine","WS":"Samoa","AS":"Samoa Amerika","SM":"San Marino","ST":"Sao Tome dan Principe","NZ":"Selandia Baru","SN":"Senegal","RS":"Serbia","SC":"Seychelles","SL":"Sierra Leone","SG":"Singapura","SX":"Sint Maarten","CY":"Siprus","SK":"Slovakia","SI":"Slovenia","SO":"Somalia","ES":"Spanyol","LK":"Sri Lanka","SD":"Sudan","SS":"Sudan Selatan","SY":"Suriah","SR":"Suriname","SE":"Swedia","CH":"Swiss","TW":"Taiwan","TJ":"Tajikistan","CV":"Tanjung Verde","TZ":"Tanzania","TH":"Thailand","TL":"Timor Leste","CN":"Tiongkok","TG":"Togo","TK":"Tokelau","TO":"Tonga","TT":"Trinidad dan Tobago","TN":"Tunisia","TR":"Turki","TM":"Turkimenistan","TV":"Tuvalu","UG":"Uganda","UA":"Ukraina","AE":"Uni Emirat Arab","UY":"Uruguay","UZ":"Uzbekistan","VU":"Vanuatu","VA":"Vatikan","VE":"Venezuela","VN":"Vietnam","IO":"Wilayah Inggris di Samudra Hindia","PS":"Wilayah Palestina","TF":"Wilayah Selatan Perancis","YE":"Yaman","JO":"Yordania","GR":"Yunani","ZM":"Zambia","ZW":"Zimbabwe"} \ No newline at end of file diff --git a/public/country/uk-UA.json b/public/country/uk-UA.json new file mode 100644 index 00000000..b2605d87 --- /dev/null +++ b/public/country/uk-UA.json @@ -0,0 +1 @@ +{"AU":"\u0410\u0432\u0441\u0442\u0440\u0430\u043b\u0456\u044f","AT":"\u0410\u0432\u0441\u0442\u0440\u0456\u044f","AZ":"\u0410\u0437\u0435\u0440\u0431\u0430\u0439\u0434\u0436\u0430\u043d","AX":"\u0410\u043b\u0430\u043d\u0434\u0441\u044c\u043a\u0456 \u041e\u0441\u0442\u0440\u043e\u0432\u0438","AL":"\u0410\u043b\u0431\u0430\u043d\u0456\u044f","DZ":"\u0410\u043b\u0436\u0438\u0440","AS":"\u0410\u043c\u0435\u0440\u0438\u043a\u0430\u043d\u0441\u044c\u043a\u0435 \u0421\u0430\u043c\u043e\u0430","AO":"\u0410\u043d\u0433\u043e\u043b\u0430","AI":"\u0410\u043d\u0491\u0456\u043b\u044c\u044f","AD":"\u0410\u043d\u0434\u043e\u0440\u0440\u0430","AQ":"\u0410\u043d\u0442\u0430\u0440\u043a\u0442\u0438\u043a\u0430","AG":"\u0410\u043d\u0442\u0438\u0491\u0443\u0430 \u0456 \u0411\u0430\u0440\u0431\u0443\u0434\u0430","AR":"\u0410\u0440\u0433\u0435\u043d\u0442\u0438\u043d\u0430","AW":"\u0410\u0440\u0443\u0431\u0430","AF":"\u0410\u0444\u0433\u0430\u043d\u0456\u0441\u0442\u0430\u043d","BS":"\u0411\u0430\u0433\u0430\u043c\u0441\u044c\u043a\u0456 \u041e\u0441\u0442\u0440\u043e\u0432\u0438","BD":"\u0411\u0430\u043d\u0433\u043b\u0430\u0434\u0435\u0448","BB":"\u0411\u0430\u0440\u0431\u0430\u0434\u043e\u0441","BH":"\u0411\u0430\u0445\u0440\u0435\u0439\u043d","BZ":"\u0411\u0435\u043b\u0456\u0437","BE":"\u0411\u0435\u043b\u044c\u0491\u0456\u044f","BJ":"\u0411\u0435\u043d\u0456\u043d","BM":"\u0411\u0435\u0440\u043c\u0443\u0434\u0441\u044c\u043a\u0456 \u041e\u0441\u0442\u0440\u043e\u0432\u0438","BY":"\u0411\u0456\u043b\u043e\u0440\u0443\u0441\u044c","BG":"\u0411\u043e\u043b\u0433\u0430\u0440\u0456\u044f","BO":"\u0411\u043e\u043b\u0456\u0432\u0456\u044f","BA":"\u0411\u043e\u0441\u043d\u0456\u044f \u0456 \u0413\u0435\u0440\u0446\u0435\u0491\u043e\u0432\u0438\u043d\u0430","BW":"\u0411\u043e\u0442\u0441\u0432\u0430\u043d\u0430","BR":"\u0411\u0440\u0430\u0437\u0456\u043b\u0456\u044f","IO":"\u0411\u0440\u0438\u0442\u0430\u043d\u0441\u044c\u043a\u0430 \u0442\u0435\u0440\u0438\u0442\u043e\u0440\u0456\u044f \u0432 \u0406\u043d\u0434\u0456\u0439\u0441\u044c\u043a\u043e\u043c\u0443 \u041e\u043a\u0435\u0430\u043d\u0456","VG":"\u0411\u0440\u0438\u0442\u0430\u043d\u0441\u044c\u043a\u0456 \u0412\u0456\u0440\u0433\u0456\u043d\u0441\u044c\u043a\u0456 \u043e\u0441\u0442\u0440\u043e\u0432\u0438","BN":"\u0411\u0440\u0443\u043d\u0435\u0439","BF":"\u0411\u0443\u0440\u043a\u0456\u043d\u0430-\u0424\u0430\u0441\u043e","BI":"\u0411\u0443\u0440\u0443\u043d\u0434\u0456","BT":"\u0411\u0443\u0442\u0430\u043d","VU":"\u0412\u0430\u043d\u0443\u0430\u0442\u0443","VA":"\u0412\u0430\u0442\u0438\u043a\u0430\u043d","GB":"\u0412\u0435\u043b\u0438\u043a\u0430 \u0411\u0440\u0438\u0442\u0430\u043d\u0456\u044f","VE":"\u0412\u0435\u043d\u0435\u0441\u0443\u0435\u043b\u0430","UM":"\u0412\u0456\u0434\u0434\u0430\u043b\u0435\u043d\u0456 \u043e\u0441\u0442\u0440\u043e\u0432\u0438 \u0421\u0428\u0410","VI":"\u0412\u0456\u0440\u0433\u0456\u043d\u0441\u044c\u043a\u0456 \u043e\u0441\u0442\u0440\u043e\u0432\u0438, \u0421\u0428\u0410","AM":"\u0412\u0456\u0440\u043c\u0435\u043d\u0456\u044f","VN":"\u0412\u02bc\u0454\u0442\u043d\u0430\u043c","GA":"\u0413\u0430\u0431\u043e\u043d","HT":"\u0413\u0430\u0457\u0442\u0456","GM":"\u0413\u0430\u043c\u0431\u0456\u044f","GH":"\u0413\u0430\u043d\u0430","GN":"\u0413\u0432\u0456\u043d\u0435\u044f","GW":"\u0413\u0432\u0456\u043d\u0435\u044f-\u0411\u0456\u0441\u0430\u0443","HN":"\u0413\u043e\u043d\u0434\u0443\u0440\u0430\u0441","HK":"\u0413\u043e\u043d\u043a\u043e\u043d\u0433, \u041e.\u0410.\u0420. \u041a\u0438\u0442\u0430\u044e","GR":"\u0413\u0440\u0435\u0446\u0456\u044f","GE":"\u0413\u0440\u0443\u0437\u0456\u044f","GY":"\u0490\u0430\u0439\u0430\u043d\u0430","GP":"\u0490\u0432\u0430\u0434\u0435\u043b\u0443\u043f\u0430","GT":"\u0490\u0432\u0430\u0442\u0435\u043c\u0430\u043b\u0430","GG":"\u0490\u0435\u0440\u043d\u0441\u0456","GI":"\u0490\u0456\u0431\u0440\u0430\u043b\u0442\u0430\u0440","GD":"\u0490\u0440\u0435\u043d\u0430\u0434\u0430","GL":"\u0490\u0440\u0435\u043d\u043b\u0430\u043d\u0434\u0456\u044f","GU":"\u0490\u0443\u0430\u043c","DK":"\u0414\u0430\u043d\u0456\u044f","JE":"\u0414\u0436\u0435\u0440\u0441\u0456","DJ":"\u0414\u0436\u0438\u0431\u0443\u0442\u0456","DM":"\u0414\u043e\u043c\u0456\u043d\u0456\u043a\u0430","DO":"\u0414\u043e\u043c\u0456\u043d\u0456\u043a\u0430\u043d\u0441\u044c\u043a\u0430 \u0420\u0435\u0441\u043f\u0443\u0431\u043b\u0456\u043a\u0430","EC":"\u0415\u043a\u0432\u0430\u0434\u043e\u0440","GQ":"\u0415\u043a\u0432\u0430\u0442\u043e\u0440\u0456\u0430\u043b\u044c\u043d\u0430 \u0413\u0432\u0456\u043d\u0435\u044f","ER":"\u0415\u0440\u0438\u0442\u0440\u0435\u044f","SZ":"\u0415\u0441\u0432\u0430\u0442\u0456\u043d\u0456","EE":"\u0415\u0441\u0442\u043e\u043d\u0456\u044f","ET":"\u0415\u0444\u0456\u043e\u043f\u0456\u044f","EG":"\u0404\u0433\u0438\u043f\u0435\u0442","YE":"\u0404\u043c\u0435\u043d","ZM":"\u0417\u0430\u043c\u0431\u0456\u044f","EH":"\u0417\u0430\u0445\u0456\u0434\u043d\u0430 \u0421\u0430\u0445\u0430\u0440\u0430","ZW":"\u0417\u0456\u043c\u0431\u0430\u0431\u0432\u0435","IL":"\u0406\u0437\u0440\u0430\u0457\u043b\u044c","IN":"\u0406\u043d\u0434\u0456\u044f","ID":"\u0406\u043d\u0434\u043e\u043d\u0435\u0437\u0456\u044f","IQ":"\u0406\u0440\u0430\u043a","IR":"\u0406\u0440\u0430\u043d","IE":"\u0406\u0440\u043b\u0430\u043d\u0434\u0456\u044f","IS":"\u0406\u0441\u043b\u0430\u043d\u0434\u0456\u044f","ES":"\u0406\u0441\u043f\u0430\u043d\u0456\u044f","IT":"\u0406\u0442\u0430\u043b\u0456\u044f","JO":"\u0419\u043e\u0440\u0434\u0430\u043d\u0456\u044f","CV":"\u041a\u0430\u0431\u043e-\u0412\u0435\u0440\u0434\u0435","KZ":"\u041a\u0430\u0437\u0430\u0445\u0441\u0442\u0430\u043d","KY":"\u041a\u0430\u0439\u043c\u0430\u043d\u043e\u0432\u0456 \u041e\u0441\u0442\u0440\u043e\u0432\u0438","KH":"\u041a\u0430\u043c\u0431\u043e\u0434\u0436\u0430","CM":"\u041a\u0430\u043c\u0435\u0440\u0443\u043d","CA":"\u041a\u0430\u043d\u0430\u0434\u0430","QA":"\u041a\u0430\u0442\u0430\u0440","KE":"\u041a\u0435\u043d\u0456\u044f","KG":"\u041a\u0438\u0440\u0433\u0438\u0437\u0441\u0442\u0430\u043d","CN":"\u041a\u0438\u0442\u0430\u0439","CY":"\u041a\u0456\u043f\u0440","KI":"\u041a\u0456\u0440\u0456\u0431\u0430\u0442\u0456","CC":"\u041a\u043e\u043a\u043e\u0441\u043e\u0432\u0456 (\u041a\u0456\u043b\u0456\u043d\u0491) \u041e\u0441\u0442\u0440\u043e\u0432\u0438","CO":"\u041a\u043e\u043b\u0443\u043c\u0431\u0456\u044f","KM":"\u041a\u043e\u043c\u043e\u0440\u0438","CG":"\u041a\u043e\u043d\u0433\u043e \u2013 \u0411\u0440\u0430\u0437\u0437\u0430\u0432\u0456\u043b\u044c","CD":"\u041a\u043e\u043d\u0433\u043e \u2013 \u041a\u0456\u043d\u0448\u0430\u0441\u0430","CR":"\u041a\u043e\u0441\u0442\u0430-\u0420\u0456\u043a\u0430","CI":"\u041a\u043e\u0442-\u0434\u02bc\u0406\u0432\u0443\u0430\u0440","CU":"\u041a\u0443\u0431\u0430","KW":"\u041a\u0443\u0432\u0435\u0439\u0442","CW":"\u041a\u044e\u0440\u0430\u0441\u0430\u043e","LA":"\u041b\u0430\u043e\u0441","LV":"\u041b\u0430\u0442\u0432\u0456\u044f","LS":"\u041b\u0435\u0441\u043e\u0442\u043e","LT":"\u041b\u0438\u0442\u0432\u0430","LR":"\u041b\u0456\u0431\u0435\u0440\u0456\u044f","LB":"\u041b\u0456\u0432\u0430\u043d","LY":"\u041b\u0456\u0432\u0456\u044f","LI":"\u041b\u0456\u0445\u0442\u0435\u043d\u0448\u0442\u0435\u0439\u043d","LU":"\u041b\u044e\u043a\u0441\u0435\u043c\u0431\u0443\u0440\u0491","MR":"\u041c\u0430\u0432\u0440\u0438\u0442\u0430\u043d\u0456\u044f","MU":"\u041c\u0430\u0432\u0440\u0456\u043a\u0456\u0439","MG":"\u041c\u0430\u0434\u0430\u0433\u0430\u0441\u043a\u0430\u0440","YT":"\u041c\u0430\u0439\u043e\u0442\u0442\u0430","MO":"\u041c\u0430\u043a\u0430\u043e, \u041e.\u0410.\u0420 \u041a\u0438\u0442\u0430\u044e","MW":"\u041c\u0430\u043b\u0430\u0432\u0456","MY":"\u041c\u0430\u043b\u0430\u0439\u0437\u0456\u044f","ML":"\u041c\u0430\u043b\u0456","MV":"\u041c\u0430\u043b\u044c\u0434\u0456\u0432\u0438","MT":"\u041c\u0430\u043b\u044c\u0442\u0430","MA":"\u041c\u0430\u0440\u043e\u043a\u043a\u043e","MQ":"\u041c\u0430\u0440\u0442\u0456\u043d\u0456\u043a\u0430","MH":"\u041c\u0430\u0440\u0448\u0430\u043b\u043b\u043e\u0432\u0456 \u041e\u0441\u0442\u0440\u043e\u0432\u0438","MX":"\u041c\u0435\u043a\u0441\u0438\u043a\u0430","FM":"\u041c\u0456\u043a\u0440\u043e\u043d\u0435\u0437\u0456\u044f","MZ":"\u041c\u043e\u0437\u0430\u043c\u0431\u0456\u043a","MD":"\u041c\u043e\u043b\u0434\u043e\u0432\u0430","MC":"\u041c\u043e\u043d\u0430\u043a\u043e","MN":"\u041c\u043e\u043d\u0433\u043e\u043b\u0456\u044f","MS":"\u041c\u043e\u043d\u0442\u0441\u0435\u0440\u0440\u0430\u0442","MM":"\u041c\u02bc\u044f\u043d\u043c\u0430 (\u0411\u0456\u0440\u043c\u0430)","NA":"\u041d\u0430\u043c\u0456\u0431\u0456\u044f","NR":"\u041d\u0430\u0443\u0440\u0443","NP":"\u041d\u0435\u043f\u0430\u043b","NE":"\u041d\u0456\u0433\u0435\u0440","NG":"\u041d\u0456\u0433\u0435\u0440\u0456\u044f","NL":"\u041d\u0456\u0434\u0435\u0440\u043b\u0430\u043d\u0434\u0438","BQ":"\u041d\u0456\u0434\u0435\u0440\u043b\u0430\u043d\u0434\u0441\u044c\u043a\u0456 \u041a\u0430\u0440\u0438\u0431\u0441\u044c\u043a\u0456 \u043e\u0441\u0442\u0440\u043e\u0432\u0438","NI":"\u041d\u0456\u043a\u0430\u0440\u0430\u0491\u0443\u0430","DE":"\u041d\u0456\u043c\u0435\u0447\u0447\u0438\u043d\u0430","NU":"\u041d\u0456\u0443\u0435","NZ":"\u041d\u043e\u0432\u0430 \u0417\u0435\u043b\u0430\u043d\u0434\u0456\u044f","NC":"\u041d\u043e\u0432\u0430 \u041a\u0430\u043b\u0435\u0434\u043e\u043d\u0456\u044f","NO":"\u041d\u043e\u0440\u0432\u0435\u0491\u0456\u044f","AE":"\u041e\u0431\u02bc\u0454\u0434\u043d\u0430\u043d\u0456 \u0410\u0440\u0430\u0431\u0441\u044c\u043a\u0456 \u0415\u043c\u0456\u0440\u0430\u0442\u0438","OM":"\u041e\u043c\u0430\u043d","BV":"\u041e\u0441\u0442\u0440\u0456\u0432 \u0411\u0443\u0432\u0435","IM":"\u041e\u0441\u0442\u0440\u0456\u0432 \u041c\u0435\u043d","NF":"\u041e\u0441\u0442\u0440\u0456\u0432 \u041d\u043e\u0440\u0444\u043e\u043b\u043a","CX":"\u041e\u0441\u0442\u0440\u0456\u0432 \u0420\u0456\u0437\u0434\u0432\u0430","SH":"\u041e\u0441\u0442\u0440\u0456\u0432 \u0421\u0432\u044f\u0442\u043e\u0457 \u0404\u043b\u0435\u043d\u0438","HM":"\u041e\u0441\u0442\u0440\u043e\u0432\u0438 \u0413\u0435\u0440\u0434 \u0456 \u041c\u0430\u043a\u0434\u043e\u043d\u0430\u043b\u0434","CK":"\u041e\u0441\u0442\u0440\u043e\u0432\u0438 \u041a\u0443\u043a\u0430","PN":"\u041e\u0441\u0442\u0440\u043e\u0432\u0438 \u041f\u0456\u0442\u043a\u0435\u0440\u043d","TC":"\u041e\u0441\u0442\u0440\u043e\u0432\u0438 \u0422\u0435\u0440\u043a\u0441 \u0456 \u041a\u0430\u0439\u043a\u043e\u0441","PK":"\u041f\u0430\u043a\u0438\u0441\u0442\u0430\u043d","PW":"\u041f\u0430\u043b\u0430\u0443","PS":"\u041f\u0430\u043b\u0435\u0441\u0442\u0438\u043d\u0441\u044c\u043a\u0456 \u0442\u0435\u0440\u0438\u0442\u043e\u0440\u0456\u0457","PA":"\u041f\u0430\u043d\u0430\u043c\u0430","PG":"\u041f\u0430\u043f\u0443\u0430-\u041d\u043e\u0432\u0430 \u0490\u0432\u0456\u043d\u0435\u044f","PY":"\u041f\u0430\u0440\u0430\u0491\u0432\u0430\u0439","PE":"\u041f\u0435\u0440\u0443","GS":"\u041f\u0456\u0432\u0434\u0435\u043d\u043d\u0430 \u0414\u0436\u043e\u0440\u0434\u0436\u0456\u044f \u0442\u0430 \u041f\u0456\u0432\u0434\u0435\u043d\u043d\u0456 \u0421\u0430\u043d\u0434\u0432\u0456\u0447\u0435\u0432\u0456 \u041e\u0441\u0442\u0440\u043e\u0432\u0438","KR":"\u041f\u0456\u0432\u0434\u0435\u043d\u043d\u0430 \u041a\u043e\u0440\u0435\u044f","SS":"\u041f\u0456\u0432\u0434\u0435\u043d\u043d\u0438\u0439 \u0421\u0443\u0434\u0430\u043d","ZA":"\u041f\u0456\u0432\u0434\u0435\u043d\u043d\u043e-\u0410\u0444\u0440\u0438\u043a\u0430\u043d\u0441\u044c\u043a\u0430 \u0420\u0435\u0441\u043f\u0443\u0431\u043b\u0456\u043a\u0430","KP":"\u041f\u0456\u0432\u043d\u0456\u0447\u043d\u0430 \u041a\u043e\u0440\u0435\u044f","MK":"\u041f\u0456\u0432\u043d\u0456\u0447\u043d\u0430 \u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0456\u044f","MP":"\u041f\u0456\u0432\u043d\u0456\u0447\u043d\u0456 \u041c\u0430\u0440\u0456\u0430\u043d\u0441\u044c\u043a\u0456 \u041e\u0441\u0442\u0440\u043e\u0432\u0438","PL":"\u041f\u043e\u043b\u044c\u0449\u0430","PT":"\u041f\u043e\u0440\u0442\u0443\u0491\u0430\u043b\u0456\u044f","PR":"\u041f\u0443\u0435\u0440\u0442\u043e-\u0420\u0456\u043a\u043e","RE":"\u0420\u0435\u044e\u043d\u044c\u0439\u043e\u043d","RU":"\u0420\u043e\u0441\u0456\u044f","RW":"\u0420\u0443\u0430\u043d\u0434\u0430","RO":"\u0420\u0443\u043c\u0443\u043d\u0456\u044f","SV":"\u0421\u0430\u043b\u044c\u0432\u0430\u0434\u043e\u0440","WS":"\u0421\u0430\u043c\u043e\u0430","SM":"\u0421\u0430\u043d-\u041c\u0430\u0440\u0456\u043d\u043e","ST":"\u0421\u0430\u043d-\u0422\u043e\u043c\u0435 \u0456 \u041f\u0440\u0456\u043d\u0441\u0456\u043f\u0456","SA":"\u0421\u0430\u0443\u0434\u0456\u0432\u0441\u044c\u043a\u0430 \u0410\u0440\u0430\u0432\u0456\u044f","SC":"\u0421\u0435\u0439\u0448\u0435\u043b\u044c\u0441\u044c\u043a\u0456 \u041e\u0441\u0442\u0440\u043e\u0432\u0438","BL":"\u0421\u0435\u043d-\u0411\u0430\u0440\u0442\u0435\u043b\u044c\u043c\u0456","MF":"\u0421\u0435\u043d-\u041c\u0430\u0440\u0442\u0435\u043d","PM":"\u0421\u0435\u043d-\u041f\u02bc\u0454\u0440 \u0456 \u041c\u0456\u043a\u0435\u043b\u043e\u043d","SN":"\u0421\u0435\u043d\u0435\u0433\u0430\u043b","VC":"\u0421\u0435\u043d\u0442-\u0412\u0456\u043d\u0441\u0435\u043d\u0442 \u0456 \u0490\u0440\u0435\u043d\u0430\u0434\u0456\u043d\u0438","KN":"\u0421\u0435\u043d\u0442-\u041a\u0456\u0442\u0441 \u0456 \u041d\u0435\u0432\u0456\u0441","LC":"\u0421\u0435\u043d\u0442-\u041b\u044e\u0441\u0456\u044f","RS":"\u0421\u0435\u0440\u0431\u0456\u044f","SY":"\u0421\u0438\u0440\u0456\u044f","SG":"\u0421\u0456\u043d\u0433\u0430\u043f\u0443\u0440","SX":"\u0421\u0456\u043d\u0442-\u041c\u0430\u0440\u0442\u0435\u043d","SK":"\u0421\u043b\u043e\u0432\u0430\u0447\u0447\u0438\u043d\u0430","SI":"\u0421\u043b\u043e\u0432\u0435\u043d\u0456\u044f","SB":"\u0421\u043e\u043b\u043e\u043c\u043e\u043d\u043e\u0432\u0456 \u041e\u0441\u0442\u0440\u043e\u0432\u0438","SO":"\u0421\u043e\u043c\u0430\u043b\u0456","US":"\u0421\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0456 \u0428\u0442\u0430\u0442\u0438","SD":"\u0421\u0443\u0434\u0430\u043d","SR":"\u0421\u0443\u0440\u0456\u043d\u0430\u043c","SL":"\u0421\u044c\u0454\u0440\u0440\u0430-\u041b\u0435\u043e\u043d\u0435","TJ":"\u0422\u0430\u0434\u0436\u0438\u043a\u0438\u0441\u0442\u0430\u043d","TH":"\u0422\u0430\u0457\u043b\u0430\u043d\u0434","TW":"\u0422\u0430\u0439\u0432\u0430\u043d\u044c","TZ":"\u0422\u0430\u043d\u0437\u0430\u043d\u0456\u044f","TL":"\u0422\u0456\u043c\u043e\u0440-\u041b\u0435\u0448\u0442\u0456","TG":"\u0422\u043e\u0433\u043e","TK":"\u0422\u043e\u043a\u0435\u043b\u0430\u0443","TO":"\u0422\u043e\u043d\u0491\u0430","TT":"\u0422\u0440\u0456\u043d\u0456\u0434\u0430\u0434 \u0456 \u0422\u043e\u0431\u0430\u0491\u043e","TV":"\u0422\u0443\u0432\u0430\u043b\u0443","TN":"\u0422\u0443\u043d\u0456\u0441","TR":"\u0422\u0443\u0440\u0435\u0447\u0447\u0438\u043d\u0430","TM":"\u0422\u0443\u0440\u043a\u043c\u0435\u043d\u0456\u0441\u0442\u0430\u043d","UG":"\u0423\u0433\u0430\u043d\u0434\u0430","HU":"\u0423\u0433\u043e\u0440\u0449\u0438\u043d\u0430","UZ":"\u0423\u0437\u0431\u0435\u043a\u0438\u0441\u0442\u0430\u043d","UA":"\u0423\u043a\u0440\u0430\u0457\u043d\u0430","WF":"\u0423\u043e\u043b\u043b\u0456\u0441 \u0456 \u0424\u0443\u0442\u0443\u043d\u0430","UY":"\u0423\u0440\u0443\u0491\u0432\u0430\u0439","FO":"\u0424\u0430\u0440\u0435\u0440\u0441\u044c\u043a\u0456 \u041e\u0441\u0442\u0440\u043e\u0432\u0438","FJ":"\u0424\u0456\u0434\u0436\u0456","PH":"\u0424\u0456\u043b\u0456\u043f\u043f\u0456\u043d\u0438","FI":"\u0424\u0456\u043d\u043b\u044f\u043d\u0434\u0456\u044f","FK":"\u0424\u043e\u043b\u043a\u043b\u0435\u043d\u0434\u0441\u044c\u043a\u0456 \u041e\u0441\u0442\u0440\u043e\u0432\u0438","FR":"\u0424\u0440\u0430\u043d\u0446\u0456\u044f","GF":"\u0424\u0440\u0430\u043d\u0446\u0443\u0437\u044c\u043a\u0430 \u0490\u0432\u0456\u0430\u043d\u0430","PF":"\u0424\u0440\u0430\u043d\u0446\u0443\u0437\u044c\u043a\u0430 \u041f\u043e\u043b\u0456\u043d\u0435\u0437\u0456\u044f","TF":"\u0424\u0440\u0430\u043d\u0446\u0443\u0437\u044c\u043a\u0456 \u041f\u0456\u0432\u0434\u0435\u043d\u043d\u0456 \u0422\u0435\u0440\u0438\u0442\u043e\u0440\u0456\u0457","HR":"\u0425\u043e\u0440\u0432\u0430\u0442\u0456\u044f","CF":"\u0426\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u0430\u0444\u0440\u0438\u043a\u0430\u043d\u0441\u044c\u043a\u0430 \u0420\u0435\u0441\u043f\u0443\u0431\u043b\u0456\u043a\u0430","TD":"\u0427\u0430\u0434","CZ":"\u0427\u0435\u0445\u0456\u044f","CL":"\u0427\u0456\u043b\u0456","ME":"\u0427\u043e\u0440\u043d\u043e\u0433\u043e\u0440\u0456\u044f","CH":"\u0428\u0432\u0435\u0439\u0446\u0430\u0440\u0456\u044f","SE":"\u0428\u0432\u0435\u0446\u0456\u044f","SJ":"\u0428\u043f\u0456\u0446\u0431\u0435\u0440\u0433\u0435\u043d \u0442\u0430 \u042f\u043d-\u041c\u0430\u0454\u043d","LK":"\u0428\u0440\u0456-\u041b\u0430\u043d\u043a\u0430","JM":"\u042f\u043c\u0430\u0439\u043a\u0430","JP":"\u042f\u043f\u043e\u043d\u0456\u044f"} \ No newline at end of file diff --git a/scripts/download-country-names.js b/scripts/download-country-names.js new file mode 100644 index 00000000..4ee90cd4 --- /dev/null +++ b/scripts/download-country-names.js @@ -0,0 +1,39 @@ +const fs = require('fs'); +const path = require('path'); +const https = require('https'); +const chalk = require('chalk'); + +const src = path.resolve(__dirname, '../lang'); +const dest = path.resolve(__dirname, '../public/country'); +const files = fs.readdirSync(src); + +const getUrl = locale => + `https://raw.githubusercontent.com/umpirsky/country-list/master/data/${locale}/country.json`; + +const asyncForEach = async (array, callback) => { + for (let index = 0; index < array.length; index++) { + await callback(array[index], index, array); + } +}; + +if (!fs.existsSync(dest)) { + fs.mkdirSync(dest); +} + +const download = async files => { + await asyncForEach(files, async file => { + const locale = file.replace('-', '_').replace('.json', ''); + + const filename = path.join(dest, file); + if (!fs.existsSync(filename)) { + await new Promise(resolve => { + https.get(getUrl(locale), res => { + console.log('Downloaded', chalk.greenBright('->'), filename); + resolve(res.pipe(fs.createWriteStream(filename))); + }); + }); + } + }); +}; + +download(files);