更好的方法在这里。
这是来自微软的所有语言代码列表。链接。如果您想要,这里有一个脚本可以用来解析其中的所有值:
function getLanguages() {
const rows = document.querySelectorAll("tr");
const res = {};
let i = 0;
for (const row of rows) {
try {
let [ int_code, desc, bcp_47_code ] = row.querySelectorAll("td>p");
int_code = parseInt(int_code.textContent.trim());
if (isNaN(int_code)) {
throw new Error("int code is NaN");
}
desc = desc.textContent.trim();
bcp_47_code = bcp_47_code.textContent.trim();
const obj = { int_code, desc, bcp_47_code };
res[int_code] = obj;
} catch (err) {
console.error(`ROW #${i} ERROR:`, err);
} finally {
i++;
}
}
return res;
}
只需将其粘贴到您的开发工具控制台中并调用该函数。我还将以JSON格式提供执行结果,方便读者查看:
{
"1025": {
"int_code": 1025,
"desc": "Arabic - Saudi Arabia",
"bcp_47_code": "ar-SA"
},
"1026": {
"int_code": 1026,
"desc": "Bulgarian",
"bcp_47_code": "bg-BG"
},
"1027": {
"int_code": 1027,
"desc": "Catalan",
"bcp_47_code": "ca-ES"
},
"1028": {
"int_code": 1028,
"desc": "Chinese - Taiwan",
"bcp_47_code": "zh-TW"
},
"1029": {
"int_code": 1029,
"desc": "Czech",
"bcp_47_code": "cs-CZ"
},
"1030": {
"int_code": 1030,
"desc": "Danish",
"bcp_47_code": "da-DK"
},
"1031": {
"int_code": 1031,
"desc": "German - Germany",
"bcp_47_code": "de-DE"
},
"1032": {
"int_code": 1032,
"desc": "Greek",
"bcp_47_code": "el-GR"
},
"1033": {
"int_code": 1033,
"desc": "English - United States",
"bcp_47_code": "en-US"
},
"1034": {
"int_code": 1034,
"desc": "Spanish - Spain (Traditional Sort)",
"bcp_47_code": "es-ES"
},
"1035": {
"int_code": 1035,
"desc": "Finnish",
"bcp_47_code": "fi-FI"
},
"1036": {
"int_code": 1036,
"desc": "French - France",
"bcp_47_code": "fr-FR"
},
"1037": {
"int_code": 1037,
"desc": "Hebrew",
"bcp_47_code": "he-IL"
},
"1038": {
"int_code": 1038,
"desc": "Hungarian",
"bcp_47_code": "hu-HU"
},
"1039": {
"int_code": 1039,
"desc": "Icelandic",
"bcp_47_code": "is-IS"
},
"1040": {
"int_code": 1040,
"desc": "Italian - Italy",
"bcp_47_code": "it-IT"
},
"1041": {
"int_code": 1041,
"desc": "Japanese",
"bcp_47_code": "ja-JP"
},
"1042": {
"int_code": 1042,
"desc": "Korean",
"bcp_47_code": "ko-KR"
},
"1043": {
"int_code": 1043,
"desc": "Dutch - Netherlands",
"bcp_47_code": "nl-NL"
},
"1044": {
"int_code": 1044,
"desc": "Norwegian (Bokmål)",
"bcp_47_code": "nb-NO"
},
"1045": {
"int_code": 1045,
"desc": "Polish",
"bcp_47_code": "pl-PL"
},
"1046": {
"int_code": 1046,
"desc": "Portuguese - Brazil",
"bcp_47_code": "pt-BR"
},
"1047": {
"int_code": 1047,
"desc": "Rhaeto-Romanic",
"bcp_47_code": "rm-CH"
},
"1048": {
"int_code": 1048,
"desc": "Romanian",
"bcp_47_code": "ro-RO"
},
"1049": {
"int_code": 1049,
"desc": "Russian",
"bcp_47_code": "ru-RU"
},
"1050": {
"int_code": 1050,
"desc": "Croatian",
"bcp_47_code": "hr-HR"
},
"1051": {
"int_code": 1051,
"desc": "Slovak",
"bcp_47_code": "sk-SK"
},
"1052": {
"int_code": 1052,
"desc": "Albanian - Albania",
"bcp_47_code": "sq-AL"
},
"1053": {
"int_code": 1053,
"desc": "Swedish",
"bcp_47_code": "sv-SE"
},
"1054": {
"int_code": 1054,
"desc": "Thai",
"bcp_47_code": "th-TH"
},
"1055": {
"int_code": 1055,
"desc": "Turkish",
"bcp_47_code": "tr-TR"
},
"1056": {
"int_code": 1056,
"desc": "Urdu - Pakistan",
"bcp_47_code": "ur-PK"
},
"1057": {
"int_code": 1057,
"desc": "Indonesian",
"bcp_47_code": "id-ID"
},
"1058": {
"int_code": 1058,
"desc": "Ukrainian",
"bcp_47_code": "uk-UA"
},
"1059": {
"int_code": 1059,
"desc": "Belarusian",
"bcp_47_code": "be-BY"
},
"1060": {
"int_code": 1060,
"desc": "Slovenian",
"bcp_47_code": "sl-SI"
},
"1061": {
"int_code": 1061,
"desc": "Estonian",
"bcp_47_code": "et-EE"
},
"1062": {
"int_code": 1062,
"desc": "Latvian",
"bcp_47_code": "lv-LV"
},
"1063": {
"int_code": 1063,
"desc": "Lithuanian",
"bcp_47_code": "lt-LT"
},
"1064": {
"int_code": 1064,
"desc": "Tajik",
"bcp_47_code": "tg-Cyrl-TJ"
},
"1065": {
"int_code": 1065,
"desc": "Persian",
"bcp_47_code": "fa-IR"
},
"1066": {
"int_code": 1066,
"desc": "Vietnamese",
"bcp_47_code": "vi-VN"
},
"1067": {
"int_code": 1067,
"desc": "Armenian - Armenia",
"bcp_47_code": "hy-AM"
},
"1068": {
"int_code": 1068,
"desc": "Azeri (Latin)",
"bcp_47_code": "az-Latn-AZ"
},
"1069": {
"int_code": 1069,
"desc": "Basque",
"bcp_47_code": "eu-ES"
},
"1070": {
"int_code": 1070,
"desc": "Sorbian",
"bcp_47_code": "wen-DE"
},
"1071": {
"int_code": 1071,
"desc": "F.Y.R.O. Macedonian",
"bcp_47_code": "mk-MK"
},
"1072": {
"int_code": 1072,
"desc": "Sutu",
"bcp_47_code": "st-ZA"
},
"1073": {
"int_code": 1073,
"desc": "Tsonga",
"bcp_47_code": "ts-ZA"
},
"1074": {
"int_code": 1074,
"desc": "Tswana",
"bcp_47_code": "tn-ZA"
},
"1075": {
"int_code": 1075,
"desc": "Venda",
"bcp_47_code": "ven-ZA"
},
"1076": {
"int_code": 1076,
"desc": "Xhosa",
"bcp_47_code": "xh-ZA"
},
"1077": {
"int_code": 1077,
"desc": "Zulu",
"bcp_47_code": "zu-ZA"
},
"1078": {
"int_code": 1078,
"desc": "Afrikaans - South Africa",
"bcp_47_code": "af-ZA"
},
"1079": {
"int_code": 1079,
"desc": "Georgian",
"bcp_47_code": "ka-GE"
},
"1080": {
"int_code": 1080,
"desc": "Faroese",
"bcp_47_code": "fo-FO"
},
"1081": {
"int_code": 1081,
"desc": "Hindi",
"bcp_47_code": "hi-IN"
},
"1082": {
"int_code": 1082,
"desc": "Maltese",
"bcp_47_code": "mt-MT"
},
"1083": {
"int_code": 1083,
"desc": "Sami",
"bcp_47_code": "se-NO"
},
"1084": {
"int_code": 1084,
"desc": "Gaelic (Scotland)",
"bcp_47_code": "gd-GB"
},
"1085": {
"int_code": 1085,
"desc": "Yiddish",
"bcp_47_code": "yi"
},
"1086": {
"int_code": 1086,
"desc": "Malay - Malaysia",
"bcp_47_code": "ms-MY"
},
"1087": {
"int_code": 1087,
"desc": "Kazakh",
"bcp_47_code": "kk-KZ"
},
"1088": {
"int_code": 1088,
"desc": "Kyrgyz (Cyrillic)",
"bcp_47_code": "ky-KG"
},
"1089": {
"int_code": 1089,
"desc": "Swahili",
"bcp_47_code": "sw-KE"
},
"1090": {
"int_code": 1090,
"desc": "Turkmen",
"bcp_47_code": "tk-TM"
},
"1091": {
"int_code": 1091,
"desc": "Uzbek (Latin)",
"bcp_47_code": "uz-Latn-UZ"
},
"1092": {
"int_code": 1092,
"desc": "Tatar",
"bcp_47_code": "tt-RU"
},
"1093": {
"int_code": 1093,
"desc": "Bengali (India)",
"bcp_47_code": "bn-IN"
},
"1094": {
"int_code": 1094,
"desc": "Punjabi",
"bcp_47_code": "pa-IN"
},
"1095": {
"int_code": 1095,
"desc": "Gujarati",
"bcp_47_code": "gu-IN"
},
"1096": {
"int_code": 1096,
"desc": "Oriya",
"bcp_47_code": "or-IN"
},
"1097": {
"int_code": 1097,
"desc": "Tamil",
"bcp_47_code": "ta-IN"
},
"1098": {
"int_code": 1098,
"desc": "Telugu",
"bcp_47_code": "te-IN"
},
"1099": {
"int_code": 1099,
"desc": "Kannada",
"bcp_47_code": "kn-IN"
},
"1100": {
"int_code": 1100,
"desc": "Malayalam",
"bcp_47_code": "ml-IN"
},
"1101": {
"int_code": 1101,
"desc": "Assamese",
"bcp_47_code": "as-IN"
},
"1102": {
"int_code": 1102,
"desc": "Marathi",
"bcp_47_code": "mr-IN"
},
"1103": {
"int_code": 1103,
"desc": "Sanskrit",
"bcp_47_code": "sa-IN"
},
"1104": {
"int_code": 1104,
"desc": "Mongolian (Cyrillic)",
"bcp_47_code": "mn-MN"
},
"1105": {
"int_code": 1105,
"desc": "Tibetan - People's Republic of China",
"bcp_47_code": "bo-CN"
},
"1106": {
"int_code": 1106,
"desc": "Welsh",
"bcp_47_code": "cy-GB"
},
"1107": {
"int_code": 1107,
"desc": "Khmer",
"bcp_47_code": "km-KH"
},
"1108": {
"int_code": 1108,
"desc": "Lao",
"bcp_47_code": "lo-LA"
},
"1109": {
"int_code": 1109,
"desc": "Burmese",
"bcp_47_code": "my-MM"
},
"1110": {
"int_code": 1110,
"desc": "Galician",
"bcp_47_code": "gl-ES"
},
"1111": {
"int_code": 1111,
"desc": "Konkani",
"bcp_47_code": "kok-IN"
},
"1112": {
"int_code": 1112,
"desc": "Manipuri",
"bcp_47_code": "mni"
},
"1113": {
"int_code": 1113,
"desc": "Sindhi - India",
"bcp_47_code": "sd-IN"
},
"1114": {
"int_code": 1114,
"desc": "Syriac",
"bcp_47_code": "syr-SY"
},
"1115": {
"int_code": 1115,
"desc": "Sinhalese - Sri Lanka",
"bcp_47_code": "si-LK"
},
"1116": {
"int_code": 1116,
"desc": "Cherokee - United States",
"bcp_47_code": "chr-US"
},
"1117": {
"int_code": 1117,
"desc": "Inuktitut",
"bcp_47_code": "iu-Cans-CA"
},
"1118": {
"int_code": 1118,
"desc": "Amharic - Ethiopia",
"bcp_47_code": "am-ET"
},
"1119": {
"int_code": 1119,
"desc": "Tamazight (Arabic)",
"bcp_47_code": "tmz"
},
"1120": {
"int_code": 1120,
"desc": "Kashmiri (Arabic)",
"bcp_47_code": "ks-Arab-IN"
},
"1121": {
"int_code": 1121,
"desc": "Nepali",
"bcp_47_code": "ne-NP"
},
"1122": {
"int_code": 1122,
"desc": "Frisian - Netherlands",
"bcp_47_code": "fy-NL"
},
"1123": {
"int_code": 1123,
"desc": "Pashto",
"bcp_47_code": "ps-AF"
},
"1124": {
"int_code": 1124,
"desc": "Filipino",
"bcp_47_code": "fil-PH"
},
"1125": {
"int_code": 1125,
"desc": "Divehi",
"bcp_47_code": "dv-MV"
},
"1126": {
"int_code": 1126,
"desc": "Edo",
"bcp_47_code": "bin-NG"
},
"1127": {
"int_code": 1127,
"desc": "Fulfulde - Nigeria",
"bcp_47_code": "fuv-NG"
},
"1128": {
"int_code": 1128,
"desc": "Hausa - Nigeria",
"bcp_47_code": "ha-Latn-NG"
},
"1129": {
"int_code": 1129,
"desc": "Ibibio - Nigeria",
"bcp_47_code": "ibb-NG"
},
"1130": {
"int_code": 1130,
"desc": "Yoruba",
"bcp_47_code": "yo-NG"
},
"1131": {
"int_code": 1131,
"desc": "Quecha - Bolivia",
"bcp_47_code": "quz-BO"
},
"1132": {
"int_code": 1132,
"desc": "Sepedi",
"bcp_47_code": "nso-ZA"
},
"1136": {
"int_code": 1136,
"desc": "Igbo - Nigeria",
"bcp_47_code": "ig-NG"
},
"1137": {
"int_code": 1137,
"desc": "Kanuri - Nigeria",
"bcp_47_code": "kr-NG"
},
"1138": {
"int_code": 1138,
"desc": "Oromo",
"bcp_47_code": "gaz-ET"
},
"1139": {
"int_code": 1139,
"desc": "Tigrigna - Ethiopia",
"bcp_47_code": "ti-ER"
},
"1140": {
"int_code": 1140,
"desc": "Guarani - Paraguay",
"bcp_47_code": "gn-PY"
},
"1141": {
"int_code": 1141,
"desc": "Hawaiian - United States",
"bcp_47_code": "haw-US"
},
"1142": {
"int_code": 1142,
"desc": "Latin",
"bcp_47_code": "la"
},
"1143": {
"int_code": 1143,
"desc": "Somali",
"bcp_47_code": "so-SO"
},
"1144": {
"int_code": 1144,
"desc": "Yi",
"bcp_47_code": "ii-CN"
},
"1145": {
"int_code": 1145,
"desc": "Papiamentu",
"bcp_47_code": "pap-AN"
},
"1152": {
"int_code": 1152,
"desc": "Uighur - China",
"bcp_47_code": "ug-Arab-CN"
},
"1153": {
"int_code": 1153,
"desc": "Maori - New Zealand",
"bcp_47_code": "mi-NZ"
},
"2049": {
"int_code": 2049,
"desc": "Arabic - Iraq",
"bcp_47_code": "ar-IQ"
},
"2052": {
"int_code": 2052,
"desc": "Chinese - People's Republic of China",
"bcp_47_code": "zh-CN"
},
"2055": {
"int_code": 2055,
"desc": "German - Switzerland",
"bcp_47_code": "de-CH"
},
"2057": {
"int_code": 2057,
"desc": "English - United Kingdom",
"bcp_47_code": "en-GB"
},
"2058": {
"int_code": 2058,
"desc": "Spanish - Mexico",
"bcp_47_code": "es-MX"
},
"2060": {
"int_code": 2060,
"desc": "French - Belgium",
"bcp_47_code": "fr-BE"
},
"2064": {
"int_code": 2064,
"desc": "Italian - Switzerland",
"bcp_47_code": "it-CH"
},
"2067": {
"int_code": 2067,
"desc": "Dutch - Belgium",
"bcp_47_code": "nl-BE"
},
"2068": {
"int_code": 2068,
"desc": "Norwegian (Nynorsk)",
"bcp_47_code": "nn-NO"
},
"2070": {
"int_code": 2070,
"desc": "Portuguese - Portugal",
"bcp_47_code": "pt-PT"
},
"2072": {
"int_code": 2072,
"desc": "Romanian - Moldava",
"bcp_47_code": "ro-MD"
},
"2073": {
"int_code": 2073,
"desc": "Russian - Moldava",
"bcp_47_code": "ru-MD"
},
"2074": {
"int_code": 2074,
"desc": "Serbian (Latin)",
"bcp_47_code": "sr-Latn-CS"
},
"2077": {
"int_code": 2077,
"desc": "Swedish - Finland",
"bcp_47_code": "sv-FI"
},
"2080": {
"int_code": 2080,
"desc": "Urdu - India",
"bcp_47_code": "ur-IN"
},
"2092": {
"int_code": 2092,
"desc": "Azeri (Cyrillic)",
"bcp_47_code": "az-Cyrl-AZ"
},
"2108": {
"int_code": 2108,
"desc": "Gaelic (Ireland)",
"bcp_47_code": "ga-IE"
},
"2110": {
"int_code": 2110,
"desc": "Malay - Brunei Darussalam",
"bcp_47_code": "ms-BN"
},
"2115": {
"int_code": 2115,
"desc": "Uzbek (Cyrillic)",
"bcp_47_code": "uz-Cyrl-UZ"
},
"2117": {
"int_code": 2117,
"desc": "Bengali (Bangladesh)",
"bcp_47_code": "bn-BD"
},
"2118": {
"int_code": 2118,
"desc": "Punjabi (Pakistan)",
"bcp_47_code": "pa-PK"
},
"2128": {
"int_code": 2128,
"desc": "Mongolian (Mongolian)",
"bcp_47_code": "mn-Mong-CN"
},
"2129": {
"int_code": 2129,
"desc": "Tibetan - Bhutan",
"bcp_47_code": "bo-BT"
},
"2137": {
"int_code": 2137,
"desc": "Sindhi - Pakistan",
"bcp_47_code": "sd-PK"
},
"2143": {
"int_code": 2143,
"desc": "Tamazight (Latin)",
"bcp_47_code": "tzm-Latn-DZ"
},
"2144": {
"int_code": 2144,
"desc": "Kashmiri (Devanagari)",
"bcp_47_code": "ks-Deva-IN"
},
"2145": {
"int_code": 2145,
"desc": "Nepali - India",
"bcp_47_code": "ne-IN"
},
"2155": {
"int_code": 2155,
"desc": "Quecha - Ecuador",
"bcp_47_code": "quz-EC"
},
"2163": {
"int_code": 2163,
"desc": "Tigrigna - Eritrea",
"bcp_47_code": "ti-ET"
},
"3073": {
"int_code": 3073,
"desc": "Arabic - Egypt",
"bcp_47_code": "ar-EG"
},
"3076": {
"int_code": 3076,
"desc": "Chinese - Hong Kong SAR",
"bcp_47_code": "zh-HK"
},
"3079": {
"int_code": 3079,
"desc": "German - Austria",
"bcp_47_code": "de-AT"
},
"3081": {
"int_code": 3081,
"desc": "English - Australia",
"bcp_47_code": "en-AU"
},
"3082": {
"int_code": 3082,
"desc": "Spanish - Spain (Modern Sort)",
"bcp_47_code": "es-ES"
},
"3084": {
"int_code": 3084,
"desc": "French - Canada",
"bcp_47_code": "fr-CA"
},
"3098": {
"int_code": 3098,
"desc": "Serbian (Cyrillic)",
"bcp_47_code": "sr-Cyrl-CS"
},
"3179": {
"int_code": 3179,
"desc": "Quecha - Peru",
"bcp_47_code": "quz-PE"
},
"4097": {
"int_code": 4097,
"desc": "Arabic - Libya",
"bcp_47_code": "ar-LY"
},
"4100": {
"int_code": 4100,
"desc": "Chinese - Singapore",
"bcp_47_code": "zh-SG"
},
"4103": {
"int_code": 4103,
"desc": "German - Luxembourg",
"bcp_47_code": "de-LU"
},
"4105": {
"int_code": 4105,
"desc": "English - Canada",
"bcp_47_code": "en-CA"
},
"4106": {
"int_code": 4106,
"desc": "Spanish - Guatemala",
"bcp_47_code": "es-GT"
},
"4108": {
"int_code": 4108,
"desc": "French - Switzerland",
"bcp_47_code": "fr-CH"
},
"4122": {
"int_code": 4122,
"desc": "Croatian (Bosnia/Herzegovina)",
"bcp_47_code": "hr-BA"
},
"5121": {
"int_code": 5121,
"desc": "Arabic - Algeria",
"bcp_47_code": "ar-DZ"
},
"5124": {
"int_code": 5124,
"desc": "Chinese - Macao SAR",
"bcp_47_code": "zh-MO"
},
"5127": {
"int_code": 5127,
"desc": "German - Liechtenstein",
"bcp_47_code": "de-LI"
},
"5129": {
"int_code": 5129,
"desc": "English - New Zealand",
"bcp_47_code": "en-NZ"
},
"5130": {
"int_code": 5130,
"desc": "Spanish - Costa Rica",
"bcp_47_code": "es-CR"
},
"5132": {
"int_code": 5132,
"desc": "French - Luxembourg",
"bcp_47_code": "fr-LU"
},
"5146": {
"int_code": 5146,
"desc": "Bosnian (Bosnia/Herzegovina)",
"bcp_47_code": "bs-Latn-BA"
},
"6145": {
"int_code": 6145,
"desc": "Arabic - Morocco",
"bcp_47_code": "ar-MO"
},
"6153": {
"int_code": 6153,
"desc": "English - Ireland",
"bcp_47_code": "en-IE"
},
"6154": {
"int_code": 6154,
"desc": "Spanish - Panama",
"bcp_47_code": "es-PA"
},
"6156": {
"int_code": 6156,
"desc": "French - Monaco",
"bcp_47_code": "fr-MC"
},
"7169": {
"int_code": 7169,
"desc": "Arabic - Tunisia",
"bcp_47_code": "ar-TN"
},
"7177": {
"int_code": 7177,
"desc": "English - South Africa",
"bcp_47_code": "en-ZA"
},
"7178": {
"int_code": 7178,
"desc": "Spanish - Dominican Republic",
"bcp_47_code": "es-DO"
},
"7180": {
"int_code": 7180,
"desc": "French - West Indies",
"bcp_47_code": "fr-029"
},
"8193": {
"int_code": 8193,
"desc": "Arabic - Oman",
"bcp_47_code": "ar-OM"
},
"8201": {
"int_code": 8201,
"desc": "English - Jamaica",
"bcp_47_code": "en-JM"
},
"8202": {
"int_code": 8202,
"desc": "Spanish - Venezuela",
"bcp_47_code": "es-VE"
},
"8204": {
"int_code": 8204,
"desc": "French - Reunion",
"bcp_47_code": "fr-RE"
},
"9217": {
"int_code": 9217,
"desc": "Arabic - Yemen",
"bcp_47_code": "ar-YE"
},
"9225": {
"int_code": 9225,
"desc": "English - Caribbean",
"bcp_47_code": "en-029"
},
"9226": {
"int_code": 9226,
"desc": "Spanish - Colombia",
"bcp_47_code": "es-CO"
},
"9228": {
"int_code": 9228,
"desc": "French - Democratic Rep. of Congo",
"bcp_47_code": "fr-CG"
},
"10241": {
"int_code": 10241,
"desc": "Arabic - Syria",
"bcp_47_code": "ar-SY"
},
"10249": {
"int_code": 10249,
"desc": "English - Belize",
"bcp_47_code": "en-BZ"
},
"10250": {
"int_code": 10250,
"desc": "Spanish - Peru",
"bcp_47_code": "es-PE"
},
"10252": {
"int_code": 10252,
"desc": "French - Senegal",
"bcp_47_code": "fr-SN"
},
"11265": {
"int_code": 11265,
"desc": "Arabic - Jordan",
"bcp_47_code": "ar-JO"
},
"11273": {
"int_code": 11273,
"desc": "English - Trinidad",
"bcp_47_code": "en-TT"
},
"11274": {
"int_code": 11274,
"desc": "Spanish - Argentina",
"bcp_47_code": "es-AR"
},
"11276": {
"int_code": 11276,
"desc": "French - Cameroon",
"bcp_47_code": "fr-CM"
},
"12289": {
"int_code": 12289,
"desc": "Arabic - Lebanon",
"bcp_47_code": "ar-LB"
},
"12297": {
"int_code": 12297,
"desc": "English - Zimbabwe",
"bcp_47_code": "en-ZW"
},
"12298": {
"int_code": 12298,
"desc": "Spanish - Ecuador",
"bcp_47_code": "es-EC"
},
"12300": {
"int_code": 12300,
"desc": "French - Cote d'Ivoire",
"bcp_47_code": "fr-CI"
},
"13313": {
"int_code": 13313,
"desc": "Arabic - Kuwait",
"bcp_47_code": "ar-KW"
},
"13321": {
"int_code": 13321,
"desc": "English - Philippines",
"bcp_47_code": "en-PH"
},
"13322": {
"int_code": 13322,
"desc": "Spanish - Chile",
"bcp_47_code": "es-CL"
},
"13324": {
"int_code": 13324,
"desc": "French - Mali",
"bcp_47_code": "fr-ML"
},
"14337": {
"int_code": 14337,
"desc": "Arabic - U.A.E.",
"bcp_47_code": "ar-AE"
},
"14345": {
"int_code": 14345,
"desc": "English - Indonesia",
"bcp_47_code": "en-ID"
},
"14346": {
"int_code": 14346,
"desc": "Spanish - Uruguay",
"bcp_47_code": "es-UY"
},
"14348": {
"int_code": 14348,
"desc": "French - Morocco",
"bcp_47_code": "fr-MA"
},
"15361": {
"int_code": 15361,
"desc": "Arabic - Bahrain",
"bcp_47_code": "ar-BH"
},
"15369": {
"int_code": 15369,
"desc": "English - Hong Kong SAR",
"bcp_47_code": "en-HK"
},
"15370": {
"int_code": 15370,
"desc": "Spanish - Paraguay",
"bcp_47_code": "es-PY"
},
"15372": {
"int_code": 15372,
"desc": "French - Haiti",
"bcp_47_code": "fr-HT"
},
"16385": {
"int_code": 16385,
"desc": "Arabic - Qatar",
"bcp_47_code": "ar-QA"
},
"16393": {
"int_code": 16393,
"desc": "English - India",
"bcp_47_code": "en-IN"
},
"16394": {
"int_code": 16394,
"desc": "Spanish - Bolivia",
"bcp_47_code": "es-BO"
},
"17417": {
"int_code": 17417,
"desc": "English - Malaysia",
"bcp_47_code": "en-MY"
},
"17418": {
"int_code": 17418,
"desc": "Spanish - El Salvador",
"bcp_47_code": "es-SV"
},
"18441": {
"int_code": 18441,
"desc": "English - Singapore",
"bcp_47_code": "en-SG"
},
"18442": {
"int_code": 18442,
"desc": "Spanish - Honduras",
"bcp_47_code": "es-HN"
},
"19466": {
"int_code": 19466,
"desc": "Spanish - Nicaragua",
"bcp_47_code": "es-NI"
},
"20490": {
"int_code": 20490,
"desc": "Spanish - Puerto Rico",
"bcp_47_code": "es-PR"
},
"21514": {
"int_code": 21514,
"desc": "Spanish - United States",
"bcp_47_code": "es-US"
},
"58378": {
"int_code": 58378,
"desc": "Spanish - Latin America",
"bcp_47_code": "es-419"
},
"58380": {
"int_code": 58380,
"desc": "French - North Africa",
"bcp_47_code": "fr-015"
}
}
接下来,您应该调用
GetKeyboardLayoutName()
函数,它将返回一个十六进制数字,如"00000423"。我们字典中的键是整数,因此您应该将其转换为十进制(只是普通的整数)。我不知道您在C#中如何做到这一点,但在Python中,可以使用以下代码:
i = int("<hex number goes here>", 16)
。
然后,您只需通过我们计算出的键查询字典并获取完整信息,包括描述和BCP 47代码。
注意:键是
string
,因为JSON不支持整数键。