Last active
November 29, 2015 22:32
-
-
Save jackycute/59780d060dd63975273a to your computer and use it in GitHub Desktop.
Language codes (https://msdn.microsoft.com/zh-tw/library/ms533052(v=vs.85).aspx)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var langs = []; | |
$('.clsStd tr').each(function (key, value) { | |
var code, lang, country; | |
$(value).find('td').each( | |
function (index, data) { | |
if (index % 2 == 0) { | |
code = $(data).text().trim(); | |
} else if (index % 2 == 1) { | |
var string = $(data).text().split(/\(|\)/); | |
lang = string[0].trim(); | |
country = string.length > 1 ? string[1].trim() : null; | |
langs.push({ | |
code: code, | |
lang: lang, | |
country: country | |
}); | |
} | |
}); | |
}); | |
console.log(langs); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"code":"af", | |
"lang":"Afrikaans", | |
"country":null | |
}, | |
{ | |
"code":"sq", | |
"lang":"Albanian", | |
"country":null | |
}, | |
{ | |
"code":"ar-sa", | |
"lang":"Arabic", | |
"country":"Saudi Arabia" | |
}, | |
{ | |
"code":"ar-iq", | |
"lang":"Arabic", | |
"country":"Iraq" | |
}, | |
{ | |
"code":"ar-eg", | |
"lang":"Arabic", | |
"country":"Egypt" | |
}, | |
{ | |
"code":"ar-ly", | |
"lang":"Arabic", | |
"country":"Libya" | |
}, | |
{ | |
"code":"ar-dz", | |
"lang":"Arabic", | |
"country":"Algeria" | |
}, | |
{ | |
"code":"ar-ma", | |
"lang":"Arabic", | |
"country":"Morocco" | |
}, | |
{ | |
"code":"ar-tn", | |
"lang":"Arabic", | |
"country":"Tunisia" | |
}, | |
{ | |
"code":"ar-om", | |
"lang":"Arabic", | |
"country":"Oman" | |
}, | |
{ | |
"code":"ar-ye", | |
"lang":"Arabic", | |
"country":"Yemen" | |
}, | |
{ | |
"code":"ar-sy", | |
"lang":"Arabic", | |
"country":"Syria" | |
}, | |
{ | |
"code":"ar-jo", | |
"lang":"Arabic", | |
"country":"Jordan" | |
}, | |
{ | |
"code":"ar-lb", | |
"lang":"Arabic", | |
"country":"Lebanon" | |
}, | |
{ | |
"code":"ar-kw", | |
"lang":"Arabic", | |
"country":"Kuwait" | |
}, | |
{ | |
"code":"ar-ae", | |
"lang":"Arabic", | |
"country":"U.A.E." | |
}, | |
{ | |
"code":"ar-bh", | |
"lang":"Arabic", | |
"country":"Bahrain" | |
}, | |
{ | |
"code":"ar-qa", | |
"lang":"Arabic", | |
"country":"Qatar" | |
}, | |
{ | |
"code":"eu", | |
"lang":"Basque", | |
"country":"Basque" | |
}, | |
{ | |
"code":"bg", | |
"lang":"Bulgarian", | |
"country":null | |
}, | |
{ | |
"code":"be", | |
"lang":"Belarusian", | |
"country":null | |
}, | |
{ | |
"code":"ca", | |
"lang":"Catalan", | |
"country":null | |
}, | |
{ | |
"code":"zh-tw", | |
"lang":"Chinese", | |
"country":"Taiwan" | |
}, | |
{ | |
"code":"zh-cn", | |
"lang":"Chinese", | |
"country":"PRC" | |
}, | |
{ | |
"code":"zh-hk", | |
"lang":"Chinese", | |
"country":"Hong Kong SAR" | |
}, | |
{ | |
"code":"zh-sg", | |
"lang":"Chinese", | |
"country":"Singapore" | |
}, | |
{ | |
"code":"hr", | |
"lang":"Croatian", | |
"country":null | |
}, | |
{ | |
"code":"cs", | |
"lang":"Czech", | |
"country":null | |
}, | |
{ | |
"code":"da", | |
"lang":"Danish", | |
"country":null | |
}, | |
{ | |
"code":"nl", | |
"lang":"Dutch", | |
"country":"Standard" | |
}, | |
{ | |
"code":"nl-be", | |
"lang":"Dutch", | |
"country":"Belgium" | |
}, | |
{ | |
"code":"en", | |
"lang":"English", | |
"country":null | |
}, | |
{ | |
"code":"en-us", | |
"lang":"English", | |
"country":"United States" | |
}, | |
{ | |
"code":"en-gb", | |
"lang":"English", | |
"country":"United Kingdom" | |
}, | |
{ | |
"code":"en-au", | |
"lang":"English", | |
"country":"Australia" | |
}, | |
{ | |
"code":"en-ca", | |
"lang":"English", | |
"country":"Canada" | |
}, | |
{ | |
"code":"en-nz", | |
"lang":"English", | |
"country":"New Zealand" | |
}, | |
{ | |
"code":"en-ie", | |
"lang":"English", | |
"country":"Ireland" | |
}, | |
{ | |
"code":"en-za", | |
"lang":"English", | |
"country":"South Africa" | |
}, | |
{ | |
"code":"en-jm", | |
"lang":"English", | |
"country":"Jamaica" | |
}, | |
{ | |
"code":"en", | |
"lang":"English", | |
"country":"Caribbean" | |
}, | |
{ | |
"code":"en-bz", | |
"lang":"English", | |
"country":"Belize" | |
}, | |
{ | |
"code":"en-tt", | |
"lang":"English", | |
"country":"Trinidad" | |
}, | |
{ | |
"code":"et", | |
"lang":"Estonian", | |
"country":null | |
}, | |
{ | |
"code":"fo", | |
"lang":"Faeroese", | |
"country":null | |
}, | |
{ | |
"code":"fa", | |
"lang":"Farsi", | |
"country":null | |
}, | |
{ | |
"code":"fi", | |
"lang":"Finnish", | |
"country":null | |
}, | |
{ | |
"code":"fr", | |
"lang":"French", | |
"country":"Standard" | |
}, | |
{ | |
"code":"fr-be", | |
"lang":"French", | |
"country":"Belgium" | |
}, | |
{ | |
"code":"fr-ca", | |
"lang":"French", | |
"country":"Canada" | |
}, | |
{ | |
"code":"fr-ch", | |
"lang":"French", | |
"country":"Switzerland" | |
}, | |
{ | |
"code":"fr-lu", | |
"lang":"French", | |
"country":"Luxembourg" | |
}, | |
{ | |
"code":"gd", | |
"lang":"Gaelic", | |
"country":"Scotland" | |
}, | |
{ | |
"code":"ga", | |
"lang":"Irish", | |
"country":null | |
}, | |
{ | |
"code":"de", | |
"lang":"German", | |
"country":"Standard" | |
}, | |
{ | |
"code":"de-ch", | |
"lang":"German", | |
"country":"Switzerland" | |
}, | |
{ | |
"code":"de-at", | |
"lang":"German", | |
"country":"Austria" | |
}, | |
{ | |
"code":"de-lu", | |
"lang":"German", | |
"country":"Luxembourg" | |
}, | |
{ | |
"code":"de-li", | |
"lang":"German", | |
"country":"Liechtenstein" | |
}, | |
{ | |
"code":"el", | |
"lang":"Greek", | |
"country":null | |
}, | |
{ | |
"code":"he", | |
"lang":"Hebrew", | |
"country":null | |
}, | |
{ | |
"code":"hi", | |
"lang":"Hindi", | |
"country":null | |
}, | |
{ | |
"code":"hu", | |
"lang":"Hungarian", | |
"country":null | |
}, | |
{ | |
"code":"is", | |
"lang":"Icelandic", | |
"country":null | |
}, | |
{ | |
"code":"id", | |
"lang":"Indonesian", | |
"country":null | |
}, | |
{ | |
"code":"it", | |
"lang":"Italian", | |
"country":"Standard" | |
}, | |
{ | |
"code":"it-ch", | |
"lang":"Italian", | |
"country":"Switzerland" | |
}, | |
{ | |
"code":"ja", | |
"lang":"Japanese", | |
"country":null | |
}, | |
{ | |
"code":"ko", | |
"lang":"Korean", | |
"country":null | |
}, | |
{ | |
"code":"ko", | |
"lang":"Korean", | |
"country":"Johab" | |
}, | |
{ | |
"code":"lv", | |
"lang":"Latvian", | |
"country":null | |
}, | |
{ | |
"code":"lt", | |
"lang":"Lithuanian", | |
"country":null | |
}, | |
{ | |
"code":"mk", | |
"lang":"Macedonian", | |
"country":"FYROM" | |
}, | |
{ | |
"code":"ms", | |
"lang":"Malaysian", | |
"country":null | |
}, | |
{ | |
"code":"mt", | |
"lang":"Maltese", | |
"country":null | |
}, | |
{ | |
"code":"no", | |
"lang":"Norwegian", | |
"country":"Bokmal" | |
}, | |
{ | |
"code":"no", | |
"lang":"Norwegian", | |
"country":"Nynorsk" | |
}, | |
{ | |
"code":"pl", | |
"lang":"Polish", | |
"country":null | |
}, | |
{ | |
"code":"pt-br", | |
"lang":"Portuguese", | |
"country":"Brazil" | |
}, | |
{ | |
"code":"pt", | |
"lang":"Portuguese", | |
"country":"Portugal" | |
}, | |
{ | |
"code":"rm", | |
"lang":"Rhaeto-Romanic", | |
"country":null | |
}, | |
{ | |
"code":"ro", | |
"lang":"Romanian", | |
"country":null | |
}, | |
{ | |
"code":"ro-mo", | |
"lang":"Romanian", | |
"country":"Republic of Moldova" | |
}, | |
{ | |
"code":"ru", | |
"lang":"Russian", | |
"country":null | |
}, | |
{ | |
"code":"ru-mo", | |
"lang":"Russian", | |
"country":"Republic of Moldova" | |
}, | |
{ | |
"code":"sz", | |
"lang":"Sami", | |
"country":"Lappish" | |
}, | |
{ | |
"code":"sr", | |
"lang":"Serbian", | |
"country":"Cyrillic" | |
}, | |
{ | |
"code":"sr", | |
"lang":"Serbian", | |
"country":"Latin" | |
}, | |
{ | |
"code":"sk", | |
"lang":"Slovak", | |
"country":null | |
}, | |
{ | |
"code":"sl", | |
"lang":"Slovenian", | |
"country":null | |
}, | |
{ | |
"code":"sb", | |
"lang":"Sorbian", | |
"country":null | |
}, | |
{ | |
"code":"es", | |
"lang":"Spanish", | |
"country":"Spain" | |
}, | |
{ | |
"code":"es-mx", | |
"lang":"Spanish", | |
"country":"Mexico" | |
}, | |
{ | |
"code":"es-gt", | |
"lang":"Spanish", | |
"country":"Guatemala" | |
}, | |
{ | |
"code":"es-cr", | |
"lang":"Spanish", | |
"country":"Costa Rica" | |
}, | |
{ | |
"code":"es-pa", | |
"lang":"Spanish", | |
"country":"Panama" | |
}, | |
{ | |
"code":"es-do", | |
"lang":"Spanish", | |
"country":"Dominican Republic" | |
}, | |
{ | |
"code":"es-ve", | |
"lang":"Spanish", | |
"country":"Venezuela" | |
}, | |
{ | |
"code":"es-co", | |
"lang":"Spanish", | |
"country":"Colombia" | |
}, | |
{ | |
"code":"es-pe", | |
"lang":"Spanish", | |
"country":"Peru" | |
}, | |
{ | |
"code":"es-ar", | |
"lang":"Spanish", | |
"country":"Argentina" | |
}, | |
{ | |
"code":"es-ec", | |
"lang":"Spanish", | |
"country":"Ecuador" | |
}, | |
{ | |
"code":"es-cl", | |
"lang":"Spanish", | |
"country":"Chile" | |
}, | |
{ | |
"code":"es-uy", | |
"lang":"Spanish", | |
"country":"Uruguay" | |
}, | |
{ | |
"code":"es-py", | |
"lang":"Spanish", | |
"country":"Paraguay" | |
}, | |
{ | |
"code":"es-bo", | |
"lang":"Spanish", | |
"country":"Bolivia" | |
}, | |
{ | |
"code":"es-sv", | |
"lang":"Spanish", | |
"country":"El Salvador" | |
}, | |
{ | |
"code":"es-hn", | |
"lang":"Spanish", | |
"country":"Honduras" | |
}, | |
{ | |
"code":"es-ni", | |
"lang":"Spanish", | |
"country":"Nicaragua" | |
}, | |
{ | |
"code":"es-pr", | |
"lang":"Spanish", | |
"country":"Puerto Rico" | |
}, | |
{ | |
"code":"sx", | |
"lang":"Sutu", | |
"country":null | |
}, | |
{ | |
"code":"sv", | |
"lang":"Swedish", | |
"country":null | |
}, | |
{ | |
"code":"sv-fi", | |
"lang":"Swedish", | |
"country":"Finland" | |
}, | |
{ | |
"code":"th", | |
"lang":"Thai", | |
"country":null | |
}, | |
{ | |
"code":"ts", | |
"lang":"Tsonga", | |
"country":null | |
}, | |
{ | |
"code":"tn", | |
"lang":"Tswana", | |
"country":null | |
}, | |
{ | |
"code":"tr", | |
"lang":"Turkish", | |
"country":null | |
}, | |
{ | |
"code":"uk", | |
"lang":"Ukrainian", | |
"country":null | |
}, | |
{ | |
"code":"ur", | |
"lang":"Urdu", | |
"country":null | |
}, | |
{ | |
"code":"ve", | |
"lang":"Venda", | |
"country":null | |
}, | |
{ | |
"code":"vi", | |
"lang":"Vietnamese", | |
"country":null | |
}, | |
{ | |
"code":"xh", | |
"lang":"Xhosa", | |
"country":null | |
}, | |
{ | |
"code":"ji", | |
"lang":"Yiddish", | |
"country":null | |
}, | |
{ | |
"code":"zu", | |
"lang":"Zulu", | |
"country":null | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment