diff --git a/build/data/countries.py b/build/data/countries.py new file mode 100644 index 00000000..68b3bb28 --- /dev/null +++ b/build/data/countries.py @@ -0,0 +1,250 @@ +import json + +countries = [ + {"name": "AFGHANISTAN", "code": "AF"}, + {"name": "ALBANIA", "code": "AL"}, + {"name": "ALGERIA", "code": "DZ"}, + {"name": "AMERICAN SAMOA", "code": "AS"}, + {"name": "ANDORRA", "code": "AD"}, + {"name": "ANGOLA", "code": "AO"}, + {"name": "ANTARCTICA", "code": "AQ"}, + {"name": "ANTIGUA AND BARBUDA", "code": "AG"}, + {"name": "ARGENTINA", "code": "AR"}, + {"name": "ARMENIA", "code": "AM"}, + {"name": "ARUBA", "code": "AW"}, + {"name": "AUSTRALIA", "code": "AU"}, + {"name": "AUSTRIA", "code": "AT"}, + {"name": "AZERBAIJAN", "code": "AZ"}, + {"name": "BAHAMAS", "code": "BS"}, + {"name": "BAHRAIN", "code": "BH"}, + {"name": "BANGLADESH", "code": "BD"}, + {"name": "BARBADOS", "code": "BB"}, + {"name": "BELARUS", "code": "BY"}, + {"name": "BELGIUM", "code": "BE"}, + {"name": "BELIZE", "code": "BZ"}, + {"name": "BENIN", "code": "BJ"}, + {"name": "BERMUDA", "code": "BM"}, + {"name": "BHUTAN", "code": "BT"}, + {"name": "BOLIVIA", "code": "BO"}, + {"name": "BOSNIA AND HERZEGOVINA", "code": "BA"}, + {"name": "BOTSWANA", "code": "BW"}, + {"name": "BOUVET ISLAND", "code": "BV"}, + {"name": "BRAZIL", "code": "BR"}, + {"name": "BRITISH INDIAN OCEAN TERRITORY", "code": "IO"}, + {"name": "BRUNEI DARUSSALAM", "code": "BN"}, + {"name": "BULGARIA", "code": "BG"}, + {"name": "BURKINA FASO", "code": "BF"}, + {"name": "BURUNDI", "code": "BI"}, + {"name": "CAMBODIA", "code": "KH"}, + {"name": "CAMEROON", "code": "CM"}, + {"name": "CANADA", "code": "CA"}, + {"name": "CAPE VERDE", "code": "CV"}, + {"name": "CAYMAN ISLANDS", "code": "KY"}, + {"name": "CENTRAL AFRICAN REPUBLIC", "code": "CF"}, + {"name": "CHAD", "code": "TD"}, + {"name": "CHILE", "code": "CL"}, + {"name": "CHINA", "code": "CN"}, + {"name": "CHRISTMAS ISLAND", "code": "CX"}, + {"name": "COCOS (KEELING) ISLANDS", "code": "CC"}, + {"name": "COLOMBIA", "code": "CO"}, + {"name": "COMOROS", "code": "KM"}, + {"name": "CONGO", "code": "CG"}, + {"name": "CONGO, THE DEMOCRATIC REPUBLIC OF THE", "code": "CD"}, + {"name": "COOK ISLANDS", "code": "CK"}, + {"name": "COSTA RICA", "code": "CR"}, + {"name": "CÔTE D'IVOIRE", "code": "CI"}, + {"name": "CROATIA", "code": "HR"}, + {"name": "CUBA", "code": "CU"}, + {"name": "CYPRUS", "code": "CY"}, + {"name": "CZECH REPUBLIC", "code": "CZ"}, + {"name": "DENMARK", "code": "DK"}, + {"name": "DJIBOUTI", "code": "DJ"}, + {"name": "DOMINICA", "code": "DM"}, + {"name": "DOMINICAN REPUBLIC", "code": "DO"}, + {"name": "ECUADOR", "code": "EC"}, + {"name": "EGYPT", "code": "EG"}, + {"name": "EL SALVADOR", "code": "SV"}, + {"name": "EQUATORIAL GUINEA", "code": "GQ"}, + {"name": "ERITREA", "code": "ER"}, + {"name": "ESTONIA", "code": "EE"}, + {"name": "ETHIOPIA", "code": "ET"}, + {"name": "FALKLAND ISLANDS (MALVINAS)", "code": "FK"}, + {"name": "FAROE ISLANDS", "code": "FO"}, + {"name": "FIJI", "code": "FJ"}, + {"name": "FINLAND", "code": "FI"}, + {"name": "FRANCE", "code": "FR"}, + {"name": "FRENCH GUIANA", "code": "GF"}, + {"name": "FRENCH POLYNESIA", "code": "PF"}, + {"name": "FRENCH SOUTHERN TERRITORIES", "code": "TF"}, + {"name": "GABON", "code": "GA"}, + {"name": "GAMBIA", "code": "GM"}, + {"name": "GEORGIA", "code": "GE"}, + {"name": "GERMANY", "code": "DE"}, + {"name": "GHANA", "code": "GH"}, + {"name": "GIBRALTAR", "code": "GI"}, + {"name": "GREECE", "code": "GR"}, + {"name": "GREENLAND", "code": "GL"}, + {"name": "GRENADA", "code": "GD"}, + {"name": "GUADELOUPE", "code": "GP"}, + {"name": "GUAM", "code": "GU"}, + {"name": "GUATEMALA", "code": "GT"}, + {"name": "GUINEA", "code": "GN"}, + {"name": "GUINEA-BISSAU", "code": "GW"}, + {"name": "GUYANA", "code": "GY"}, + {"name": "HAITI", "code": "HT"}, + {"name": "HEARD ISLAND AND MCDONALD ISLANDS", "code": "HM"}, + {"name": "HONDURAS", "code": "HN"}, + {"name": "HONG KONG", "code": "HK"}, + {"name": "HUNGARY", "code": "HU"}, + {"name": "ICELAND", "code": "IS"}, + {"name": "INDIA", "code": "IN"}, + {"name": "INDONESIA", "code": "ID"}, + {"name": "IRAN, ISLAMIC REPUBLIC OF", "code": "IR"}, + {"name": "IRAQ", "code": "IQ"}, + {"name": "IRELAND", "code": "IE"}, + {"name": "ISRAEL", "code": "IL"}, + {"name": "ITALY", "code": "IT"}, + {"name": "JAMAICA", "code": "JM"}, + {"name": "JAPAN", "code": "JP"}, + {"name": "JORDAN", "code": "JO"}, + {"name": "KAZAKHSTAN", "code": "KZ"}, + {"name": "KENYA", "code": "KE"}, + {"name": "KIRIBATI", "code": "KI"}, + {"name": "KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF", "code": "KP"}, + {"name": "KOREA, REPUBLIC OF", "code": "KR"}, + {"name": "KUWAIT", "code": "KW"}, + {"name": "KYRGYZSTAN", "code": "KG"}, + {"name": "LAO PEOPLE'S DEMOCRATIC REPUBLIC (LAOS)", "code": "LA"}, + {"name": "LATVIA", "code": "LV"}, + {"name": "LEBANON", "code": "LB"}, + {"name": "LESOTHO", "code": "LS"}, + {"name": "LIBERIA", "code": "LR"}, + {"name": "LIBYA, STATE OF", "code": "LY"}, + {"name": "LIECHTENSTEIN", "code": "LI"}, + {"name": "LITHUANIA", "code": "LT"}, + {"name": "LUXEMBOURG", "code": "LU"}, + {"name": "MACAO", "code": "MO"}, + {"name": "MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF", "code": "MK"}, + {"name": "MADAGASCAR", "code": "MG"}, + {"name": "MALAWI", "code": "MW"}, + {"name": "MALAYSIA", "code": "MY"}, + {"name": "MALDIVES", "code": "MV"}, + {"name": "MALI", "code": "ML"}, + {"name": "MALTA", "code": "MT"}, + {"name": "MARSHALL ISLANDS", "code": "MH"}, + {"name": "MARTINIQUE", "code": "MQ"}, + {"name": "MAURITANIA", "code": "MR"}, + {"name": "MAURITIUS", "code": "MU"}, + {"name": "MAYOTTE", "code": "YT"}, + {"name": "MEXICO", "code": "MX"}, + {"name": "MICRONESIA, FEDERATED STATES OF", "code": "FM"}, + {"name": "MOLDOVA, REPUBLIC OF", "code": "MD"}, + {"name": "MONACO", "code": "MC"}, + {"name": "MONGOLIA", "code": "MN"}, + {"name": "MONTENEGRO", "code": "ME"}, + {"name": "MONTSERRAT", "code": "MS"}, + {"name": "MOROCCO", "code": "MA"}, + {"name": "MOZAMBIQUE", "code": "MZ"}, + {"name": "MYANMAR", "code": "MM"}, + {"name": "NAMIBIA", "code": "NA"}, + {"name": "NAURU", "code": "NR"}, + {"name": "NEPAL, FEDERAL DEMOCRATIC REPUBLIC OF", "code": "NP"}, + {"name": "NETHERLANDS", "code": "NL"}, + {"name": "NETHERLANDS ANTILLES", "code": "AN"}, + {"name": "NEW CALEDONIA", "code": "NC"}, + {"name": "NEW ZEALAND", "code": "NZ"}, + {"name": "NICARAGUA", "code": "NI"}, + {"name": "NIGER", "code": "NE"}, + {"name": "NIGERIA", "code": "NG"}, + {"name": "NIUE", "code": "NU"}, + {"name": "NORFOLK ISLAND", "code": "NF"}, + {"name": "NORTHERN MARIANA ISLANDS", "code": "MP"}, + {"name": "NORWAY", "code": "NO"}, + {"name": "OMAN", "code": "OM"}, + {"name": "PAKISTAN", "code": "PK"}, + {"name": "PALAU", "code": "PW"}, + {"name": "PALESTINE, STATE OF", "code": "PS"}, + {"name": "PANAMA", "code": "PA"}, + {"name": "PAPUA NEW GUINEA", "code": "PG"}, + {"name": "PARAGUAY", "code": "PY"}, + {"name": "PERU", "code": "PE"}, + {"name": "PHILIPPINES", "code": "PH"}, + {"name": "PITCAIRN", "code": "PN"}, + {"name": "POLAND", "code": "PL"}, + {"name": "PORTUGAL", "code": "PT"}, + {"name": "PUERTO RICO", "code": "PR"}, + {"name": "QATAR", "code": "QA"}, + {"name": "RÉUNION", "code": "RE"}, + {"name": "ROMANIA", "code": "RO"}, + {"name": "RUSSIAN FEDERATION", "code": "RU"}, + {"name": "RWANDA", "code": "RW"}, + {"name": "SAINT HELENA", "code": "SH"}, + {"name": "SAINT KITTS AND NEVIS", "code": "KN"}, + {"name": "SAINT LUCIA", "code": "LC"}, + {"name": "SAINT PIERRE AND MIQUELON", "code": "PM"}, + {"name": "SAINT VINCENT AND THE GRENADINES", "code": "VC"}, + {"name": "SAMOA", "code": "WS"}, + {"name": "SAN MARINO", "code": "SM"}, + {"name": "SAO TOME AND PRINCIPE", "code": "ST"}, + {"name": "SAUDI ARABIA", "code": "SA"}, + {"name": "SENEGAL", "code": "SN"}, + {"name": "SERBIA", "code": "RS"}, + {"name": "SEYCHELLES", "code": "SC"}, + {"name": "SIERRA LEONE", "code": "SL"}, + {"name": "SINGAPORE", "code": "SG"}, + {"name": "SLOVAKIA", "code": "SK"}, + {"name": "SLOVENIA", "code": "SI"}, + {"name": "SOLOMON ISLANDS", "code": "SB"}, + {"name": "SOMALIA", "code": "SO"}, + {"name": "SOUTH AFRICA", "code": "ZA"}, + {"name": "SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS", "code": "GS"}, + {"name": "SOUTH SUDAN", "code": "SS"}, + {"name": "SPAIN", "code": "ES"}, + {"name": "SRI LANKA", "code": "LK"}, + {"name": "SUDAN", "code": "SD"}, + {"name": "SURINAME", "code": "SR"}, + {"name": "SVALBARD AND JAN MAYEN", "code": "SJ"}, + {"name": "SWAZILAND", "code": "SZ"}, + {"name": "SWEDEN", "code": "SE"}, + {"name": "SWITZERLAND", "code": "CH"}, + {"name": "SYRIAN ARAB REPUBLIC", "code": "SY"}, + {"name": "TAIWAN", "code": "TW"}, + {"name": "TAJIKISTAN", "code": "TJ"}, + {"name": "TANZANIA, UNITED REPUBLIC OF", "code": "TZ"}, + {"name": "THAILAND", "code": "TH"}, + {"name": "TIMOR-LESTE", "code": "TL"}, + {"name": "TOGO", "code": "TG"}, + {"name": "TOKELAU", "code": "TK"}, + {"name": "TONGA", "code": "TO"}, + {"name": "TRINIDAD AND TOBAGO", "code": "TT"}, + {"name": "TUNISIA", "code": "TN"}, + {"name": "TURKEY", "code": "TR"}, + {"name": "TURKMENISTAN", "code": "TM"}, + {"name": "TURKS AND CAICOS ISLANDS", "code": "TC"}, + {"name": "TUVALU", "code": "TV"}, + {"name": "UGANDA", "code": "UG"}, + {"name": "UKRAINE", "code": "UA"}, + {"name": "UNITED ARAB EMIRATES", "code": "AE"}, + {"name": "UNITED KINGDOM", "code": "GB"}, + {"name": "UNITED STATES", "code": "US"}, + {"name": "UNITED STATES MINOR OUTLYING ISLANDS", "code": "UM"}, + {"name": "URUGUAY", "code": "UY"}, + {"name": "UZBEKISTAN", "code": "UZ"}, + {"name": "VANUATU", "code": "VU"}, + {"name": "VENEZUELA", "code": "VE"}, + {"name": "VIET NAM", "code": "VN"}, + {"name": "VIRGIN ISLANDS, BRITISH", "code": "VG"}, + {"name": "VIRGIN ISLANDS, U.S.", "code": "VI"}, + {"name": "WALLIS AND FUTUNA", "code": "WF"}, + {"name": "WESTERN SAHARA", "code": "EH"}, + {"name": "YEMEN", "code": "YE"}, + {"name": "ZAMBIA", "code": "ZM"}, + {"name": "ZIMBABWE", "code": "ZW"} +] + +for country in countries: + country["name"] = country["name"].lower().strip() + country["code"] = country["code"].lower().strip() + +if __name__ == "__main__": + print(json.dumps(countries, indent=4, ensure_ascii=False)) diff --git a/build/data/languages.py b/build/data/languages.py new file mode 100644 index 00000000..61ad6974 --- /dev/null +++ b/build/data/languages.py @@ -0,0 +1,209 @@ +import json + +languages = [ + {"name": "Abkhazian", "code": ["ab"]}, + {"name": "Afar", "code": ["aa"]}, + {"name": "Afrikaans", "code": ["af"]}, + {"name": "Akan", "code": ["ak"]}, + {"name": "Albanian", "code": ["sq"]}, + {"name": "Amharic", "code": ["am"]}, + {"name": "Arabic", "code": ["ar"]}, + {"name": "Aragonese", "code": ["an"]}, + {"name": "Armenian", "code": ["hy"]}, + {"name": "Assamese", "code": ["as"]}, + {"name": "Avaric", "code": ["av"]}, + {"name": "Avestan", "code": ["ae"]}, + {"name": "Aymara", "code": ["ay"]}, + {"name": "Azerbaijani", "code": ["az"]}, + {"name": "Bambara", "code": ["bm"]}, + {"name": "Bashkir", "code": ["ba"]}, + {"name": "Basque", "code": ["eu"]}, + {"name": "Belarusian", "code": ["be"]}, + {"name": "Bengali", "code": ["bn"]}, + {"name": "Bangla", "code": ["bn"]}, + {"name": "Bihari", "code": ["bh"]}, + {"name": "Bislama", "code": ["bi"]}, + {"name": "Bosnian", "code": ["bs"]}, + {"name": "Breton", "code": ["br"]}, + {"name": "Bulgarian", "code": ["bg"]}, + {"name": "Burmese", "code": ["my"]}, + {"name": "Catalan", "code": ["ca"]}, + {"name": "Chamorro", "code": ["ch"]}, + {"name": "Chechen", "code": ["ce"]}, + {"name": "Chichewa, Chewa, Nyanja", "code": ["ny"]}, + {"name": "Chinese", "code": ["zh"]}, + {"name": "Chinese (Simplified)", "code": ["zh-Hans"]}, + {"name": "Chinese (Traditional)", "code": ["zh-Hant"]}, + {"name": "Chuvash", "code": ["cv"]}, + {"name": "Cornish", "code": ["kw"]}, + {"name": "Corsican", "code": ["co"]}, + {"name": "Cree", "code": ["cr"]}, + {"name": "Croatian", "code": ["hr"]}, + {"name": "Czech", "code": ["cs"]}, + {"name": "Danish", "code": ["da"]}, + {"name": "Divehi, Dhivehi, Maldivian", "code": ["dv"]}, + {"name": "Dutch", "code": ["nl"]}, + {"name": "Dzongkha", "code": ["dz"]}, + {"name": "English", "code": ["en"]}, + {"name": "Esperanto", "code": ["eo"]}, + {"name": "Estonian", "code": ["et"]}, + {"name": "Ewe", "code": ["ee"]}, + {"name": "Faroese", "code": ["fo"]}, + {"name": "Fijian", "code": ["fj"]}, + {"name": "Finnish", "code": ["fi"]}, + {"name": "French", "code": ["fr"]}, + {"name": "Fula, Fulah, Pulaar, Pular", "code": ["ff"]}, + {"name": "Galician", "code": ["gl"]}, + {"name": "Gaelic (Scottish)", "code": ["gd"]}, + {"name": "Gaelic (Manx)", "code": ["gv"]}, + {"name": "Georgian", "code": ["ka"]}, + {"name": "German", "code": ["de"]}, + {"name": "Greek", "code": ["el"]}, + {"name": "Greenlandic", "code": ["kl"]}, + {"name": "Guarani", "code": ["gn"]}, + {"name": "Gujarati", "code": ["gu"]}, + {"name": "Haitian Creole", "code": ["ht"]}, + {"name": "Hausa", "code": ["ha"]}, + {"name": "Hebrew", "code": ["he"]}, + {"name": "Herero", "code": ["hz"]}, + {"name": "Hindi", "code": ["hi"]}, + {"name": "Hiri Motu", "code": ["ho"]}, + {"name": "Hungarian", "code": ["hu"]}, + {"name": "Icelandic", "code": ["is"]}, + {"name": "Ido", "code": ["io"]}, + {"name": "Igbo", "code": ["ig"]}, + {"name": "Indonesian", "code": ["id, in"]}, + {"name": "Interlingua", "code": ["ia"]}, + {"name": "Interlingue", "code": ["ie"]}, + {"name": "Inuktitut", "code": ["iu"]}, + {"name": "Inupiak", "code": ["ik"]}, + {"name": "Irish", "code": ["ga"]}, + {"name": "Italian", "code": ["it"]}, + {"name": "Japanese", "code": ["ja"]}, + {"name": "Javanese", "code": ["jv"]}, + {"name": "Kalaallisut, Greenlandic", "code": ["kl"]}, + {"name": "Kannada", "code": ["kn"]}, + {"name": "Kanuri", "code": ["kr"]}, + {"name": "Kashmiri", "code": ["ks"]}, + {"name": "Kazakh", "code": ["kk"]}, + {"name": "Khmer", "code": ["km"]}, + {"name": "Kikuyu", "code": ["ki"]}, + {"name": "Kinyarwanda (Rwanda)", "code": ["rw"]}, + {"name": "Kirundi", "code": ["rn"]}, + {"name": "Kyrgyz", "code": ["ky"]}, + {"name": "Komi", "code": ["kv"]}, + {"name": "Kongo", "code": ["kg"]}, + {"name": "Korean", "code": ["ko"]}, + {"name": "Kurdish", "code": ["ku"]}, + {"name": "Kwanyama", "code": ["kj"]}, + {"name": "Lao", "code": ["lo"]}, + {"name": "Latin", "code": ["la"]}, + {"name": "Latvian (Lettish)", "code": ["lv"]}, + {"name": "Limburgish ( Limburger)", "code": ["li"]}, + {"name": "Lingala", "code": ["ln"]}, + {"name": "Lithuanian", "code": ["lt"]}, + {"name": "Luga-Katanga", "code": ["lu"]}, + {"name": "Luganda, Ganda", "code": ["lg"]}, + {"name": "Luxembourgish", "code": ["lb"]}, + {"name": "Manx", "code": ["gv"]}, + {"name": "Macedonian", "code": ["mk"]}, + {"name": "Malagasy", "code": ["mg"]}, + {"name": "Malay", "code": ["ms"]}, + {"name": "Malayalam", "code": ["ml"]}, + {"name": "Maltese", "code": ["mt"]}, + {"name": "Maori", "code": ["mi"]}, + {"name": "Marathi", "code": ["mr"]}, + {"name": "Marshallese", "code": ["mh"]}, + {"name": "Moldavian", "code": ["mo"]}, + {"name": "Mongolian", "code": ["mn"]}, + {"name": "Nauru", "code": ["na"]}, + {"name": "Navajo", "code": ["nv"]}, + {"name": "Ndonga", "code": ["ng"]}, + {"name": "Northern Ndebele", "code": ["nd"]}, + {"name": "Nepali", "code": ["ne"]}, + {"name": "Norwegian", "code": ["no"]}, + {"name": "Norwegian bokmål", "code": ["nb"]}, + {"name": "Norwegian nynorsk", "code": ["nn"]}, + {"name": "Nuosu", "code": ["ii"]}, + {"name": "Occitan", "code": ["oc"]}, + {"name": "Ojibwe", "code": ["oj"]}, + {"name": "Old Church Slavonic, Old Bulgarian", "code": ["cu"]}, + {"name": "Oriya", "code": ["or"]}, + {"name": "Oromo (Afaan Oromo)", "code": ["om"]}, + {"name": "Ossetian", "code": ["os"]}, + {"name": "Pāli", "code": ["pi"]}, + {"name": "Pashto, Pushto", "code": ["ps"]}, + {"name": "Persian (Farsi)", "code": ["fa"]}, + {"name": "Polish", "code": ["pl"]}, + {"name": "Portuguese", "code": ["pt"]}, + {"name": "Punjabi (Eastern)", "code": ["pa"]}, + {"name": "Quechua", "code": ["qu"]}, + {"name": "Romansh", "code": ["rm"]}, + {"name": "Romanian", "code": ["ro"]}, + {"name": "Russian", "code": ["ru"]}, + {"name": "Sami", "code": ["se"]}, + {"name": "Samoan", "code": ["sm"]}, + {"name": "Sango", "code": ["sg"]}, + {"name": "Sanskrit", "code": ["sa"]}, + {"name": "Serbian", "code": ["sr"]}, + {"name": "Serbo-Croatian", "code": ["sh"]}, + {"name": "Sesotho", "code": ["st"]}, + {"name": "Setswana", "code": ["tn"]}, + {"name": "Shona", "code": ["sn"]}, + {"name": "Sichuan Yi", "code": ["ii"]}, + {"name": "Sindhi", "code": ["sd"]}, + {"name": "Sinhalese", "code": ["si"]}, + {"name": "Siswati", "code": ["ss"]}, + {"name": "Slovak", "code": ["sk"]}, + {"name": "Slovenian", "code": ["sl"]}, + {"name": "Somali", "code": ["so"]}, + {"name": "Southern Ndebele", "code": ["nr"]}, + {"name": "Spanish", "code": ["es"]}, + {"name": "Sundanese", "code": ["su"]}, + {"name": "Swahili (Kiswahili)", "code": ["sw"]}, + {"name": "Swati", "code": ["ss"]}, + {"name": "Swedish", "code": ["sv"]}, + {"name": "Tagalog", "code": ["tl"]}, + {"name": "Tahitian", "code": ["ty"]}, + {"name": "Tajik", "code": ["tg"]}, + {"name": "Tamil", "code": ["ta"]}, + {"name": "Tatar", "code": ["tt"]}, + {"name": "Telugu", "code": ["te"]}, + {"name": "Thai", "code": ["th"]}, + {"name": "Tibetan", "code": ["bo"]}, + {"name": "Tigrinya", "code": ["ti"]}, + {"name": "Tonga", "code": ["to"]}, + {"name": "Tsonga", "code": ["ts"]}, + {"name": "Turkish", "code": ["tr"]}, + {"name": "Turkmen", "code": ["tk"]}, + {"name": "Twi", "code": ["tw"]}, + {"name": "Uyghur", "code": ["ug"]}, + {"name": "Ukrainian", "code": ["uk"]}, + {"name": "Urdu", "code": ["ur"]}, + {"name": "Uzbek", "code": ["uz"]}, + {"name": "Venda", "code": ["ve"]}, + {"name": "Vietnamese", "code": ["vi"]}, + {"name": "Volapük", "code": ["vo"]}, + {"name": "Wallon", "code": ["wa"]}, + {"name": "Welsh", "code": ["cy"]}, + {"name": "Wolof", "code": ["wo"]}, + {"name": "Western Frisian", "code": ["fy"]}, + {"name": "Xhosa", "code": ["xh"]}, + {"name": "Yiddish", "code": ["yi, ji"]}, + {"name": "Yoruba", "code": ["yo"]}, + {"name": "Zhuang", "code": ["za"]}, + {"name": "Chuang", "code": ["za"]}, + {"name": "Zulu", "code": ["zu"]} +] + +for language in languages: + language["name"] = language["name"].lower().strip() + + if isinstance(language["code"], str): + language["code"] = language["code"].lower().strip().split(", ") + else: + for i in range(len(language["code"])): + language["code"][i] = language["code"][i].lower().strip() + +if __name__ == "__main__": + print(json.dumps(languages, indent=4, ensure_ascii=False)) diff --git a/build/mediatypes.py b/build/data/mediatypes.py similarity index 99% rename from build/mediatypes.py rename to build/data/mediatypes.py index 73cf6c88..a486691f 100644 --- a/build/mediatypes.py +++ b/build/data/mediatypes.py @@ -1,6 +1,6 @@ import json -types = [ +mediatypes = [ {"name": "3gpdash-qoe-report+xml", "code": "application/3gpdash-qoe-report+xml"}, {"name": "3gppHalForms+json", "code": "application/3gppHalForms+json"}, {"name": "A2L", "code": "application/A2L"}, @@ -1092,9 +1092,9 @@ {"name": "VP8", "code": "video/VP8"} ] -for type in types: - type["name"] = type["name"].lower() - type["code"] = type["code"].lower() +for mediatype in mediatypes: + mediatype["name"] = mediatype["name"].lower().strip() + mediatype["code"] = mediatype["code"].lower().strip() if __name__ == "__main__": - print(json.dumps(types, indent=4, ensure_ascii=False)) + print(json.dumps(mediatypes, indent=4, ensure_ascii=False))