VBScript SetLocale 函数

定义和用法

SetLocale 函数可设置 locale ID,并返回之前的 locale ID。

locale 是用户参考信息集合,比如用户的语言、国家和文化传统。locale 可决定键盘布局、字母排序顺序和日期、时间、数字与货币格式等等。

语法

SetLocale(lcid)
参数 描述
lcid 必需的。任意一个在 Locale ID 表 中的短字符串、十六进制值、十进制值,该值必须唯一标识一个地理区域。如果 lcid 参数被设置为 0 ,则 locale 将由系统设置。

实例

document.write(SetLocale(2057))
document.write(SetLocale(2058))

输出:

1033
2057

Locale ID 表

Locale 描述 简写 十六进制值 十进制值
Afrikaans af 0x0436 1078
Albanian sq 0x041C 1052
Arabic ?United Arab Emirates ar-ae 0x3801 14337
Arabic - Bahrain ar-bh 0x3C01 15361
Arabic - Algeria ar-dz 0x1401 5121
Arabic - Egypt ar-eg 0x0C01 3073
Arabic - Iraq ar-iq 0x0801 2049
Arabic - Jordan ar-jo 0x2C01 11265
Arabic - Kuwait ar-kw 0x3401 13313
Arabic - Lebanon ar-lb 0x3001 12289
Arabic - Libya ar-ly 0x1001 4097
Arabic - Morocco ar-ma 0x1801 6145
Arabic - Oman ar-om 0x2001 8193
Arabic - Qatar ar-qa 0x4001 16385
Arabic - Saudi Arabia ar-sa 0x0401 1025
Arabic - Syria ar-sy 0x2801 10241
Arabic - Tunisia ar-tn 0x1C01 7169
Arabic - Yemen ar-ye 0x2401 9217
Armenian hy 0x042B 1067
Azeri ?Latin az-az 0x042C 1068
Azeri ?Cyrillic az-az 0x082C 2092
Basque eu 0x042D 1069
Belarusian be 0x0423 1059
Bulgarian bg 0x0402 1026
Catalan ca 0x0403 1027
Chinese - China zh-cn 0x0804 2052
Chinese - Hong Kong S.A.R. zh-hk 0x0C04 3076
Chinese ?Macau S.A.R zh-mo 0x1404 5124
Chinese - Singapore zh-sg 0x1004 4100
Chinese - Taiwan zh-tw 0x0404 1028
Croatian hr 0x041A 1050
Czech cs 0x0405 1029
Danish da 0x0406 1030
Dutch ?The Netherlands nl-nl 0x0413 1043
Dutch - Belgium nl-be 0x0813 2067
English - Australia en-au 0x0C09 3081
English - Belize en-bz 0x2809 10249
English - Canada en-ca 0x1009 4105
English ?Carribbean en-cb 0x2409 9225
English - Ireland en-ie 0x1809 6153
English - Jamaica en-jm 0x2009 8201
English - New Zealand en-nz 0x1409 5129
English ?Phillippines en-ph 0x3409 13321
English - South Africa en-za 0x1C09 7177
English - Trinidad en-tt 0x2C09 11273
English - United Kingdom en-gb 0x0809 2057
English - United States en-us 0x0409 1033
Estonian et 0x0425 1061
Farsi fa 0x0429 1065
Finnish fi 0x040B 1035
Faroese fo 0x0438 1080
French - France fr-fr 0x040C 1036
French - Belgium fr-be 0x080C 2060
French - Canada fr-ca 0x0C0C 3084
French - Luxembourg fr-lu 0x140C 5132
French - Switzerland fr-ch 0x100C 4108
Gaelic ?Ireland gd-ie 0x083C 2108
Gaelic - Scotland gd 0x043C 1084
German - Germany de-de 0x0407 1031
German - Austria de-at 0x0C07 3079
German - Liechtenstein de-li 0x1407 5127
German - Luxembourg de-lu 0x1007 4103
German - Switzerland de-ch 0x0807 2055
Greek el 0x0408 1032
Hebrew he 0x040D 1037
Hindi hi 0x0439 1081
Hungarian hu 0x040E 1038
Icelandic is 0x040F 1039
Indonesian id 0x0421 1057
Italian - Italy it-it 0x0410 1040
Italian - Switzerland it-ch 0x0810 2064
Japanese ja 0x0411 1041
Korean ko 0x0412 1042
Latvian lv 0x0426 1062
Lithuanian lt 0x0427 1063
FYRO Macedonian mk 0x042F 1071
Malay - Malaysia ms-my 0x043E 1086
Malay ?Brunei ms-bn 0x083E 2110
Maltese mt 0x043A 1082
Marathi mr 0x044E 1102
Norwegian - Bokm