5999532000-08-18Martin Nilsson // By Martin Nilsson
f6d82b2014-08-06Martin Nilsson // Updated 2014-08-06 from http://lcweb.loc.gov/standards/iso639-2/
5999532000-08-18Martin Nilsson 
a580e12000-09-27Fredrik Hübinette (Hubbe) #pike __REAL_VERSION__
a20af62000-09-26Fredrik Hübinette (Hubbe) 
852bd72001-01-04Martin Nilsson // Mapping from ISO 639-2/T code to language name.
9eaf1d2008-06-28Martin Nilsson protected constant languages = ([
5999532000-08-18Martin Nilsson  "aar":"Afar", "abk":"Abkhazian", "ace":"Achinese", "ach":"Acoli", "ada":"Adangme",
fe131a2003-07-03Martin Nilsson  "ady":"Adyghe; Adygei",
5999532000-08-18Martin Nilsson  "afa":"Afro-Asiatic (Other)", "afh":"Afrihili", "afr":"Afrikaans",
c6648b2006-01-04Martin Nilsson  "ain":"Ainu",
5999532000-08-18Martin Nilsson  "aka":"Akan", "akk":"Akkadian", "ale":"Aleut", "alg":"Algonquian languages",
c6648b2006-01-04Martin Nilsson  "alt":"Southern Altai",
5999532000-08-18Martin Nilsson  "amh":"Amharic", "ang":"English, Old (ca.450-1100)",
c6648b2006-01-04Martin Nilsson  "anp":"Angika",
5999532000-08-18Martin Nilsson  "apa":"Apache languages", "ara":"Arabic", "arc":"Aramaic",
67eb752003-03-19Martin Nilsson  "arg":"Aragonese",
9215312007-11-11Martin Nilsson  "arn":"Mapudungun",
5999532000-08-18Martin Nilsson  "arp":"Arapaho", "art":"Artificial (Other)", "arw":"Arawak", "asm":"Assamese",
0f432c2002-09-14Martin Nilsson  "ast":"Asturian",
5999532000-08-18Martin Nilsson  "ath":"Athapascan languages", "aus":"Australian languages", "ava":"Avaric", "ave":"Avestan", "awa":"Awadhi", "aym":"Aymara", "aze":"Azerbaijani",
b749112008-12-28Martin Nilsson  "bad":"Banda languages",
5999532000-08-18Martin Nilsson  "bai":"Bamileke languages", "bak":"Bashkir", "bal":"Baluchi", "bam":"Bambara", "ban":"Balinese", "bas":"Basa", "bat":"Baltic (Other)", "bej":"Beja", "bel":"Belarusian", "bem":"Bemba", "ben":"Bengali", "ber":"Berber (Other)", "bho":"Bhojpuri", "bih":"Bihari", "bik":"Bikol", "bin":"Bini", "bis":"Bislama", "bla":"Siksika", "bnt":"Bantu (Other)", "bod":"Tibetan", "bos":"Bosnian", "bra":"Braj", "bre":"Breton",
b749112008-12-28Martin Nilsson  "btk":"Batak languages",
5999532000-08-18Martin Nilsson  "bua":"Buriat", "bug":"Buginese", "bul":"Bulgarian",
9c11542005-04-03Martin Nilsson  "byn":"Blin",
5999532000-08-18Martin Nilsson  "cad":"Caddo", "cai":"Central American Indian (Other)",
9215312007-11-11Martin Nilsson  "car":"Galibi Carib",
5999532000-08-18Martin Nilsson  "cat":"Catalan", "cau":"Caucasian (Other)", "ceb":"Cebuano", "cel":"Celtic (Other)", "ces":"Czech", "cha":"Chamorro", "chb":"Chibcha", "che":"Chechen", "chg":"Chagatai", "chk":"Chuukese", "chm":"Mari", "chn":"Chinook jargon", "cho":"Choctaw", "chp":"Chipewyan", "chr":"Cherokee", "chu":"Church Slavic", "chv":"Chuvash", "chy":"Cheyenne", "cmc":"Chamic languages", "cop":"Coptic", "cor":"Cornish", "cos":"Corsican", "cpe":"Creoles and pidgins, English based (Other)", "cpf":"Creoles and pidgins, French-based (Other)", "cpp":"Creoles and pidgins, Portuguese-based (Other)", "cre":"Cree",
9c11542005-04-03Martin Nilsson  "crh":"Crimean Turkish",
5999532000-08-18Martin Nilsson  "crp":"Creoles and pidgins (Other)",
fe131a2003-07-03Martin Nilsson  "csb":"Kashubian",
5999532000-08-18Martin Nilsson  "cus":"Cushitic (Other)", "cym":"Welsh", "dak":"Dakota", "dan":"Danish",
67eb752003-03-19Martin Nilsson  "dar":"Dargwa",
b749112008-12-28Martin Nilsson  "day":"Dayak languages",
5999532000-08-18Martin Nilsson  "del":"Delaware", "den":"Slave (Athapascan)", "deu":"German", "dgr":"Dogrib", "din":"Dinka", "div":"Divehi", "doi":"Dogri", "dra":"Dravidian (Other)",
9c11542005-04-03Martin Nilsson  "dsb":"Lower Sorbian",
5999532000-08-18Martin Nilsson  "dua":"Duala", "dum":"Dutch, Middle (ca.1050-1350)", "dyu":"Dyula", "dzo":"Dzongkha", "efi":"Efik", "egy":"Egyptian (Ancient)", "eka":"Ekajuk",
9215312007-11-11Martin Nilsson  "ell":"Greek",
5999532000-08-18Martin Nilsson  "elx":"Elamite", "eng":"English", "enm":"English, Middle (1100-1500)", "epo":"Esperanto", "est":"Estonian", "eus":"Basque", "ewe":"Ewe", "ewo":"Ewondo", "fan":"Fang", "fao":"Faroese", "fas":"Persian", "fat":"Fanti", "fij":"Fijian",
9c11542005-04-03Martin Nilsson  "fil":"Filipino",
5999532000-08-18Martin Nilsson  "fin":"Finnish", "fiu":"Finno-Ugrian (Other)", "fon":"Fon", "fra":"French", "frm":"French, Middle (ca.1400-1600)", "fro":"French, Old (842-ca.1400)",
c6648b2006-01-04Martin Nilsson  "frr":"Northern Frisian", "frs":"Eastern Frisian", "fry":"Western Frisian",
5999532000-08-18Martin Nilsson  "ful":"Fulah", "fur":"Friulian", "gaa":"Ga", "gay":"Gayo", "gba":"Gbaya", "gem":"Germanic (Other)", "gez":"Geez", "gil":"Gilbertese", "gla":"Gaelic (Scots)", "gle":"Irish",
c6648b2006-01-04Martin Nilsson  "glg":"Galician",
5999532000-08-18Martin Nilsson  "glv":"Manx", "gmh":"German, Middle High (ca.1050-1500)", "goh":"German, Old High (ca.750-1050)", "gon":"Gondi", "gor":"Gorontalo", "got":"Gothic", "grb":"Grebo", "grc":"Greek, Ancient (to 1453)", "grn":"Guarani",
9215312007-11-11Martin Nilsson  "gsw":"Alemannic",
5999532000-08-18Martin Nilsson  "guj":"Gujarati", "gwi":"Gwich´in", "hai":"Haida", "hau":"Hausa", "haw":"Hawaiian", "heb":"Hebrew", "her":"Herero", "hil":"Hiligaynon",
f6d82b2014-08-06Martin Nilsson  "him":"Himachal",
5999532000-08-18Martin Nilsson  "hin":"Hindi", "hit":"Hittite", "hmn":"Hmong", "hmo":"Hiri Motu", "hrv":"Croatian",
9c11542005-04-03Martin Nilsson  "hsb":"Upper Sorban",
5999532000-08-18Martin Nilsson  "hun":"Hungarian", "hup":"Hupa", "hye":"Armenian", "iba":"Iban", "ibo":"Igbo",
0f432c2002-09-14Martin Nilsson  "ido":"Ido",
67eb752003-03-19Martin Nilsson  "iii":"Sichuan Yi",
b749112008-12-28Martin Nilsson  "ijo":"Ijo languages",
5999532000-08-18Martin Nilsson  "iku":"Inuktitut", "ile":"Interlingue", "ilo":"Iloko", "ina":"Interlingua (International Auxiliary Language Association)", "inc":"Indic (Other)", "ind":"Indonesian", "ine":"Indo-European (Other)",
67eb752003-03-19Martin Nilsson  "inh":"Ingush",
5999532000-08-18Martin Nilsson  "ipk":"Inupiaq", "ira":"Iranian (Other)", "iro":"Iroquoian languages", "isl":"Icelandic", "ita":"Italian",
0f432c2002-09-14Martin Nilsson  "jav":"Javanese",
9c11542005-04-03Martin Nilsson  "jbo":"Lojban",
5999532000-08-18Martin Nilsson  "jpn":"Japanese", "jpr":"Judeo-Persian", "kaa":"Kara-Kalpak", "kab":"Kabyle", "kac":"Kachin", "kal":"Kalaallisut", "kam":"Kamba", "kan":"Kannada",
b749112008-12-28Martin Nilsson  "kar":"Karen languages",
5999532000-08-18Martin Nilsson  "kas":"Kashmiri", "kat":"Georgian", "kau":"Kanuri", "kaw":"Kawi", "kaz":"Kazakh",
67eb752003-03-19Martin Nilsson  "kbd":"Kabardian",
5999532000-08-18Martin Nilsson  "kha":"Khasi", "khi":"Khoisan (Other)",
9215312007-11-11Martin Nilsson  "khm":"Central Khmer",
5999532000-08-18Martin Nilsson  "kho":"Khotanese", "kik":"Kikuyu", "kin":"Kinyarwanda", "kir":"Kirghiz", "kmb":"Kimbundu", "kok":"Konkani", "kom":"Komi", "kon":"Kongo", "kor":"Korean", "kos":"Kosraean", "kpe":"Kpelle",
fe131a2003-07-03Martin Nilsson  "krc":"Karachay-Balkar",
c6648b2006-01-04Martin Nilsson  "krl":"Karelian",
b749112008-12-28Martin Nilsson  "kro":"Kru languages",
5999532000-08-18Martin Nilsson  "kru":"Kurukh", "kum":"Kumyk", "kur":"Kurdish", "kut":"Kutenai", "lad":"Ladino", "lah":"Lahnda", "lam":"Lamba", "lao":"Lao", "lat":"Latin", "lav":"Latvian", "lez":"Lezghian",
0f432c2002-09-14Martin Nilsson  "lim":"Limburgish",
5999532000-08-18Martin Nilsson  "lin":"Lingala", "lit":"Lithuanian", "lol":"Mongo", "loz":"Lozi", "ltz":"Letzeburgesch", "lua":"Luba-Lulua", "lub":"Luba-Katanga", "lug":"Ganda", "lui":"Luiseno", "lun":"Lunda", "luo":"Luo (Kenya and Tanzania)", "lus":"lushai", "mad":"Madurese", "mag":"Magahi", "mah":"Marshall", "mai":"Maithili", "mak":"Makasar", "mal":"Malayalam", "man":"Mandingo", "map":"Austronesian (Other)", "mar":"Marathi", "mas":"Masai",
fe131a2003-07-03Martin Nilsson  "mdf":"Moksha",
5999532000-08-18Martin Nilsson  "mdr":"Mandar", "men":"Mende", "mga":"Irish, Middle (900-1200)", "mic":"Micmac", "min":"Minangkabau",
b749112008-12-28Martin Nilsson  "mis":"Uncoded languages",
5999532000-08-18Martin Nilsson  "mkd":"Macedonian", "mkh":"Mon-Khmer (Other)", "mlg":"Malagasy", "mlt":"Maltese", "mnc":"Manchu", "mni":"Manipuri", "mno":"Manobo languages", "moh":"Mohawk",
b749112008-12-28Martin Nilsson  "mol":"Moldavian", // Deprecated 2008-11-03
5999532000-08-18Martin Nilsson  "mon":"Mongolian", "mos":"Mossi", "mri":"Maori", "msa":"Malay", "mul":"Multiple languages", "mun":"Munda languages", "mus":"Creek",
9c11542005-04-03Martin Nilsson  "mwl":"Mirandese",
5999532000-08-18Martin Nilsson  "mwr":"Marwari", "mya":"Burmese", "myn":"Mayan languages",
fe131a2003-07-03Martin Nilsson  "myv":"Erzya",
b749112008-12-28Martin Nilsson  "nah":"Nahuatl languages",
5999532000-08-18Martin Nilsson  "nai":"North American Indian",
0f432c2002-09-14Martin Nilsson  "nap":"Neapolitan",
5999532000-08-18Martin Nilsson  "nau":"Nauru", "nav":"Navajo", "nbl":"Ndebele, South", "nde":"Ndebele, North", "ndo":"Ndonga", "nds":"Low German; Low Saxon", "nep":"Nepali", "new":"Newari", "nia":"Nias", "nic":"Niger-Kordofanian (Other)", "niu":"Niuean", "nld":"Dutch", "nno":"Norwegian Nynorsk", "nob":"Norwegian Bokmål", "non":"Norse, Old", "nor":"Norwegian",
9c11542005-04-03Martin Nilsson  "nso":"Northern Sotho",
5999532000-08-18Martin Nilsson  "nub":"Nubian languages",
2f99eb2006-06-09Martin Nilsson  "nqo":"N'Ko",
9c11542005-04-03Martin Nilsson  "nwc":"Classical Newari", "nya":"Chichewa",
5999532000-08-18Martin Nilsson  "nym":"Nyamwezi", "nyn":"Nyankole", "nyo":"Nyoro", "nzi":"Nzima", "oci":"Occitan (post 1500); Provençal", "oji":"Ojibwa", "ori":"Oriya", "orm":"Oromo", "osa":"Osage", "oss":"Ossetian; Ossetic", "ota":"Turkish, Ottoman (1500-1928)", "oto":"Otomian languages", "paa":"Papuan (Other)", "pag":"Pangasinan", "pal":"Pahlavi", "pam":"Pampanga", "pan":"Panjabi", "pap":"Papiamento", "pau":"Palauan", "peo":"Persian, Old (ca.600-400 B.C.)", "phi":"Philippine (Other)", "pli":"Pali", "pol":"Polish", "pon":"Pohnpeian", "por":"Portuguese", "pra":"Prakrit languages", "pro":"Provençal, Old (to 1500)", "pus":"Pushto", // qaa-qtz is Reserved for local use "que":"Quechua", "raj":"Rajasthani", "rap":"Rapanui", "rar":"Rarotongan", "roa":"Romance (Other)",
9215312007-11-11Martin Nilsson  "roh":"Romansh",
5999532000-08-18Martin Nilsson  "rom":"Romany", "ron":"Romanian", "run":"Rundi",
c6648b2006-01-04Martin Nilsson  "rup":"Aromanian",
5999532000-08-18Martin Nilsson  "rus":"Russian", "sad":"Sandawe", "sag":"Sango", "sah":"Yakut", "sai":"South American Indian (Other)", "sal":"Salishan languages", "sam":"Samaritan Aramaic", "san":"Sanskrit", "sas":"Sasak", "sat":"Santali",
9c11542005-04-03Martin Nilsson  "scn":"Sicilian",
5999532000-08-18Martin Nilsson  "sco":"Scots", "sel":"Selkup", "sem":"Semitic (Other)", "sga":"Irish, Old (to 900)", "sgn":"Sign Languages", "shn":"Shan", "sid":"Sidamo", "sin":"Sinhalese", "sio":"Siouan languages", "sit":"Sino-Tibetan (Other)",
30812d2003-01-22Martin Nilsson  "skå":"Skånska",
5999532000-08-18Martin Nilsson  "sla":"Slavic (Other)", "slk":"Slovak", "slv":"Slovenian",
0f432c2002-09-14Martin Nilsson  "sma":"Southern Sami",
5999532000-08-18Martin Nilsson  "sme":"Northern Sami", "smi":"Sami languages (Other)",
0f432c2002-09-14Martin Nilsson  "smj":"Lule Sami", "smn":"Inari Sami",
5999532000-08-18Martin Nilsson  "smo":"Samoan",
0f432c2002-09-14Martin Nilsson  "sms":"Skolt Sami",
5999532000-08-18Martin Nilsson  "sna":"Shona", "snd":"Sindhi", "snk":"Soninke", "sog":"Sogdian", "som":"Somali",
b749112008-12-28Martin Nilsson  "son":"Songhai languages",
5999532000-08-18Martin Nilsson  "sot":"Sotho, Southern", "spa":"Spanish", "sqi":"Albanian", "srd":"Sardinian",
9215312007-11-11Martin Nilsson  "srn":"Sranan Tongo",
5999532000-08-18Martin Nilsson  "srp":"Serbian", "srr":"Serer", "ssa":"Nilo-Saharan (Other)", "ssw":"Swati", "suk":"Sukuma", "sun":"Sundanese", "sus":"Susu", "sux":"Sumerian", "swa":"Swahili", "swe":"Swedish",
9215312007-11-11Martin Nilsson  "syc":"Classical Syriac",
5999532000-08-18Martin Nilsson  "syr":"Syriac", "tah":"Tahitian", "tai":"Tai (Other)", "tam":"Tamil", "tat":"Tatar", "tel":"Telugu", "tem":"Timne", "ter":"Tereno", "tet":"Tetum", "tgk":"Tajik",
c6648b2006-01-04Martin Nilsson  "tgl":"Tagalog",
5999532000-08-18Martin Nilsson  "tha":"Thai", "tig":"Tigre", "tir":"Tigrinya", "tiv":"Tiv", "tkl":"Tokelau",
9c11542005-04-03Martin Nilsson  "tlh":"Klingon",
5999532000-08-18Martin Nilsson  "tli":"Tlingit", "tmh":"Tamashek", "tog":"Tonga (Nyasa)", "ton":"Tonga (Tonga Islands)", "tpi":"Tok Pisin", "tsi":"Tsimshian", "tsn":"Tswana", "tso":"Tsonga", "tuk":"Turkmen", "tum":"Tumbuka",
0f432c2002-09-14Martin Nilsson  "tup":"Tupi",
5999532000-08-18Martin Nilsson  "tur":"Turkish", "tut":"Altaic (Other)", "tvl":"Tuvalu", "twi":"Twi", "tyv":"Tuvinian",
fe131a2003-07-03Martin Nilsson  "udm":"Udmurt",
5999532000-08-18Martin Nilsson  "uga":"Ugaritic", "uig":"Uighur", "ukr":"Ukrainian", "umb":"Umbundu", "und":"Undetermined", "urd":"Urdu", "uzb":"Uzbek", "vai":"Vai", "ven":"Venda", "vie":"Vietnamese", "vol":"Volapük", "vot":"Votic", "wak":"Wakashan languages",
b749112008-12-28Martin Nilsson  "wal":"Wolaitta",
5999532000-08-18Martin Nilsson  "war":"Waray", "was":"Washo", "wen":"Sorbian languages",
0f432c2002-09-14Martin Nilsson  "wln":"Walloon",
5999532000-08-18Martin Nilsson  "wol":"Wolof",
9c11542005-04-03Martin Nilsson  "xal":"Kalmyk",
5999532000-08-18Martin Nilsson  "xho":"Xhosa", "yao":"Yao", "yap":"Yapese", "yid":"Yiddish", "yor":"Yoruba", "ypk":"Yupik languages", "zap":"Zapotec",
9215312007-11-11Martin Nilsson  "zbl":"Bliss",
5999532000-08-18Martin Nilsson  "zen":"Zenaga",
f6d82b2014-08-06Martin Nilsson  "zgh":"Standard Moroccan Tamazight",
5999532000-08-18Martin Nilsson  "zha":"Zhuang", "zho":"Chinese",
b749112008-12-28Martin Nilsson  "znd":"Zande languages",
5999532000-08-18Martin Nilsson  "zul":"Zulu",
2f99eb2006-06-09Martin Nilsson  "zun":"Zuni", "zxx":"No linguistic content",
b749112008-12-28Martin Nilsson  "zza":"Zaza",
5999532000-08-18Martin Nilsson ]);
80aa862001-06-17Martin Nilsson // Mapping from ISO 639-2/B to ISO 639-2/T
9eaf1d2008-06-28Martin Nilsson protected constant b_to_t = ([
80aa862001-06-17Martin Nilsson  "alb":"sqi", "arm":"hye", "baq":"eus", "bur":"mya", "chi":"zho", "cze":"ces", "dut":"nld", "fre":"fra", "geo":"kat", "ger":"deu", "gre":"ell", "ice":"isl", "mac":"mkd", "mao":"mri", "may":"msa", "per":"fas", "rum":"ron",
b749112008-12-28Martin Nilsson  "scc":"srp", // Deprecated 2008-06-28 "scr":"hrv", // Deprecated 2008-06-28
80aa862001-06-17Martin Nilsson  "slo":"slk", "tib":"bod", "wel":"cym", ]); //! Look up the language name given an ISO 639-2 code //! in lower case. It will first be looked up in the //! ISO 639-2/T table and then in ISO 639-2/B if the //! first lookup failed. Returns zero typed zero on //! failure.
5999532000-08-18Martin Nilsson string get_language(string code) {
80aa862001-06-17Martin Nilsson  return languages[code] || languages[b_to_t[code]]; } //! Look up the language name given an ISO 639-2/T code //! in lower case. Returns zero typed zero on failure. string get_language_t(string code) {
5999532000-08-18Martin Nilsson  return languages[code]; }
80aa862001-06-17Martin Nilsson //! Look up the language name given an ISO 639-2/B code //! in lower case. Returns zero typed zero on failure. string get_language_b(string code) { return languages[b_to_t[code]]; } //! Return a mapping from ISO 639-2/T + ISO 639-2/B codes //! to language names.
cb15112000-12-28Henrik Grubbström (Grubba) mapping(string:string) list_languages() {
80aa862001-06-17Martin Nilsson  return languages + map(b_to_t, lambda(string in) { return languages[in]; } ); } //! Return a mapping from ISO 639-2/T codes to language //! names. mapping(string:string) list_languages_t() { return languages + ([]); } //! Return a mapping from ISO 639-2/B codes to language //! names. mapping (string:string) list_languages_b() { array symbols = values(b_to_t); return list_languages() - mkmapping( symbols, symbols ); }
41023c2002-01-17Martin Nilsson //! Converts an ISO 639-2/B code to an ISO 639-2/T code. string convert_b_to_t(string code) { string res = b_to_t[code]; if(res) return res; if(languages[code]) return code; return 0; } //! Converts an ISO 639-2/T code to an ISO 639-2/B code. string convert_t_to_b(string code) { string res = search(b_to_t, code); if(res) return res; if(languages[code]) return code; return 0; }
852bd72001-01-04Martin Nilsson // Mapping from ISO 639-1 code to ISO 639-2/T code.
9eaf1d2008-06-28Martin Nilsson protected constant conversion = ([
5999532000-08-18Martin Nilsson  "aa":"aar", "ab":"abk", "ae":"ave", "af":"afr", "am":"amh",
67eb752003-03-19Martin Nilsson  "an":"arg",
5999532000-08-18Martin Nilsson  "ar":"ara", "as":"asm", "ay":"aym", "az":"aze", "ba":"bak", "be":"bel", "bg":"bul", "bh":"bih", "bi":"bis", "bn":"ben", "bo":"bod", "br":"bre", "bs":"bos", "ca":"cat", "ce":"che", "ch":"cha", "co":"cos", "cs":"ces", "cu":"chu", "cv":"chv", "cy":"cym", "da":"dan", "de":"deu",
2f99eb2006-06-09Martin Nilsson  "dv":"div",
5999532000-08-18Martin Nilsson  "dz":"dzo", "el":"ell", "en":"eng", "eo":"epo", "es":"spa", "et":"est", "eu":"eus", "fa":"fas", "fi":"fin", "fj":"fij", "fo":"fao", "fr":"fra", "fy":"fry", "ga":"gle", "gd":"gla", "gl":"glg", "gn":"grn", "gu":"guj", "gv":"glv", "he":"heb", "hi":"hin", "ho":"hmo", "hr":"hrv", "hu":"hun", "hy":"hye", "hz":"her", "ia":"ina", "id":"ind", "ie":"ile",
67eb752003-03-19Martin Nilsson  "ii":"iii",
5999532000-08-18Martin Nilsson  "ik":"ipk",
0f432c2002-09-14Martin Nilsson  "io":"ido",
5999532000-08-18Martin Nilsson  "is":"isl", "it":"ita", "iu":"iku", "ja":"jpn",
0f432c2002-09-14Martin Nilsson  "jv":"jav",
5999532000-08-18Martin Nilsson  "ka":"kat", "ki":"kik", "kk":"kaz", "kl":"kal", "km":"khm", "kn":"kan", "ko":"kor", "ks":"kas", "ku":"kur", "kv":"kom", "kw":"cor", "ky":"kir", "la":"lat", "lb":"ltz",
0f432c2002-09-14Martin Nilsson  "li":"lim",
5999532000-08-18Martin Nilsson  "ln":"lin", "lo":"lao", "lt":"lit", "lv":"lav", "mg":"mlg", "mh":"mah", "mi":"mri", "mk":"mkd", "ml":"mal", "mn":"mon",
b749112008-12-28Martin Nilsson  "mo":"mol", // Deprecated 2008-11-03
5999532000-08-18Martin Nilsson  "mr":"mar", "ms":"msa", "mt":"mlt", "my":"mya", "na":"nau", "nb":"nob", "nd":"nde", "ne":"nep", "ng":"ndo", "nl":"nld", "nn":"nno", "no":"nor", "nr":"nbl", "nv":"nav", "ny":"nya", "oc":"oci", "om":"orm", "or":"ori", "os":"oss", "pa":"pan", "pi":"pli", "pl":"pol", "ps":"pus", "pt":"por", "qu":"que",
9215312007-11-11Martin Nilsson  "rm":"roh",
5999532000-08-18Martin Nilsson  "rn":"run", "ro":"ron", "ru":"rus", "rw":"kin", "sa":"san", "sc":"srd", "sd":"snd", "se":"sme", "sg":"sag", "si":"sin", "sk":"slk", "sl":"slv", "sm":"smo", "sn":"sna", "so":"som", "sq":"sqi", "sr":"srp", "ss":"ssw", "st":"sot", "su":"sun", "sv":"swe", "sw":"swa", "ta":"tam", "te":"tel", "tg":"tgk", "th":"tha", "tk":"tuk", "tl":"tgl", "tn":"tsn",
c6648b2006-01-04Martin Nilsson  "tr":"tur",
5999532000-08-18Martin Nilsson  "ts":"tso", "tt":"tat", "tw":"twi", "ty":"tah", "ug":"uig", "uk":"ukr", "ur":"urd", "uz":"uzb", "vi":"vie", "vo":"vol",
0f432c2002-09-14Martin Nilsson  "wa":"wln",
5999532000-08-18Martin Nilsson  "wo":"wol", "xh":"xho", "yi":"yid", "za":"zha", "zh":"zho", "zu":"zul" ]);
852bd72001-01-04Martin Nilsson //! Look up the ISO 639-2/T code given an ISO 639-1 code //! in lower case.
5999532000-08-18Martin Nilsson string map_639_1(string code) { return conversion[code]; }
bee9fb2000-09-12Per Hedbor 
41023c2002-01-17Martin Nilsson //! Look up the ISO 639-1 code given an ISO 639-2/T code //! in lower case. string map_to_639_1(string code) { return search(conversion, code); }
cb15112000-12-28Henrik Grubbström (Grubba) //! Return a mapping from ISO 639-1 code to ISO 639-2/T code. mapping(string:string) list_639_1() {
80aa862001-06-17Martin Nilsson  return conversion + ([]);
bee9fb2000-09-12Per Hedbor }