github.com/angenalZZZ/gofunc@v0.0.0-20210507121333-48ff1be3917b/f/validator_type.go (about)

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