显示浏览器国别名称,很简单的东西
作者:Eve Cole
更新时间:2009-06-17 17:11:25
<!-- 把下面代码加到<body>区域中 -->
<脚本语言=“JavaScript”>
<!-- 开始
if (navigator.browserLanguage.substr(0,2) == "af")
document.write('南非荷兰语')
else if (navigator.browserLanguage.substr(0,2) == "ar")
{
if (navigator.browserLanguage.substr(3,2) == "ae")
document.write('阿拉伯语/阿拉伯联合酋长国')
否则 if (navigator.browserLanguage.substr(3,2) == "bh")
document.write('阿拉伯语/巴林')
else if (navigator.browserLanguage.substr(3,2) == "eg")
document.write('阿拉伯语/埃及')
else if (navigator.browserLanguage.substr(3,2) == "dz")
document.write('阿拉伯语/阿尔及利亚')
else if (navigator.browserLanguage.substr(3,2) == "iq")
document.write('阿拉伯语/伊拉克')
否则 if (navigator.browserLanguage.substr(3,2) == "jo")
document.write('阿拉伯语/约旦')
否则 if (navigator.browserLanguage.substr(3,2) == "kw")
document.write('阿拉伯语/科威特')
否则 if (navigator.browserLanguage.substr(3,2) == "lb")
document.write('阿拉伯语/黎巴嫩')
else if (navigator.browserLanguage.substr(3,2) == "ly")
document.write('阿拉伯语/利比亚')
else if (navigator.browserLanguage.substr(3,2) == "ma")
document.write('阿拉伯语/摩洛哥')
否则 if (navigator.browserLanguage.substr(3,2) == "om")
document.write('阿拉伯语/阿曼')
否则 if (navigator.browserLanguage.substr(3,2) == "qa")
document.write('阿拉伯语/卡塔尔')
否则 if (navigator.browserLanguage.substr(3,2) == "sa")
document.write('阿拉伯语/沙特阿拉伯')
else if (navigator.browserLanguage.substr(3,2) == "sy")
document.write('阿拉伯语/叙利亚')
否则 if (navigator.browserLanguage.substr(3,2) == "tn")
document.write('阿拉伯语/突尼斯')
else if (navigator.browserLanguage.substr(3,2) == "ye")
document.write('阿拉伯语/也门')
else document.write('阿拉伯语')
}
else if (navigator.browserLanguage.substr(0,2) == "be")
document.write('白俄罗斯语')
否则 if (navigator.browserLanguage.substr(0,2) == "bg")
document.write('保加利亚语')
否则 if (navigator.browserLanguage.substr(0,2) == "ca")
document.write('加泰罗尼亚语')
else if (navigator.browserLanguage.substr(0,2) == "cs")
document.write('捷克语')
else if (navigator.browserLanguage.substr(0,2) == "da")
document.write('丹麦语')
else if (navigator.browserLanguage.substr(0,2) == "de")
{
if (navigator.browserLanguage.substr(3,2) == "at")
document.write('德国/奥地利')
否则 if (navigator.browserLanguage.substr(3,2) == "ch")
document.write('德国/瑞士')
else if (navigator.browserLanguage.substr(3,2) == "li")
document.write('德语/列支敦士登')
else if (navigator.browserLanguage.substr(3,2) == "lu")
document.write('德语/卢森堡')
else document.write('德语/德国')
}
else if (navigator.browserLanguage.substr(0,2) == "el")
document.write('希腊语/希腊')
else if (navigator.browserLanguage.substr(0,2) == "en")
{
if (navigator.browserLanguage.substr(3,2) == "我们")
document.write('英语/美国')
else if (navigator.browserLanguage.substr(3,2) == "au")
document.write('英语/澳大利亚')
否则 if (navigator.browserLanguage.substr(3,2) == "bz")
document.write('英语/伯利兹')
否则 if (navigator.browserLanguage.substr(3,2) == "ca")
document.write('英语/加拿大')
else if (navigator.browserLanguage.substr(3,2) == "gb")
document.write('英语/英国')
else if (navigator.browserLanguage.substr(3,2) == "ie")
document.write('英语/爱尔兰')
否则 if (navigator.browserLanguage.substr(3,2) == "jm")
document.write('英语/牙买加')
否则 if (navigator.browserLanguage.substr(3,2) == "nz")
document.write('英语/新西兰')
否则 if (navigator.browserLanguage.substr(3,2) == "tt")
document.write('英语/特立尼达')
否则 if (navigator.browserLanguage.substr(3,2) == "za")
document.write('英语/南非')
else document.write('英语')
}
else if (navigator.browserLanguage.substr(0,2) == "es")
{
if (navigator.browserLanguage.substr(3,2) == "ar")
document.write('西班牙语/阿根廷')
else if (navigator.browserLanguage.substr(3,2) == "bo")
document.write('西班牙语/玻利维亚')
否则 if (navigator.browserLanguage.substr(3,2) == "cl")
document.write('西班牙语/智利')
否则 if (navigator.browserLanguage.substr(3,2) == "co")
document.write('西班牙语/哥伦比亚')
否则 if (navigator.browserLanguage.substr(3,2) == "cr")
document.write('西班牙语/哥斯达黎加')
else if (navigator.browserLanguage.substr(3,2) == "do")
document.write('西班牙/多米尼加共和国')
否则 if (navigator.browserLanguage.substr(3,2) == "ec")
document.write('西班牙语/厄瓜多尔')
否则 if (navigator.browserLanguage.substr(3,2) == "gt")
document.write('西班牙语/危地马拉')
否则 if (navigator.browserLanguage.substr(3,2) == "hn")
document.write('西班牙语/洪都拉斯')
否则 if (navigator.browserLanguage.substr(3,2) == "mx")
document.write('西班牙/墨西哥')
else if (navigator.browserLanguage.substr(3,2) == "ni")
document.write('西班牙语/尼加拉瓜')
否则 if (navigator.browserLanguage.substr(3,2) == "pa")
document.write('西班牙/巴拿马')
否则 if (navigator.browserLanguage.substr(3,2) == "pe")
document.write('西班牙语/秘鲁')
否则 if (navigator.browserLanguage.substr(3,2) == "pr")
document.write('西班牙语/波多黎各')
else if (navigator.browserLanguage.substr(3,2) == "py")
document.write('西班牙语/巴拉圭')
否则 if (navigator.browserLanguage.substr(3,2) == "sv")
document.write('西班牙语/萨尔瓦多')
否则 if (navigator.browserLanguage.substr(3,2) == "uy")
document.write('西班牙语/乌拉圭')
else if (navigator.browserLanguage.substr(3,2) == "ve")
document.write('西班牙语/委内瑞拉')
else document.write('西班牙语/西班牙')
}
else if (navigator.browserLanguage.substr(0,2) == "et")
document.write('爱沙尼亚语')
否则 if (navigator.browserLanguage.substr(0,2) == "eu")
document.write('巴斯克语')
else if (navigator.browserLanguage.substr(0,2) == "fa")
document.write('波斯语')
否则 if (navigator.browserLanguage.substr(0,2) == "fi")
document.write('芬兰语')
否则 if (navigator.browserLanguage.substr(0,2) == "fo")
document.write('法罗语')
否则 if (navigator.browserLanguage.substr(0,2) == "fr")
{
if (navigator.browserLanguage.substr(3,2) == "be")
document.write('法国/比利时')
否则 if (navigator.browserLanguage.substr(3,2) == "ca")
document.write('法国/加拿大')
否则 if (navigator.browserLanguage.substr(3,2) == "ch")
document.write('法国/瑞士')
否则 if (navigator.browserLanguage.substr(3,2) == "ca")
document.write('法国/卢森堡')
else document.write('法语/法国')
}
否则 if (navigator.browserLanguage.substr(0,2) == "gd")
{
if (navigator.browserLanguage.substr(3,2) == "ie")
document.write('盖尔语/爱尔兰')
else document.write('盖尔语/苏格兰')
}
else if (navigator.browserLanguage.substr(0,2) == "he")
document.write('希伯来语')
else if (navigator.browserLanguage.substr(0,2) == "hi")
document.write('印地语')
否则 if (navigator.browserLanguage.substr(0,2) == "hr")
document.write('克罗地亚语')
else if (navigator.browserLanguage.substr(0,2) == "hu")
document.write('匈牙利语')
else if (navigator.browserLanguage.substr(0,2) == "in")
document.write('印度尼西亚语')
else if (navigator.browserLanguage.substr(0,2) == "is")
document.write('冰岛语')
else if (navigator.browserLanguage.substr(0,2) == "he")
document.write('希伯来语')
else if (navigator.browserLanguage.substr(0,2) == "it")
{
if (navigator.browserLanguage.substr(3,2) == "ch")
document.write('意大利/瑞士')
else document.write('意大利语/意大利')
}
else if (navigator.browserLanguage.substr(0,2) == "ja")
document.write('日语/日本')
else if (navigator.browserLanguage.substr(0,2) == "ji")
document.write('意第绪语')
else if (navigator.browserLanguage.substr(0,2) == "ko")
document.write('韩语/韩国')
否则 if (navigator.browserLanguage.substr(0,2) == "lt")
document.write('立陶宛语/立陶宛')
否则 if (navigator.browserLanguage.substr(0,2) == "lv")
document.write('拉脱维亚语')
否则 if (navigator.browserLanguage.substr(0,2) == "mk")
document.write('马其顿/马其顿')
else if (navigator.browserLanguage.substr(0,2) == "ms")
document.write('马来西亚/马来西亚')
否则 if (navigator.browserLanguage.substr(0,2) == "mt")
document.write('马耳他/马耳他')
否则 if (navigator.browserLanguage.substr(0,2) == "nl")
{
if (navigator.browserLanguage.substr(3,2) == "be")
document.write('荷兰/比利时')
else document.write('荷兰语/荷兰')
}
否则 if (navigator.browserLanguage.substr(0,2) == "pl")
document.write('波兰语/波兰')
否则 if (navigator.browserLanguage.substr(0,2) == "pt")
{
if (navigator.browserLanguage.substr(3,2) == "br")
document.write('葡萄牙语/巴西')
else document.write('葡萄牙语/葡萄牙语')
}
否则 if (navigator.browserLanguage.substr(0,2) == "rm")
document.write('Rhaeto-Romanic / 罗马尼亚')
else if (navigator.browserLanguage.substr(0,2) == "ro")
document.write('罗马尼亚语/罗马尼亚语')
else if (navigator.browserLanguage.substr(0,2) == "ru")
document.write('俄语/俄罗斯')
else if (navigator.browserLanguage.substr(0,2) == "sb")
document.write('索布语')
else if (navigator.browserLanguage.substr(0,2) == "sk")
document.write('斯洛伐克语')
否则 if (navigator.browserLanguage.substr(0,2) == "sl")
document.write('斯洛文尼亚语')
否则 if (navigator.browserLanguage.substr(0,2) == "sq")
document.write('阿尔巴尼亚语/阿尔巴尼亚')
否则 if (navigator.browserLanguage.substr(0,2) == "sr")
document.write('塞尔维亚语/塞尔维亚')
否则 if (navigator.browserLanguage.substr(0,2) == "sv")
{
if (navigator.browserLanguage.substr(3,2) == "fi")
document.write('瑞典/芬兰')
else document.write('瑞典语/瑞典')
}
否则 if (navigator.browserLanguage.substr(0,2) == "sx")
document.write('苏图')
否则 if (navigator.browserLanguage.substr(0,2) == "sz")
document.write('萨米')
else if (navigator.browserLanguage.substr(0,2) == "th")
document.write('泰语/泰国')
否则 if (navigator.browserLanguage.substr(0,2) == "tn")
document.write('茨瓦纳语')
否则 if (navigator.browserLanguage.substr(0,2) == "tr")
document.write('土耳其语/土耳其')
否则 if (navigator.browserLanguage.substr(0,2) == "ts")
document.write('特松加')
else if (navigator.browserLanguage.substr(0,2) == "uk")
document.write('乌克兰语')
else if (navigator.browserLanguage.substr(0,2) == "th")
document.write('泰语/泰国')
else if (navigator.browserLanguage.substr(0,2) == "ur")
document.write('乌尔都语')
else if (navigator.browserLanguage.substr(0,2) == "ve")
document.write('文达')
否则 if (navigator.browserLanguage.substr(0,2) == "vi")
document.write('越南语/越南')
否则 if (navigator.browserLanguage.substr(0,2) == "xh")
document.write('科萨语')
else if (navigator.browserLanguage.substr(0,2) == "zh")
{
if (navigator.browserLanguage.substr(3,2) == "cn")
document.write('中文/中国')
else if (navigator.browserLanguage.substr(3,2) == "hk")
document.write('中文/香港')
否则 if (navigator.browserLanguage.substr(3,2) == "sg")
document.write('中文/新加坡')
否则 if (navigator.browserLanguage.substr(3,2) == "tw")
document.write('中国/台湾')
else document.write('中文/中国')
}
else if (navigator.browserLanguage.substr(0,2) == "zu")
document.write('祖鲁语')
别的
document.write('无法确定')
// 结束 -->
</脚本>