Serge Bazanski | cc25bdf | 2018-10-25 14:02:58 +0200 | [diff] [blame] | 1 | package govalidator |
| 2 | |
| 3 | import ( |
| 4 | "reflect" |
| 5 | "regexp" |
| 6 | "sync" |
| 7 | ) |
| 8 | |
| 9 | // Validator is a wrapper for a validator function that returns bool and accepts string. |
| 10 | type Validator func(str string) bool |
| 11 | |
| 12 | // CustomTypeValidator is a wrapper for validator functions that returns bool and accepts any type. |
| 13 | // The second parameter should be the context (in the case of validating a struct: the whole object being validated). |
| 14 | type CustomTypeValidator func(i interface{}, o interface{}) bool |
| 15 | |
| 16 | // ParamValidator is a wrapper for validator functions that accepts additional parameters. |
| 17 | type ParamValidator func(str string, params ...string) bool |
| 18 | type tagOptionsMap map[string]string |
| 19 | |
| 20 | // UnsupportedTypeError is a wrapper for reflect.Type |
| 21 | type UnsupportedTypeError struct { |
| 22 | Type reflect.Type |
| 23 | } |
| 24 | |
| 25 | // stringValues is a slice of reflect.Value holding *reflect.StringValue. |
| 26 | // It implements the methods to sort by string. |
| 27 | type stringValues []reflect.Value |
| 28 | |
| 29 | // ParamTagMap is a map of functions accept variants parameters |
| 30 | var ParamTagMap = map[string]ParamValidator{ |
| 31 | "length": ByteLength, |
| 32 | "range": Range, |
| 33 | "runelength": RuneLength, |
| 34 | "stringlength": StringLength, |
| 35 | "matches": StringMatches, |
| 36 | "in": isInRaw, |
| 37 | "rsapub": IsRsaPub, |
| 38 | } |
| 39 | |
| 40 | // ParamTagRegexMap maps param tags to their respective regexes. |
| 41 | var ParamTagRegexMap = map[string]*regexp.Regexp{ |
| 42 | "range": regexp.MustCompile("^range\\((\\d+)\\|(\\d+)\\)$"), |
| 43 | "length": regexp.MustCompile("^length\\((\\d+)\\|(\\d+)\\)$"), |
| 44 | "runelength": regexp.MustCompile("^runelength\\((\\d+)\\|(\\d+)\\)$"), |
| 45 | "stringlength": regexp.MustCompile("^stringlength\\((\\d+)\\|(\\d+)\\)$"), |
| 46 | "in": regexp.MustCompile(`^in\((.*)\)`), |
| 47 | "matches": regexp.MustCompile(`^matches\((.+)\)$`), |
| 48 | "rsapub": regexp.MustCompile("^rsapub\\((\\d+)\\)$"), |
| 49 | } |
| 50 | |
| 51 | type customTypeTagMap struct { |
| 52 | validators map[string]CustomTypeValidator |
| 53 | |
| 54 | sync.RWMutex |
| 55 | } |
| 56 | |
| 57 | func (tm *customTypeTagMap) Get(name string) (CustomTypeValidator, bool) { |
| 58 | tm.RLock() |
| 59 | defer tm.RUnlock() |
| 60 | v, ok := tm.validators[name] |
| 61 | return v, ok |
| 62 | } |
| 63 | |
| 64 | func (tm *customTypeTagMap) Set(name string, ctv CustomTypeValidator) { |
| 65 | tm.Lock() |
| 66 | defer tm.Unlock() |
| 67 | tm.validators[name] = ctv |
| 68 | } |
| 69 | |
| 70 | // CustomTypeTagMap is a map of functions that can be used as tags for ValidateStruct function. |
| 71 | // Use this to validate compound or custom types that need to be handled as a whole, e.g. |
| 72 | // `type UUID [16]byte` (this would be handled as an array of bytes). |
| 73 | var CustomTypeTagMap = &customTypeTagMap{validators: make(map[string]CustomTypeValidator)} |
| 74 | |
| 75 | // TagMap is a map of functions, that can be used as tags for ValidateStruct function. |
| 76 | var TagMap = map[string]Validator{ |
| 77 | "email": IsEmail, |
| 78 | "url": IsURL, |
| 79 | "dialstring": IsDialString, |
| 80 | "requrl": IsRequestURL, |
| 81 | "requri": IsRequestURI, |
| 82 | "alpha": IsAlpha, |
| 83 | "utfletter": IsUTFLetter, |
| 84 | "alphanum": IsAlphanumeric, |
| 85 | "utfletternum": IsUTFLetterNumeric, |
| 86 | "numeric": IsNumeric, |
| 87 | "utfnumeric": IsUTFNumeric, |
| 88 | "utfdigit": IsUTFDigit, |
| 89 | "hexadecimal": IsHexadecimal, |
| 90 | "hexcolor": IsHexcolor, |
| 91 | "rgbcolor": IsRGBcolor, |
| 92 | "lowercase": IsLowerCase, |
| 93 | "uppercase": IsUpperCase, |
| 94 | "int": IsInt, |
| 95 | "float": IsFloat, |
| 96 | "null": IsNull, |
| 97 | "uuid": IsUUID, |
| 98 | "uuidv3": IsUUIDv3, |
| 99 | "uuidv4": IsUUIDv4, |
| 100 | "uuidv5": IsUUIDv5, |
| 101 | "creditcard": IsCreditCard, |
| 102 | "isbn10": IsISBN10, |
| 103 | "isbn13": IsISBN13, |
| 104 | "json": IsJSON, |
| 105 | "multibyte": IsMultibyte, |
| 106 | "ascii": IsASCII, |
| 107 | "printableascii": IsPrintableASCII, |
| 108 | "fullwidth": IsFullWidth, |
| 109 | "halfwidth": IsHalfWidth, |
| 110 | "variablewidth": IsVariableWidth, |
| 111 | "base64": IsBase64, |
| 112 | "datauri": IsDataURI, |
| 113 | "ip": IsIP, |
| 114 | "port": IsPort, |
| 115 | "ipv4": IsIPv4, |
| 116 | "ipv6": IsIPv6, |
| 117 | "dns": IsDNSName, |
| 118 | "host": IsHost, |
| 119 | "mac": IsMAC, |
| 120 | "latitude": IsLatitude, |
| 121 | "longitude": IsLongitude, |
| 122 | "ssn": IsSSN, |
| 123 | "semver": IsSemver, |
| 124 | "rfc3339": IsRFC3339, |
| 125 | "rfc3339WithoutZone": IsRFC3339WithoutZone, |
| 126 | "ISO3166Alpha2": IsISO3166Alpha2, |
| 127 | "ISO3166Alpha3": IsISO3166Alpha3, |
| 128 | "ISO4217": IsISO4217, |
| 129 | } |
| 130 | |
| 131 | // ISO3166Entry stores country codes |
| 132 | type ISO3166Entry struct { |
| 133 | EnglishShortName string |
| 134 | FrenchShortName string |
| 135 | Alpha2Code string |
| 136 | Alpha3Code string |
| 137 | Numeric string |
| 138 | } |
| 139 | |
| 140 | //ISO3166List based on https://www.iso.org/obp/ui/#search/code/ Code Type "Officially Assigned Codes" |
| 141 | var ISO3166List = []ISO3166Entry{ |
| 142 | {"Afghanistan", "Afghanistan (l')", "AF", "AFG", "004"}, |
| 143 | {"Albania", "Albanie (l')", "AL", "ALB", "008"}, |
| 144 | {"Antarctica", "Antarctique (l')", "AQ", "ATA", "010"}, |
| 145 | {"Algeria", "Algérie (l')", "DZ", "DZA", "012"}, |
| 146 | {"American Samoa", "Samoa américaines (les)", "AS", "ASM", "016"}, |
| 147 | {"Andorra", "Andorre (l')", "AD", "AND", "020"}, |
| 148 | {"Angola", "Angola (l')", "AO", "AGO", "024"}, |
| 149 | {"Antigua and Barbuda", "Antigua-et-Barbuda", "AG", "ATG", "028"}, |
| 150 | {"Azerbaijan", "Azerbaïdjan (l')", "AZ", "AZE", "031"}, |
| 151 | {"Argentina", "Argentine (l')", "AR", "ARG", "032"}, |
| 152 | {"Australia", "Australie (l')", "AU", "AUS", "036"}, |
| 153 | {"Austria", "Autriche (l')", "AT", "AUT", "040"}, |
| 154 | {"Bahamas (the)", "Bahamas (les)", "BS", "BHS", "044"}, |
| 155 | {"Bahrain", "Bahreïn", "BH", "BHR", "048"}, |
| 156 | {"Bangladesh", "Bangladesh (le)", "BD", "BGD", "050"}, |
| 157 | {"Armenia", "Arménie (l')", "AM", "ARM", "051"}, |
| 158 | {"Barbados", "Barbade (la)", "BB", "BRB", "052"}, |
| 159 | {"Belgium", "Belgique (la)", "BE", "BEL", "056"}, |
| 160 | {"Bermuda", "Bermudes (les)", "BM", "BMU", "060"}, |
| 161 | {"Bhutan", "Bhoutan (le)", "BT", "BTN", "064"}, |
| 162 | {"Bolivia (Plurinational State of)", "Bolivie (État plurinational de)", "BO", "BOL", "068"}, |
| 163 | {"Bosnia and Herzegovina", "Bosnie-Herzégovine (la)", "BA", "BIH", "070"}, |
| 164 | {"Botswana", "Botswana (le)", "BW", "BWA", "072"}, |
| 165 | {"Bouvet Island", "Bouvet (l'Île)", "BV", "BVT", "074"}, |
| 166 | {"Brazil", "Brésil (le)", "BR", "BRA", "076"}, |
| 167 | {"Belize", "Belize (le)", "BZ", "BLZ", "084"}, |
| 168 | {"British Indian Ocean Territory (the)", "Indien (le Territoire britannique de l'océan)", "IO", "IOT", "086"}, |
| 169 | {"Solomon Islands", "Salomon (Îles)", "SB", "SLB", "090"}, |
| 170 | {"Virgin Islands (British)", "Vierges britanniques (les Îles)", "VG", "VGB", "092"}, |
| 171 | {"Brunei Darussalam", "Brunéi Darussalam (le)", "BN", "BRN", "096"}, |
| 172 | {"Bulgaria", "Bulgarie (la)", "BG", "BGR", "100"}, |
| 173 | {"Myanmar", "Myanmar (le)", "MM", "MMR", "104"}, |
| 174 | {"Burundi", "Burundi (le)", "BI", "BDI", "108"}, |
| 175 | {"Belarus", "Bélarus (le)", "BY", "BLR", "112"}, |
| 176 | {"Cambodia", "Cambodge (le)", "KH", "KHM", "116"}, |
| 177 | {"Cameroon", "Cameroun (le)", "CM", "CMR", "120"}, |
| 178 | {"Canada", "Canada (le)", "CA", "CAN", "124"}, |
| 179 | {"Cabo Verde", "Cabo Verde", "CV", "CPV", "132"}, |
| 180 | {"Cayman Islands (the)", "Caïmans (les Îles)", "KY", "CYM", "136"}, |
| 181 | {"Central African Republic (the)", "République centrafricaine (la)", "CF", "CAF", "140"}, |
| 182 | {"Sri Lanka", "Sri Lanka", "LK", "LKA", "144"}, |
| 183 | {"Chad", "Tchad (le)", "TD", "TCD", "148"}, |
| 184 | {"Chile", "Chili (le)", "CL", "CHL", "152"}, |
| 185 | {"China", "Chine (la)", "CN", "CHN", "156"}, |
| 186 | {"Taiwan (Province of China)", "Taïwan (Province de Chine)", "TW", "TWN", "158"}, |
| 187 | {"Christmas Island", "Christmas (l'Île)", "CX", "CXR", "162"}, |
| 188 | {"Cocos (Keeling) Islands (the)", "Cocos (les Îles)/ Keeling (les Îles)", "CC", "CCK", "166"}, |
| 189 | {"Colombia", "Colombie (la)", "CO", "COL", "170"}, |
| 190 | {"Comoros (the)", "Comores (les)", "KM", "COM", "174"}, |
| 191 | {"Mayotte", "Mayotte", "YT", "MYT", "175"}, |
| 192 | {"Congo (the)", "Congo (le)", "CG", "COG", "178"}, |
| 193 | {"Congo (the Democratic Republic of the)", "Congo (la République démocratique du)", "CD", "COD", "180"}, |
| 194 | {"Cook Islands (the)", "Cook (les Îles)", "CK", "COK", "184"}, |
| 195 | {"Costa Rica", "Costa Rica (le)", "CR", "CRI", "188"}, |
| 196 | {"Croatia", "Croatie (la)", "HR", "HRV", "191"}, |
| 197 | {"Cuba", "Cuba", "CU", "CUB", "192"}, |
| 198 | {"Cyprus", "Chypre", "CY", "CYP", "196"}, |
| 199 | {"Czech Republic (the)", "tchèque (la République)", "CZ", "CZE", "203"}, |
| 200 | {"Benin", "Bénin (le)", "BJ", "BEN", "204"}, |
| 201 | {"Denmark", "Danemark (le)", "DK", "DNK", "208"}, |
| 202 | {"Dominica", "Dominique (la)", "DM", "DMA", "212"}, |
| 203 | {"Dominican Republic (the)", "dominicaine (la République)", "DO", "DOM", "214"}, |
| 204 | {"Ecuador", "Équateur (l')", "EC", "ECU", "218"}, |
| 205 | {"El Salvador", "El Salvador", "SV", "SLV", "222"}, |
| 206 | {"Equatorial Guinea", "Guinée équatoriale (la)", "GQ", "GNQ", "226"}, |
| 207 | {"Ethiopia", "Éthiopie (l')", "ET", "ETH", "231"}, |
| 208 | {"Eritrea", "Érythrée (l')", "ER", "ERI", "232"}, |
| 209 | {"Estonia", "Estonie (l')", "EE", "EST", "233"}, |
| 210 | {"Faroe Islands (the)", "Féroé (les Îles)", "FO", "FRO", "234"}, |
| 211 | {"Falkland Islands (the) [Malvinas]", "Falkland (les Îles)/Malouines (les Îles)", "FK", "FLK", "238"}, |
| 212 | {"South Georgia and the South Sandwich Islands", "Géorgie du Sud-et-les Îles Sandwich du Sud (la)", "GS", "SGS", "239"}, |
| 213 | {"Fiji", "Fidji (les)", "FJ", "FJI", "242"}, |
| 214 | {"Finland", "Finlande (la)", "FI", "FIN", "246"}, |
| 215 | {"Åland Islands", "Åland(les Îles)", "AX", "ALA", "248"}, |
| 216 | {"France", "France (la)", "FR", "FRA", "250"}, |
| 217 | {"French Guiana", "Guyane française (la )", "GF", "GUF", "254"}, |
| 218 | {"French Polynesia", "Polynésie française (la)", "PF", "PYF", "258"}, |
| 219 | {"French Southern Territories (the)", "Terres australes françaises (les)", "TF", "ATF", "260"}, |
| 220 | {"Djibouti", "Djibouti", "DJ", "DJI", "262"}, |
| 221 | {"Gabon", "Gabon (le)", "GA", "GAB", "266"}, |
| 222 | {"Georgia", "Géorgie (la)", "GE", "GEO", "268"}, |
| 223 | {"Gambia (the)", "Gambie (la)", "GM", "GMB", "270"}, |
| 224 | {"Palestine, State of", "Palestine, État de", "PS", "PSE", "275"}, |
| 225 | {"Germany", "Allemagne (l')", "DE", "DEU", "276"}, |
| 226 | {"Ghana", "Ghana (le)", "GH", "GHA", "288"}, |
| 227 | {"Gibraltar", "Gibraltar", "GI", "GIB", "292"}, |
| 228 | {"Kiribati", "Kiribati", "KI", "KIR", "296"}, |
| 229 | {"Greece", "Grèce (la)", "GR", "GRC", "300"}, |
| 230 | {"Greenland", "Groenland (le)", "GL", "GRL", "304"}, |
| 231 | {"Grenada", "Grenade (la)", "GD", "GRD", "308"}, |
| 232 | {"Guadeloupe", "Guadeloupe (la)", "GP", "GLP", "312"}, |
| 233 | {"Guam", "Guam", "GU", "GUM", "316"}, |
| 234 | {"Guatemala", "Guatemala (le)", "GT", "GTM", "320"}, |
| 235 | {"Guinea", "Guinée (la)", "GN", "GIN", "324"}, |
| 236 | {"Guyana", "Guyana (le)", "GY", "GUY", "328"}, |
| 237 | {"Haiti", "Haïti", "HT", "HTI", "332"}, |
| 238 | {"Heard Island and McDonald Islands", "Heard-et-Îles MacDonald (l'Île)", "HM", "HMD", "334"}, |
| 239 | {"Holy See (the)", "Saint-Siège (le)", "VA", "VAT", "336"}, |
| 240 | {"Honduras", "Honduras (le)", "HN", "HND", "340"}, |
| 241 | {"Hong Kong", "Hong Kong", "HK", "HKG", "344"}, |
| 242 | {"Hungary", "Hongrie (la)", "HU", "HUN", "348"}, |
| 243 | {"Iceland", "Islande (l')", "IS", "ISL", "352"}, |
| 244 | {"India", "Inde (l')", "IN", "IND", "356"}, |
| 245 | {"Indonesia", "Indonésie (l')", "ID", "IDN", "360"}, |
| 246 | {"Iran (Islamic Republic of)", "Iran (République Islamique d')", "IR", "IRN", "364"}, |
| 247 | {"Iraq", "Iraq (l')", "IQ", "IRQ", "368"}, |
| 248 | {"Ireland", "Irlande (l')", "IE", "IRL", "372"}, |
| 249 | {"Israel", "Israël", "IL", "ISR", "376"}, |
| 250 | {"Italy", "Italie (l')", "IT", "ITA", "380"}, |
| 251 | {"Côte d'Ivoire", "Côte d'Ivoire (la)", "CI", "CIV", "384"}, |
| 252 | {"Jamaica", "Jamaïque (la)", "JM", "JAM", "388"}, |
| 253 | {"Japan", "Japon (le)", "JP", "JPN", "392"}, |
| 254 | {"Kazakhstan", "Kazakhstan (le)", "KZ", "KAZ", "398"}, |
| 255 | {"Jordan", "Jordanie (la)", "JO", "JOR", "400"}, |
| 256 | {"Kenya", "Kenya (le)", "KE", "KEN", "404"}, |
| 257 | {"Korea (the Democratic People's Republic of)", "Corée (la République populaire démocratique de)", "KP", "PRK", "408"}, |
| 258 | {"Korea (the Republic of)", "Corée (la République de)", "KR", "KOR", "410"}, |
| 259 | {"Kuwait", "Koweït (le)", "KW", "KWT", "414"}, |
| 260 | {"Kyrgyzstan", "Kirghizistan (le)", "KG", "KGZ", "417"}, |
| 261 | {"Lao People's Democratic Republic (the)", "Lao, République démocratique populaire", "LA", "LAO", "418"}, |
| 262 | {"Lebanon", "Liban (le)", "LB", "LBN", "422"}, |
| 263 | {"Lesotho", "Lesotho (le)", "LS", "LSO", "426"}, |
| 264 | {"Latvia", "Lettonie (la)", "LV", "LVA", "428"}, |
| 265 | {"Liberia", "Libéria (le)", "LR", "LBR", "430"}, |
| 266 | {"Libya", "Libye (la)", "LY", "LBY", "434"}, |
| 267 | {"Liechtenstein", "Liechtenstein (le)", "LI", "LIE", "438"}, |
| 268 | {"Lithuania", "Lituanie (la)", "LT", "LTU", "440"}, |
| 269 | {"Luxembourg", "Luxembourg (le)", "LU", "LUX", "442"}, |
| 270 | {"Macao", "Macao", "MO", "MAC", "446"}, |
| 271 | {"Madagascar", "Madagascar", "MG", "MDG", "450"}, |
| 272 | {"Malawi", "Malawi (le)", "MW", "MWI", "454"}, |
| 273 | {"Malaysia", "Malaisie (la)", "MY", "MYS", "458"}, |
| 274 | {"Maldives", "Maldives (les)", "MV", "MDV", "462"}, |
| 275 | {"Mali", "Mali (le)", "ML", "MLI", "466"}, |
| 276 | {"Malta", "Malte", "MT", "MLT", "470"}, |
| 277 | {"Martinique", "Martinique (la)", "MQ", "MTQ", "474"}, |
| 278 | {"Mauritania", "Mauritanie (la)", "MR", "MRT", "478"}, |
| 279 | {"Mauritius", "Maurice", "MU", "MUS", "480"}, |
| 280 | {"Mexico", "Mexique (le)", "MX", "MEX", "484"}, |
| 281 | {"Monaco", "Monaco", "MC", "MCO", "492"}, |
| 282 | {"Mongolia", "Mongolie (la)", "MN", "MNG", "496"}, |
| 283 | {"Moldova (the Republic of)", "Moldova , République de", "MD", "MDA", "498"}, |
| 284 | {"Montenegro", "Monténégro (le)", "ME", "MNE", "499"}, |
| 285 | {"Montserrat", "Montserrat", "MS", "MSR", "500"}, |
| 286 | {"Morocco", "Maroc (le)", "MA", "MAR", "504"}, |
| 287 | {"Mozambique", "Mozambique (le)", "MZ", "MOZ", "508"}, |
| 288 | {"Oman", "Oman", "OM", "OMN", "512"}, |
| 289 | {"Namibia", "Namibie (la)", "NA", "NAM", "516"}, |
| 290 | {"Nauru", "Nauru", "NR", "NRU", "520"}, |
| 291 | {"Nepal", "Népal (le)", "NP", "NPL", "524"}, |
| 292 | {"Netherlands (the)", "Pays-Bas (les)", "NL", "NLD", "528"}, |
| 293 | {"Curaçao", "Curaçao", "CW", "CUW", "531"}, |
| 294 | {"Aruba", "Aruba", "AW", "ABW", "533"}, |
| 295 | {"Sint Maarten (Dutch part)", "Saint-Martin (partie néerlandaise)", "SX", "SXM", "534"}, |
| 296 | {"Bonaire, Sint Eustatius and Saba", "Bonaire, Saint-Eustache et Saba", "BQ", "BES", "535"}, |
| 297 | {"New Caledonia", "Nouvelle-Calédonie (la)", "NC", "NCL", "540"}, |
| 298 | {"Vanuatu", "Vanuatu (le)", "VU", "VUT", "548"}, |
| 299 | {"New Zealand", "Nouvelle-Zélande (la)", "NZ", "NZL", "554"}, |
| 300 | {"Nicaragua", "Nicaragua (le)", "NI", "NIC", "558"}, |
| 301 | {"Niger (the)", "Niger (le)", "NE", "NER", "562"}, |
| 302 | {"Nigeria", "Nigéria (le)", "NG", "NGA", "566"}, |
| 303 | {"Niue", "Niue", "NU", "NIU", "570"}, |
| 304 | {"Norfolk Island", "Norfolk (l'Île)", "NF", "NFK", "574"}, |
| 305 | {"Norway", "Norvège (la)", "NO", "NOR", "578"}, |
| 306 | {"Northern Mariana Islands (the)", "Mariannes du Nord (les Îles)", "MP", "MNP", "580"}, |
| 307 | {"United States Minor Outlying Islands (the)", "Îles mineures éloignées des États-Unis (les)", "UM", "UMI", "581"}, |
| 308 | {"Micronesia (Federated States of)", "Micronésie (États fédérés de)", "FM", "FSM", "583"}, |
| 309 | {"Marshall Islands (the)", "Marshall (Îles)", "MH", "MHL", "584"}, |
| 310 | {"Palau", "Palaos (les)", "PW", "PLW", "585"}, |
| 311 | {"Pakistan", "Pakistan (le)", "PK", "PAK", "586"}, |
| 312 | {"Panama", "Panama (le)", "PA", "PAN", "591"}, |
| 313 | {"Papua New Guinea", "Papouasie-Nouvelle-Guinée (la)", "PG", "PNG", "598"}, |
| 314 | {"Paraguay", "Paraguay (le)", "PY", "PRY", "600"}, |
| 315 | {"Peru", "Pérou (le)", "PE", "PER", "604"}, |
| 316 | {"Philippines (the)", "Philippines (les)", "PH", "PHL", "608"}, |
| 317 | {"Pitcairn", "Pitcairn", "PN", "PCN", "612"}, |
| 318 | {"Poland", "Pologne (la)", "PL", "POL", "616"}, |
| 319 | {"Portugal", "Portugal (le)", "PT", "PRT", "620"}, |
| 320 | {"Guinea-Bissau", "Guinée-Bissau (la)", "GW", "GNB", "624"}, |
| 321 | {"Timor-Leste", "Timor-Leste (le)", "TL", "TLS", "626"}, |
| 322 | {"Puerto Rico", "Porto Rico", "PR", "PRI", "630"}, |
| 323 | {"Qatar", "Qatar (le)", "QA", "QAT", "634"}, |
| 324 | {"Réunion", "Réunion (La)", "RE", "REU", "638"}, |
| 325 | {"Romania", "Roumanie (la)", "RO", "ROU", "642"}, |
| 326 | {"Russian Federation (the)", "Russie (la Fédération de)", "RU", "RUS", "643"}, |
| 327 | {"Rwanda", "Rwanda (le)", "RW", "RWA", "646"}, |
| 328 | {"Saint Barthélemy", "Saint-Barthélemy", "BL", "BLM", "652"}, |
| 329 | {"Saint Helena, Ascension and Tristan da Cunha", "Sainte-Hélène, Ascension et Tristan da Cunha", "SH", "SHN", "654"}, |
| 330 | {"Saint Kitts and Nevis", "Saint-Kitts-et-Nevis", "KN", "KNA", "659"}, |
| 331 | {"Anguilla", "Anguilla", "AI", "AIA", "660"}, |
| 332 | {"Saint Lucia", "Sainte-Lucie", "LC", "LCA", "662"}, |
| 333 | {"Saint Martin (French part)", "Saint-Martin (partie française)", "MF", "MAF", "663"}, |
| 334 | {"Saint Pierre and Miquelon", "Saint-Pierre-et-Miquelon", "PM", "SPM", "666"}, |
| 335 | {"Saint Vincent and the Grenadines", "Saint-Vincent-et-les Grenadines", "VC", "VCT", "670"}, |
| 336 | {"San Marino", "Saint-Marin", "SM", "SMR", "674"}, |
| 337 | {"Sao Tome and Principe", "Sao Tomé-et-Principe", "ST", "STP", "678"}, |
| 338 | {"Saudi Arabia", "Arabie saoudite (l')", "SA", "SAU", "682"}, |
| 339 | {"Senegal", "Sénégal (le)", "SN", "SEN", "686"}, |
| 340 | {"Serbia", "Serbie (la)", "RS", "SRB", "688"}, |
| 341 | {"Seychelles", "Seychelles (les)", "SC", "SYC", "690"}, |
| 342 | {"Sierra Leone", "Sierra Leone (la)", "SL", "SLE", "694"}, |
| 343 | {"Singapore", "Singapour", "SG", "SGP", "702"}, |
| 344 | {"Slovakia", "Slovaquie (la)", "SK", "SVK", "703"}, |
| 345 | {"Viet Nam", "Viet Nam (le)", "VN", "VNM", "704"}, |
| 346 | {"Slovenia", "Slovénie (la)", "SI", "SVN", "705"}, |
| 347 | {"Somalia", "Somalie (la)", "SO", "SOM", "706"}, |
| 348 | {"South Africa", "Afrique du Sud (l')", "ZA", "ZAF", "710"}, |
| 349 | {"Zimbabwe", "Zimbabwe (le)", "ZW", "ZWE", "716"}, |
| 350 | {"Spain", "Espagne (l')", "ES", "ESP", "724"}, |
| 351 | {"South Sudan", "Soudan du Sud (le)", "SS", "SSD", "728"}, |
| 352 | {"Sudan (the)", "Soudan (le)", "SD", "SDN", "729"}, |
| 353 | {"Western Sahara*", "Sahara occidental (le)*", "EH", "ESH", "732"}, |
| 354 | {"Suriname", "Suriname (le)", "SR", "SUR", "740"}, |
| 355 | {"Svalbard and Jan Mayen", "Svalbard et l'Île Jan Mayen (le)", "SJ", "SJM", "744"}, |
| 356 | {"Swaziland", "Swaziland (le)", "SZ", "SWZ", "748"}, |
| 357 | {"Sweden", "Suède (la)", "SE", "SWE", "752"}, |
| 358 | {"Switzerland", "Suisse (la)", "CH", "CHE", "756"}, |
| 359 | {"Syrian Arab Republic", "République arabe syrienne (la)", "SY", "SYR", "760"}, |
| 360 | {"Tajikistan", "Tadjikistan (le)", "TJ", "TJK", "762"}, |
| 361 | {"Thailand", "Thaïlande (la)", "TH", "THA", "764"}, |
| 362 | {"Togo", "Togo (le)", "TG", "TGO", "768"}, |
| 363 | {"Tokelau", "Tokelau (les)", "TK", "TKL", "772"}, |
| 364 | {"Tonga", "Tonga (les)", "TO", "TON", "776"}, |
| 365 | {"Trinidad and Tobago", "Trinité-et-Tobago (la)", "TT", "TTO", "780"}, |
| 366 | {"United Arab Emirates (the)", "Émirats arabes unis (les)", "AE", "ARE", "784"}, |
| 367 | {"Tunisia", "Tunisie (la)", "TN", "TUN", "788"}, |
| 368 | {"Turkey", "Turquie (la)", "TR", "TUR", "792"}, |
| 369 | {"Turkmenistan", "Turkménistan (le)", "TM", "TKM", "795"}, |
| 370 | {"Turks and Caicos Islands (the)", "Turks-et-Caïcos (les Îles)", "TC", "TCA", "796"}, |
| 371 | {"Tuvalu", "Tuvalu (les)", "TV", "TUV", "798"}, |
| 372 | {"Uganda", "Ouganda (l')", "UG", "UGA", "800"}, |
| 373 | {"Ukraine", "Ukraine (l')", "UA", "UKR", "804"}, |
| 374 | {"Macedonia (the former Yugoslav Republic of)", "Macédoine (l'ex‑République yougoslave de)", "MK", "MKD", "807"}, |
| 375 | {"Egypt", "Égypte (l')", "EG", "EGY", "818"}, |
| 376 | {"United Kingdom of Great Britain and Northern Ireland (the)", "Royaume-Uni de Grande-Bretagne et d'Irlande du Nord (le)", "GB", "GBR", "826"}, |
| 377 | {"Guernsey", "Guernesey", "GG", "GGY", "831"}, |
| 378 | {"Jersey", "Jersey", "JE", "JEY", "832"}, |
| 379 | {"Isle of Man", "Île de Man", "IM", "IMN", "833"}, |
| 380 | {"Tanzania, United Republic of", "Tanzanie, République-Unie de", "TZ", "TZA", "834"}, |
| 381 | {"United States of America (the)", "États-Unis d'Amérique (les)", "US", "USA", "840"}, |
| 382 | {"Virgin Islands (U.S.)", "Vierges des États-Unis (les Îles)", "VI", "VIR", "850"}, |
| 383 | {"Burkina Faso", "Burkina Faso (le)", "BF", "BFA", "854"}, |
| 384 | {"Uruguay", "Uruguay (l')", "UY", "URY", "858"}, |
| 385 | {"Uzbekistan", "Ouzbékistan (l')", "UZ", "UZB", "860"}, |
| 386 | {"Venezuela (Bolivarian Republic of)", "Venezuela (République bolivarienne du)", "VE", "VEN", "862"}, |
| 387 | {"Wallis and Futuna", "Wallis-et-Futuna", "WF", "WLF", "876"}, |
| 388 | {"Samoa", "Samoa (le)", "WS", "WSM", "882"}, |
| 389 | {"Yemen", "Yémen (le)", "YE", "YEM", "887"}, |
| 390 | {"Zambia", "Zambie (la)", "ZM", "ZMB", "894"}, |
| 391 | } |
| 392 | |
| 393 | // ISO4217List is the list of ISO currency codes |
| 394 | var ISO4217List = []string{ |
| 395 | "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", |
| 396 | "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", |
| 397 | "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", |
| 398 | "DJF", "DKK", "DOP", "DZD", |
| 399 | "EGP", "ERN", "ETB", "EUR", |
| 400 | "FJD", "FKP", |
| 401 | "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", |
| 402 | "HKD", "HNL", "HRK", "HTG", "HUF", |
| 403 | "IDR", "ILS", "INR", "IQD", "IRR", "ISK", |
| 404 | "JMD", "JOD", "JPY", |
| 405 | "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", |
| 406 | "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", |
| 407 | "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", |
| 408 | "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", |
| 409 | "OMR", |
| 410 | "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", |
| 411 | "QAR", |
| 412 | "RON", "RSD", "RUB", "RWF", |
| 413 | "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "SVC", "SYP", "SZL", |
| 414 | "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", |
| 415 | "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UZS", |
| 416 | "VEF", "VND", "VUV", |
| 417 | "WST", |
| 418 | "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XTS", "XUA", "XXX", |
| 419 | "YER", |
| 420 | "ZAR", "ZMW", "ZWL", |
| 421 | } |
| 422 | |
| 423 | // ISO693Entry stores ISO language codes |
| 424 | type ISO693Entry struct { |
| 425 | Alpha3bCode string |
| 426 | Alpha2Code string |
| 427 | English string |
| 428 | } |
| 429 | |
| 430 | //ISO693List based on http://data.okfn.org/data/core/language-codes/r/language-codes-3b2.json |
| 431 | var ISO693List = []ISO693Entry{ |
| 432 | {Alpha3bCode: "aar", Alpha2Code: "aa", English: "Afar"}, |
| 433 | {Alpha3bCode: "abk", Alpha2Code: "ab", English: "Abkhazian"}, |
| 434 | {Alpha3bCode: "afr", Alpha2Code: "af", English: "Afrikaans"}, |
| 435 | {Alpha3bCode: "aka", Alpha2Code: "ak", English: "Akan"}, |
| 436 | {Alpha3bCode: "alb", Alpha2Code: "sq", English: "Albanian"}, |
| 437 | {Alpha3bCode: "amh", Alpha2Code: "am", English: "Amharic"}, |
| 438 | {Alpha3bCode: "ara", Alpha2Code: "ar", English: "Arabic"}, |
| 439 | {Alpha3bCode: "arg", Alpha2Code: "an", English: "Aragonese"}, |
| 440 | {Alpha3bCode: "arm", Alpha2Code: "hy", English: "Armenian"}, |
| 441 | {Alpha3bCode: "asm", Alpha2Code: "as", English: "Assamese"}, |
| 442 | {Alpha3bCode: "ava", Alpha2Code: "av", English: "Avaric"}, |
| 443 | {Alpha3bCode: "ave", Alpha2Code: "ae", English: "Avestan"}, |
| 444 | {Alpha3bCode: "aym", Alpha2Code: "ay", English: "Aymara"}, |
| 445 | {Alpha3bCode: "aze", Alpha2Code: "az", English: "Azerbaijani"}, |
| 446 | {Alpha3bCode: "bak", Alpha2Code: "ba", English: "Bashkir"}, |
| 447 | {Alpha3bCode: "bam", Alpha2Code: "bm", English: "Bambara"}, |
| 448 | {Alpha3bCode: "baq", Alpha2Code: "eu", English: "Basque"}, |
| 449 | {Alpha3bCode: "bel", Alpha2Code: "be", English: "Belarusian"}, |
| 450 | {Alpha3bCode: "ben", Alpha2Code: "bn", English: "Bengali"}, |
| 451 | {Alpha3bCode: "bih", Alpha2Code: "bh", English: "Bihari languages"}, |
| 452 | {Alpha3bCode: "bis", Alpha2Code: "bi", English: "Bislama"}, |
| 453 | {Alpha3bCode: "bos", Alpha2Code: "bs", English: "Bosnian"}, |
| 454 | {Alpha3bCode: "bre", Alpha2Code: "br", English: "Breton"}, |
| 455 | {Alpha3bCode: "bul", Alpha2Code: "bg", English: "Bulgarian"}, |
| 456 | {Alpha3bCode: "bur", Alpha2Code: "my", English: "Burmese"}, |
| 457 | {Alpha3bCode: "cat", Alpha2Code: "ca", English: "Catalan; Valencian"}, |
| 458 | {Alpha3bCode: "cha", Alpha2Code: "ch", English: "Chamorro"}, |
| 459 | {Alpha3bCode: "che", Alpha2Code: "ce", English: "Chechen"}, |
| 460 | {Alpha3bCode: "chi", Alpha2Code: "zh", English: "Chinese"}, |
| 461 | {Alpha3bCode: "chu", Alpha2Code: "cu", English: "Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic"}, |
| 462 | {Alpha3bCode: "chv", Alpha2Code: "cv", English: "Chuvash"}, |
| 463 | {Alpha3bCode: "cor", Alpha2Code: "kw", English: "Cornish"}, |
| 464 | {Alpha3bCode: "cos", Alpha2Code: "co", English: "Corsican"}, |
| 465 | {Alpha3bCode: "cre", Alpha2Code: "cr", English: "Cree"}, |
| 466 | {Alpha3bCode: "cze", Alpha2Code: "cs", English: "Czech"}, |
| 467 | {Alpha3bCode: "dan", Alpha2Code: "da", English: "Danish"}, |
| 468 | {Alpha3bCode: "div", Alpha2Code: "dv", English: "Divehi; Dhivehi; Maldivian"}, |
| 469 | {Alpha3bCode: "dut", Alpha2Code: "nl", English: "Dutch; Flemish"}, |
| 470 | {Alpha3bCode: "dzo", Alpha2Code: "dz", English: "Dzongkha"}, |
| 471 | {Alpha3bCode: "eng", Alpha2Code: "en", English: "English"}, |
| 472 | {Alpha3bCode: "epo", Alpha2Code: "eo", English: "Esperanto"}, |
| 473 | {Alpha3bCode: "est", Alpha2Code: "et", English: "Estonian"}, |
| 474 | {Alpha3bCode: "ewe", Alpha2Code: "ee", English: "Ewe"}, |
| 475 | {Alpha3bCode: "fao", Alpha2Code: "fo", English: "Faroese"}, |
| 476 | {Alpha3bCode: "fij", Alpha2Code: "fj", English: "Fijian"}, |
| 477 | {Alpha3bCode: "fin", Alpha2Code: "fi", English: "Finnish"}, |
| 478 | {Alpha3bCode: "fre", Alpha2Code: "fr", English: "French"}, |
| 479 | {Alpha3bCode: "fry", Alpha2Code: "fy", English: "Western Frisian"}, |
| 480 | {Alpha3bCode: "ful", Alpha2Code: "ff", English: "Fulah"}, |
| 481 | {Alpha3bCode: "geo", Alpha2Code: "ka", English: "Georgian"}, |
| 482 | {Alpha3bCode: "ger", Alpha2Code: "de", English: "German"}, |
| 483 | {Alpha3bCode: "gla", Alpha2Code: "gd", English: "Gaelic; Scottish Gaelic"}, |
| 484 | {Alpha3bCode: "gle", Alpha2Code: "ga", English: "Irish"}, |
| 485 | {Alpha3bCode: "glg", Alpha2Code: "gl", English: "Galician"}, |
| 486 | {Alpha3bCode: "glv", Alpha2Code: "gv", English: "Manx"}, |
| 487 | {Alpha3bCode: "gre", Alpha2Code: "el", English: "Greek, Modern (1453-)"}, |
| 488 | {Alpha3bCode: "grn", Alpha2Code: "gn", English: "Guarani"}, |
| 489 | {Alpha3bCode: "guj", Alpha2Code: "gu", English: "Gujarati"}, |
| 490 | {Alpha3bCode: "hat", Alpha2Code: "ht", English: "Haitian; Haitian Creole"}, |
| 491 | {Alpha3bCode: "hau", Alpha2Code: "ha", English: "Hausa"}, |
| 492 | {Alpha3bCode: "heb", Alpha2Code: "he", English: "Hebrew"}, |
| 493 | {Alpha3bCode: "her", Alpha2Code: "hz", English: "Herero"}, |
| 494 | {Alpha3bCode: "hin", Alpha2Code: "hi", English: "Hindi"}, |
| 495 | {Alpha3bCode: "hmo", Alpha2Code: "ho", English: "Hiri Motu"}, |
| 496 | {Alpha3bCode: "hrv", Alpha2Code: "hr", English: "Croatian"}, |
| 497 | {Alpha3bCode: "hun", Alpha2Code: "hu", English: "Hungarian"}, |
| 498 | {Alpha3bCode: "ibo", Alpha2Code: "ig", English: "Igbo"}, |
| 499 | {Alpha3bCode: "ice", Alpha2Code: "is", English: "Icelandic"}, |
| 500 | {Alpha3bCode: "ido", Alpha2Code: "io", English: "Ido"}, |
| 501 | {Alpha3bCode: "iii", Alpha2Code: "ii", English: "Sichuan Yi; Nuosu"}, |
| 502 | {Alpha3bCode: "iku", Alpha2Code: "iu", English: "Inuktitut"}, |
| 503 | {Alpha3bCode: "ile", Alpha2Code: "ie", English: "Interlingue; Occidental"}, |
| 504 | {Alpha3bCode: "ina", Alpha2Code: "ia", English: "Interlingua (International Auxiliary Language Association)"}, |
| 505 | {Alpha3bCode: "ind", Alpha2Code: "id", English: "Indonesian"}, |
| 506 | {Alpha3bCode: "ipk", Alpha2Code: "ik", English: "Inupiaq"}, |
| 507 | {Alpha3bCode: "ita", Alpha2Code: "it", English: "Italian"}, |
| 508 | {Alpha3bCode: "jav", Alpha2Code: "jv", English: "Javanese"}, |
| 509 | {Alpha3bCode: "jpn", Alpha2Code: "ja", English: "Japanese"}, |
| 510 | {Alpha3bCode: "kal", Alpha2Code: "kl", English: "Kalaallisut; Greenlandic"}, |
| 511 | {Alpha3bCode: "kan", Alpha2Code: "kn", English: "Kannada"}, |
| 512 | {Alpha3bCode: "kas", Alpha2Code: "ks", English: "Kashmiri"}, |
| 513 | {Alpha3bCode: "kau", Alpha2Code: "kr", English: "Kanuri"}, |
| 514 | {Alpha3bCode: "kaz", Alpha2Code: "kk", English: "Kazakh"}, |
| 515 | {Alpha3bCode: "khm", Alpha2Code: "km", English: "Central Khmer"}, |
| 516 | {Alpha3bCode: "kik", Alpha2Code: "ki", English: "Kikuyu; Gikuyu"}, |
| 517 | {Alpha3bCode: "kin", Alpha2Code: "rw", English: "Kinyarwanda"}, |
| 518 | {Alpha3bCode: "kir", Alpha2Code: "ky", English: "Kirghiz; Kyrgyz"}, |
| 519 | {Alpha3bCode: "kom", Alpha2Code: "kv", English: "Komi"}, |
| 520 | {Alpha3bCode: "kon", Alpha2Code: "kg", English: "Kongo"}, |
| 521 | {Alpha3bCode: "kor", Alpha2Code: "ko", English: "Korean"}, |
| 522 | {Alpha3bCode: "kua", Alpha2Code: "kj", English: "Kuanyama; Kwanyama"}, |
| 523 | {Alpha3bCode: "kur", Alpha2Code: "ku", English: "Kurdish"}, |
| 524 | {Alpha3bCode: "lao", Alpha2Code: "lo", English: "Lao"}, |
| 525 | {Alpha3bCode: "lat", Alpha2Code: "la", English: "Latin"}, |
| 526 | {Alpha3bCode: "lav", Alpha2Code: "lv", English: "Latvian"}, |
| 527 | {Alpha3bCode: "lim", Alpha2Code: "li", English: "Limburgan; Limburger; Limburgish"}, |
| 528 | {Alpha3bCode: "lin", Alpha2Code: "ln", English: "Lingala"}, |
| 529 | {Alpha3bCode: "lit", Alpha2Code: "lt", English: "Lithuanian"}, |
| 530 | {Alpha3bCode: "ltz", Alpha2Code: "lb", English: "Luxembourgish; Letzeburgesch"}, |
| 531 | {Alpha3bCode: "lub", Alpha2Code: "lu", English: "Luba-Katanga"}, |
| 532 | {Alpha3bCode: "lug", Alpha2Code: "lg", English: "Ganda"}, |
| 533 | {Alpha3bCode: "mac", Alpha2Code: "mk", English: "Macedonian"}, |
| 534 | {Alpha3bCode: "mah", Alpha2Code: "mh", English: "Marshallese"}, |
| 535 | {Alpha3bCode: "mal", Alpha2Code: "ml", English: "Malayalam"}, |
| 536 | {Alpha3bCode: "mao", Alpha2Code: "mi", English: "Maori"}, |
| 537 | {Alpha3bCode: "mar", Alpha2Code: "mr", English: "Marathi"}, |
| 538 | {Alpha3bCode: "may", Alpha2Code: "ms", English: "Malay"}, |
| 539 | {Alpha3bCode: "mlg", Alpha2Code: "mg", English: "Malagasy"}, |
| 540 | {Alpha3bCode: "mlt", Alpha2Code: "mt", English: "Maltese"}, |
| 541 | {Alpha3bCode: "mon", Alpha2Code: "mn", English: "Mongolian"}, |
| 542 | {Alpha3bCode: "nau", Alpha2Code: "na", English: "Nauru"}, |
| 543 | {Alpha3bCode: "nav", Alpha2Code: "nv", English: "Navajo; Navaho"}, |
| 544 | {Alpha3bCode: "nbl", Alpha2Code: "nr", English: "Ndebele, South; South Ndebele"}, |
| 545 | {Alpha3bCode: "nde", Alpha2Code: "nd", English: "Ndebele, North; North Ndebele"}, |
| 546 | {Alpha3bCode: "ndo", Alpha2Code: "ng", English: "Ndonga"}, |
| 547 | {Alpha3bCode: "nep", Alpha2Code: "ne", English: "Nepali"}, |
| 548 | {Alpha3bCode: "nno", Alpha2Code: "nn", English: "Norwegian Nynorsk; Nynorsk, Norwegian"}, |
| 549 | {Alpha3bCode: "nob", Alpha2Code: "nb", English: "Bokmål, Norwegian; Norwegian Bokmål"}, |
| 550 | {Alpha3bCode: "nor", Alpha2Code: "no", English: "Norwegian"}, |
| 551 | {Alpha3bCode: "nya", Alpha2Code: "ny", English: "Chichewa; Chewa; Nyanja"}, |
| 552 | {Alpha3bCode: "oci", Alpha2Code: "oc", English: "Occitan (post 1500); Provençal"}, |
| 553 | {Alpha3bCode: "oji", Alpha2Code: "oj", English: "Ojibwa"}, |
| 554 | {Alpha3bCode: "ori", Alpha2Code: "or", English: "Oriya"}, |
| 555 | {Alpha3bCode: "orm", Alpha2Code: "om", English: "Oromo"}, |
| 556 | {Alpha3bCode: "oss", Alpha2Code: "os", English: "Ossetian; Ossetic"}, |
| 557 | {Alpha3bCode: "pan", Alpha2Code: "pa", English: "Panjabi; Punjabi"}, |
| 558 | {Alpha3bCode: "per", Alpha2Code: "fa", English: "Persian"}, |
| 559 | {Alpha3bCode: "pli", Alpha2Code: "pi", English: "Pali"}, |
| 560 | {Alpha3bCode: "pol", Alpha2Code: "pl", English: "Polish"}, |
| 561 | {Alpha3bCode: "por", Alpha2Code: "pt", English: "Portuguese"}, |
| 562 | {Alpha3bCode: "pus", Alpha2Code: "ps", English: "Pushto; Pashto"}, |
| 563 | {Alpha3bCode: "que", Alpha2Code: "qu", English: "Quechua"}, |
| 564 | {Alpha3bCode: "roh", Alpha2Code: "rm", English: "Romansh"}, |
| 565 | {Alpha3bCode: "rum", Alpha2Code: "ro", English: "Romanian; Moldavian; Moldovan"}, |
| 566 | {Alpha3bCode: "run", Alpha2Code: "rn", English: "Rundi"}, |
| 567 | {Alpha3bCode: "rus", Alpha2Code: "ru", English: "Russian"}, |
| 568 | {Alpha3bCode: "sag", Alpha2Code: "sg", English: "Sango"}, |
| 569 | {Alpha3bCode: "san", Alpha2Code: "sa", English: "Sanskrit"}, |
| 570 | {Alpha3bCode: "sin", Alpha2Code: "si", English: "Sinhala; Sinhalese"}, |
| 571 | {Alpha3bCode: "slo", Alpha2Code: "sk", English: "Slovak"}, |
| 572 | {Alpha3bCode: "slv", Alpha2Code: "sl", English: "Slovenian"}, |
| 573 | {Alpha3bCode: "sme", Alpha2Code: "se", English: "Northern Sami"}, |
| 574 | {Alpha3bCode: "smo", Alpha2Code: "sm", English: "Samoan"}, |
| 575 | {Alpha3bCode: "sna", Alpha2Code: "sn", English: "Shona"}, |
| 576 | {Alpha3bCode: "snd", Alpha2Code: "sd", English: "Sindhi"}, |
| 577 | {Alpha3bCode: "som", Alpha2Code: "so", English: "Somali"}, |
| 578 | {Alpha3bCode: "sot", Alpha2Code: "st", English: "Sotho, Southern"}, |
| 579 | {Alpha3bCode: "spa", Alpha2Code: "es", English: "Spanish; Castilian"}, |
| 580 | {Alpha3bCode: "srd", Alpha2Code: "sc", English: "Sardinian"}, |
| 581 | {Alpha3bCode: "srp", Alpha2Code: "sr", English: "Serbian"}, |
| 582 | {Alpha3bCode: "ssw", Alpha2Code: "ss", English: "Swati"}, |
| 583 | {Alpha3bCode: "sun", Alpha2Code: "su", English: "Sundanese"}, |
| 584 | {Alpha3bCode: "swa", Alpha2Code: "sw", English: "Swahili"}, |
| 585 | {Alpha3bCode: "swe", Alpha2Code: "sv", English: "Swedish"}, |
| 586 | {Alpha3bCode: "tah", Alpha2Code: "ty", English: "Tahitian"}, |
| 587 | {Alpha3bCode: "tam", Alpha2Code: "ta", English: "Tamil"}, |
| 588 | {Alpha3bCode: "tat", Alpha2Code: "tt", English: "Tatar"}, |
| 589 | {Alpha3bCode: "tel", Alpha2Code: "te", English: "Telugu"}, |
| 590 | {Alpha3bCode: "tgk", Alpha2Code: "tg", English: "Tajik"}, |
| 591 | {Alpha3bCode: "tgl", Alpha2Code: "tl", English: "Tagalog"}, |
| 592 | {Alpha3bCode: "tha", Alpha2Code: "th", English: "Thai"}, |
| 593 | {Alpha3bCode: "tib", Alpha2Code: "bo", English: "Tibetan"}, |
| 594 | {Alpha3bCode: "tir", Alpha2Code: "ti", English: "Tigrinya"}, |
| 595 | {Alpha3bCode: "ton", Alpha2Code: "to", English: "Tonga (Tonga Islands)"}, |
| 596 | {Alpha3bCode: "tsn", Alpha2Code: "tn", English: "Tswana"}, |
| 597 | {Alpha3bCode: "tso", Alpha2Code: "ts", English: "Tsonga"}, |
| 598 | {Alpha3bCode: "tuk", Alpha2Code: "tk", English: "Turkmen"}, |
| 599 | {Alpha3bCode: "tur", Alpha2Code: "tr", English: "Turkish"}, |
| 600 | {Alpha3bCode: "twi", Alpha2Code: "tw", English: "Twi"}, |
| 601 | {Alpha3bCode: "uig", Alpha2Code: "ug", English: "Uighur; Uyghur"}, |
| 602 | {Alpha3bCode: "ukr", Alpha2Code: "uk", English: "Ukrainian"}, |
| 603 | {Alpha3bCode: "urd", Alpha2Code: "ur", English: "Urdu"}, |
| 604 | {Alpha3bCode: "uzb", Alpha2Code: "uz", English: "Uzbek"}, |
| 605 | {Alpha3bCode: "ven", Alpha2Code: "ve", English: "Venda"}, |
| 606 | {Alpha3bCode: "vie", Alpha2Code: "vi", English: "Vietnamese"}, |
| 607 | {Alpha3bCode: "vol", Alpha2Code: "vo", English: "Volapük"}, |
| 608 | {Alpha3bCode: "wel", Alpha2Code: "cy", English: "Welsh"}, |
| 609 | {Alpha3bCode: "wln", Alpha2Code: "wa", English: "Walloon"}, |
| 610 | {Alpha3bCode: "wol", Alpha2Code: "wo", English: "Wolof"}, |
| 611 | {Alpha3bCode: "xho", Alpha2Code: "xh", English: "Xhosa"}, |
| 612 | {Alpha3bCode: "yid", Alpha2Code: "yi", English: "Yiddish"}, |
| 613 | {Alpha3bCode: "yor", Alpha2Code: "yo", English: "Yoruba"}, |
| 614 | {Alpha3bCode: "zha", Alpha2Code: "za", English: "Zhuang; Chuang"}, |
| 615 | {Alpha3bCode: "zul", Alpha2Code: "zu", English: "Zulu"}, |
| 616 | } |