convert ISO 3166-1 code to country names in i18n

convert ISO 3166-1 alpha-2 or alpha-3 or numeric contry/district code to country/district name in i18n

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.gf.qytechs.cn/scripts/452413/1101204/convert%20ISO%203166-1%20code%20to%20country%20names%20in%20i18n.js

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

作者
sitebucket
版本
0.1
创建于
2022-10-03
更新于
2022-10-05
大小
86.0 KB
许可证
Copyright sitebucket.net

usage

supported languages: ar, bn, de, en, es, fr, hi, it, jp, ko, pt, ru, zh-cn, zh-hk, zh-tw

alpha-2 code to country name a22country(a2, lang="en", codes=false)

alpha-3 code to country name a32country(a3, lang="en", codes=false)

numeric code to country name num2country(num, lang="en", codes=false)

test

console.log(a22country("AF"));
console.log(a22country("AF", "ar"));
console.log(a22country("AF", "bn"));
console.log(a22country("AF", "de"));
console.log(a22country("AF", "en"));
console.log(a22country("AF", "es"));
console.log(a22country("AF", "fr"));
console.log(a22country("AF", "hi"));
console.log(a22country("AF", "it"));
console.log(a22country("AF", "jp"));
console.log(a22country("AF", "ko"));
console.log(a22country("AF", "pt"));
console.log(a22country("AF", "ru"));
console.log(a22country("AF", "zh-cn"));
console.log(a22country("AF", "zh-hk"));
console.log(a22country("AF", "zh-tw"));
console.log(a22country("AF", "zh-tw", true));
console.log(a22country("AF", "zh-tw", false));
console.log("-----");
console.log(a32country("ALA"));
console.log(a32country("ALA", "ar"));
console.log(a32country("ALA", "bn"));
console.log(a32country("ALA", "de"));
console.log(a32country("ALA", "en"));
console.log(a32country("ALA", "es"));
console.log(a32country("ALA", "fr"));
console.log(a32country("ALA", "hi"));
console.log(a32country("ALA", "it"));
console.log(a32country("ALA", "jp"));
console.log(a32country("ALA", "ko"));
console.log(a32country("ALA", "pt"));
console.log(a32country("ALA", "ru"));
console.log(a32country("ALA", "zh-cn"));
console.log(a32country("ALA", "zh-hk"));
console.log(a32country("ALA", "zh-tw"));
console.log(a32country("ALA", "zh-tw", true));
console.log(a32country("ALA", "zh-tw", false));
console.log("-----");
console.log(num2country("008"));
console.log(num2country("008", "ar"));
console.log(num2country("008", "bn"));
console.log(num2country("008", "de"));
console.log(num2country("008", "en"));
console.log(num2country("008", "es"));
console.log(num2country("008", "fr"));
console.log(num2country("008", "hi"));
console.log(num2country("008", "it"));
console.log(num2country("008", "jp"));
console.log(num2country("008", "ko"));
console.log(num2country("008", "pt"));
console.log(num2country("008", "ru"));
console.log(num2country("008", "zh-cn"));
console.log(num2country("008", "zh-hk"));
console.log(num2country("008", "zh-tw"));
console.log(num2country("008", "zh-tw", true));
console.log(num2country("008", "zh-tw", false));

output

Afghanistan
أفغانستان
আফগানিস্তান
Afghanistan
Afghanistan
Afganistán
AFGHANISTAN
अफगानिस्तान
Afghanistan
アフガニスタン
아프가니스탄
Afeganistão
Афганистан
阿富汗
阿富汗
阿富汗
[ '阿富汗', 'AF', 'AFG', '004' ]
阿富汗
-----
Åland Islands
جزر أولاند
অলান্দ দ্বীপপুঞ্জ
Åland
Åland Islands
Åland
ÅLAND, ÎLES
Åland Islands
Isole Åland
オーランド諸島
올란드 제도
Aland, Ilhas
Аландские острова
奥兰
奧蘭
奧蘭
[ '奧蘭', 'AX', 'ALA', '248' ]
奧蘭
-----
Albania
ألبانيا
আলবেনিয়া
Albanien
Albania
Albania
ALBANIE
अल्बानिया
Albania
アルバニア
알바니아
Albânia
Албания
阿尔巴尼亚
阿爾巴尼亞
阿爾巴尼亞
阿爾巴尼亞
阿爾巴尼亞
[ '阿爾巴尼亞', 'AL', 'ALB', '008' ]
阿爾巴尼亞

data source