1. asp part
A. Create a Language Pack
1. Create a "Language Pack" directory in each subsystem,
For example, BBS --> language --> simplified
---> Traditional
---> English
2. Create language files for each ASP, JS, and HTC, such as acmbbstopic. asp. Lang, Treeview. HTC. Lang,
Used to store language global variables.
Such as the Directory language/english/acmbbsshow. asp. Lang
Public const langrollway = "reverse roll"
Public const langinvailduser = "invaild user"
Public const langmailbox = "mail box"
Public const langsyssetup = "System Setup"
Public const langacmbbs = "Acer BBS"
Public const langbulltn = "Acer bulltin"
Public const langpersnsetup = "personal setting"
Public const langpublictools = "Public Tools"
For example, the directory language/Simplified/acmbbsshow. asp. Lang
Public const langrollway = "reverse scrolling"
Public const langinvailduser = "invalid user"
Public const langmailbox = "mail folder"
Public const langsyssetup = "system settings"
Public const langacmbbs = ""
Public const langbulltn = "bulletin board"
Public const langpersnsetup = "personal Settings"
Public const langpublictools = "group Tools"
Language global variable naming rules;
Must be the VBScript variable definition method public const
Variable name: "Lang" + message descption
B. set global. asa
Sub session_onstart
Session. codePage = "1252" '1252en' 950 '936 simplified
Session. Contents ("language") = "English" 'inc' traditional' simplified
Session. Contents ("strcharset") = "big5" 'iso-8859-1 'big5' gb2312
End sub
C. Reference language packs
1. Create the BBS --> language --> Script directory, which contains delang. vbs.
2. In various ASP, JS, and HTC Headers
<Script language = VBScript runat = "server" src = "./Language/script/includelang. vbs"> </SCRIPT>
<% Call interval delangfile ("acmmainpageshow. asp. Lang", session. Contents ("language") %>
3. Use ideas
O use function getfilecontents to read language packs such as *. Lang into the variable,
O run the execute method in VBScript on the server.
The contents of includelang. vbs are as follows:
'//'************************************ *********************
'// 'Purpose: Open include file
'//' Inputs: strincludefile path
'//' Returns: all text
'//'************************************ *********************
Function getfilecontents (strincludefile)
On Error resume next
Dim objfso
Dim objtext
Dim strpage
Set objfso = server. Createobject ("scripting. FileSystemObject ")
Set objtext = objfso. opentextfile (server. mappath (strincludefile ))
Getfilecontents = objtext. readall
Objtext. Close
Set objtext = nothing
Set objfso = nothing
If err then
Response. Write "error open this language package file <" & strpolicdefile & ">! "
Response. End
End if
End Function
'//'************************************ *********************
'// 'Purpose: Dynamic include file
'//' Inputs: strincludefile path, language type
'//' Returns: Execute the variable to the global variable
'//'************************************ *********************
Function compute delangfile (strfilename, language)
On Error resume next
Dim strlangpackagepath
Dim strlanguagepath
Strlanguagepath = Language
Strlangpackagepath = "./Language/" & str1_agepath & "/" & strfilename
Execute (getfilecontents (strlangpackagepath ))
If err then
Response. Write "error include this language package file <" & strpolicdefile & ">! Check the file's syntax"
Response. End
End if
End Function
2. Image part
Create BBS --> language --> simplified --> image for images with Chinese characters
---> Traditional --> Image
---> English --> Image
Dynamic include
3. com Section
Use resource file to control the language version. The system automatically determines the language version.
Note: resource file simplified Chinese characters must be entered on the simplified machine, and traditional Chinese characters must be entered on the traditional machine.
4. Miscellaneous
Multilingual version reference rules ﹕
1. The English translation length should be the same as the Chinese translation length.
2. It must conform to the language habits of each version.
3. Title, text, button text, and select option in English
A prefix, a hyphen, and a post in lower case.
4. All abbreviations in the English version use uppercase letters.
5. Check and radio in the English version, with uppercase letters.
6. The status information in the English version should be in lower case.