Files
2026-01-26 00:37:35 +01:00

269 lines
8.3 KiB
Swift
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// Countries.swift
// ExodaiAcademy
//
// Created by Exodai on 22/01/2026.
//
import Foundation
import Vapor
enum CountryCode: String, Codable, CaseIterable {
case af = "AF" // Afghanistan
case ax = "AX" // Åland Islands
case al = "AL" // Albania
case dz = "DZ" // Algeria
case aS = "AS" // American Samoa
case ad = "AD" // Andorra
case ao = "AO" // Angola
case ai = "AI" // Anguilla
case aq = "AQ" // Antarctica
case ag = "AG" // Antigua and Barbuda
case ar = "AR" // Argentina
case am = "AM" // Armenia
case aw = "AW" // Aruba
case au = "AU" // Australia
case at = "AT" // Austria
case az = "AZ" // Azerbaijan
case bs = "BS" // Bahamas
case bh = "BH" // Bahrain
case bd = "BD" // Bangladesh
case bb = "BB" // Barbados
case by = "BY" // Belarus
case be = "BE" // Belgium
case bz = "BZ" // Belize
case bj = "BJ" // Benin
case bm = "BM" // Bermuda
case bt = "BT" // Bhutan
case bo = "BO" // Bolivia
case bq = "BQ" // Bonaire, Sint Eustatius and Saba
case ba = "BA" // Bosnia and Herzegovina
case bw = "BW" // Botswana
case bv = "BV" // Bouvet Island
case br = "BR" // Brazil
case io = "IO" // British Indian Ocean Territory
case bn = "BN" // Brunei
case bg = "BG" // Bulgaria
case bf = "BF" // Burkina Faso
case bi = "BI" // Burundi
case kh = "KH" // Cambodia
case cm = "CM" // Cameroon
case ca = "CA" // Canada
case cv = "CV" // Cape Verde
case ky = "KY" // Cayman Islands
case cf = "CF" // Central African Republic
case td = "TD" // Chad
case cl = "CL" // Chile
case cn = "CN" // China
case cx = "CX" // Christmas Island
case cc = "CC" // Cocos (Keeling) Islands
case co = "CO" // Colombia
case km = "KM" // Comoros
case cg = "CG" // Congo
case cd = "CD" // Congo (DRC)
case ck = "CK" // Cook Islands
case cr = "CR" // Costa Rica
case ci = "CI" // Côte dIvoire
case hr = "HR" // Croatia
case cu = "CU" // Cuba
case cw = "CW" // Curaçao
case cy = "CY" // Cyprus
case cz = "CZ" // Czech Republic
case dk = "DK" // Denmark
case dj = "DJ" // Djibouti
case dm = "DM" // Dominica
case dO = "DO" // Dominican Republic
case ec = "EC" // Ecuador
case eg = "EG" // Egypt
case sv = "SV" // El Salvador
case gq = "GQ" // Equatorial Guinea
case er = "ER" // Eritrea
case ee = "EE" // Estonia
case sz = "SZ" // Eswatini
case et = "ET" // Ethiopia
case fk = "FK" // Falkland Islands
case fo = "FO" // Faroe Islands
case fj = "FJ" // Fiji
case fi = "FI" // Finland
case fr = "FR" // France
case gf = "GF" // French Guiana
case pf = "PF" // French Polynesia
case tf = "TF" // French Southern Territories
case ga = "GA" // Gabon
case gm = "GM" // Gambia
case ge = "GE" // Georgia
case de = "DE" // Germany
case gh = "GH" // Ghana
case gi = "GI" // Gibraltar
case gr = "GR" // Greece
case gl = "GL" // Greenland
case gd = "GD" // Grenada
case gp = "GP" // Guadeloupe
case gu = "GU" // Guam
case gt = "GT" // Guatemala
case gg = "GG" // Guernsey
case gn = "GN" // Guinea
case gw = "GW" // Guinea-Bissau
case gy = "GY" // Guyana
case ht = "HT" // Haiti
case hm = "HM" // Heard Island and McDonald Islands
case va = "VA" // Vatican City
case hn = "HN" // Honduras
case hk = "HK" // Hong Kong
case hu = "HU" // Hungary
case iS = "IS" // Iceland
case iN = "IN" // India
case id = "ID" // Indonesia
case ir = "IR" // Iran
case iq = "IQ" // Iraq
case ie = "IE" // Ireland
case im = "IM" // Isle of Man
case il = "IL" // Israel
case it = "IT" // Italy
case jm = "JM" // Jamaica
case jp = "JP" // Japan
case je = "JE" // Jersey
case jo = "JO" // Jordan
case kz = "KZ" // Kazakhstan
case ke = "KE" // Kenya
case ki = "KI" // Kiribati
case kp = "KP" // North Korea
case kr = "KR" // South Korea
case kw = "KW" // Kuwait
case kg = "KG" // Kyrgyzstan
case la = "LA" // Laos
case lv = "LV" // Latvia
case lb = "LB" // Lebanon
case ls = "LS" // Lesotho
case lr = "LR" // Liberia
case ly = "LY" // Libya
case li = "LI" // Liechtenstein
case lt = "LT" // Lithuania
case lu = "LU" // Luxembourg
case mo = "MO" // Macao
case mg = "MG" // Madagascar
case mw = "MW" // Malawi
case my = "MY" // Malaysia
case mv = "MV" // Maldives
case ml = "ML" // Mali
case mt = "MT" // Malta
case mh = "MH" // Marshall Islands
case mq = "MQ" // Martinique
case mr = "MR" // Mauritania
case mu = "MU" // Mauritius
case yt = "YT" // Mayotte
case mx = "MX" // Mexico
case fm = "FM" // Micronesia
case md = "MD" // Moldova
case mc = "MC" // Monaco
case mn = "MN" // Mongolia
case me = "ME" // Montenegro
case ms = "MS" // Montserrat
case ma = "MA" // Morocco
case mz = "MZ" // Mozambique
case mm = "MM" // Myanmar
case na = "NA" // Namibia
case nr = "NR" // Nauru
case np = "NP" // Nepal
case nl = "NL" // Netherlands
case nc = "NC" // New Caledonia
case nz = "NZ" // New Zealand
case ni = "NI" // Nicaragua
case ne = "NE" // Niger
case ng = "NG" // Nigeria
case nu = "NU" // Niue
case nf = "NF" // Norfolk Island
case mk = "MK" // North Macedonia
case mp = "MP" // Northern Mariana Islands
case no = "NO" // Norway
case om = "OM" // Oman
case pk = "PK" // Pakistan
case pw = "PW" // Palau
case ps = "PS" // Palestine
case pa = "PA" // Panama
case pg = "PG" // Papua New Guinea
case py = "PY" // Paraguay
case pe = "PE" // Peru
case ph = "PH" // Philippines
case pn = "PN" // Pitcairn
case pl = "PL" // Poland
case pt = "PT" // Portugal
case pr = "PR" // Puerto Rico
case qa = "QA" // Qatar
case re = "RE" // Réunion
case ro = "RO" // Romania
case ru = "RU" // Russia
case rw = "RW" // Rwanda
case bl = "BL" // Saint Barthélemy
case sh = "SH" // Saint Helena
case kn = "KN" // Saint Kitts and Nevis
case lc = "LC" // Saint Lucia
case mf = "MF" // Saint Martin
case pm = "PM" // Saint Pierre and Miquelon
case vc = "VC" // Saint Vincent and the Grenadines
case ws = "WS" // Samoa
case sm = "SM" // San Marino
case st = "ST" // São Tomé and Príncipe
case sa = "SA" // Saudi Arabia
case sn = "SN" // Senegal
case rs = "RS" // Serbia
case sc = "SC" // Seychelles
case sl = "SL" // Sierra Leone
case sg = "SG" // Singapore
case sx = "SX" // Sint Maarten
case sk = "SK" // Slovakia
case si = "SI" // Slovenia
case sb = "SB" // Solomon Islands
case so = "SO" // Somalia
case za = "ZA" // South Africa
case gs = "GS" // South Georgia
case ss = "SS" // South Sudan
case es = "ES" // Spain
case lk = "LK" // Sri Lanka
case sd = "SD" // Sudan
case sr = "SR" // Suriname
case sj = "SJ" // Svalbard and Jan Mayen
case se = "SE" // Sweden
case ch = "CH" // Switzerland
case sy = "SY" // Syria
case tw = "TW" // Taiwan
case tj = "TJ" // Tajikistan
case tz = "TZ" // Tanzania
case th = "TH" // Thailand
case tl = "TL" // Timor-Leste
case tg = "TG" // Togo
case tk = "TK" // Tokelau
case to = "TO" // Tonga
case tt = "TT" // Trinidad and Tobago
case tn = "TN" // Tunisia
case tr = "TR" // Turkey
case tm = "TM" // Turkmenistan
case tc = "TC" // Turks and Caicos Islands
case tv = "TV" // Tuvalu
case ug = "UG" // Uganda
case ua = "UA" // Ukraine
case ae = "AE" // United Arab Emirates
case gb = "GB" // United Kingdom
case us = "US" // United States
case um = "UM" // U.S. Minor Outlying Islands
case uy = "UY" // Uruguay
case uz = "UZ" // Uzbekistan
case vu = "VU" // Vanuatu
case ve = "VE" // Venezuela
case vn = "VN" // Vietnam
case vg = "VG" // British Virgin Islands
case vi = "VI" // U.S. Virgin Islands
case wf = "WF" // Wallis and Futuna
case eh = "EH" // Western Sahara
case ye = "YE" // Yemen
case zm = "ZM" // Zambia
case zw = "ZW" // Zimbabwe
}
extension CountryCode {
/// Returns the localized full country name (e.g. "Germany", "Deutschland")
func fullName(locale: Locale = .current) -> String {
locale.localizedString(forRegionCode: self.rawValue) ?? self.rawValue
}
}