LOGO OA教程 ERP教程 模切知识交流 PMS教程 CRM教程 开发文档 其他文档  
 
网站管理员

基于WEB系统的多语言支持--ASP国际化多语言详细方案

admin
2010年7月8日 0:19 本文热度 6667

1.asp部分

a.建立语言包

1.在各个子系统建立"语言包"目录 ,

如bbs--> language -->simplified

--->traditional

--->english

2 为每个asp,js,htc 建立语言文件,如acmbbstopic.asp.lang ,treeview.htc.lang ,

用来存放语言全局变量。

如目录languageenglish 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"

如目录language simplified acmbbsshow.asp.lang

public const langrollway="反向滚动"

public const langinvailduser="非法用户"

public const langmailbox="邮件资料夹"

public const langsyssetup="系统设置"

public const langacmbbs="明碁网咖"

public const langbulltn="公告栏"

public const langpersnsetup="个人设定"

public const langpublictools="群组工具"

语言全局变量命名规则;

必须是vbscript 变量定义方式 public const

变量名为 : "lang" + message descption

b. 设定global.asa

sub session_onstart

session.codepage="1252" '1252en '950繁体 '936简体

session.contents("language")="english" 'english 'traditional 'simplified

session.contents("strcharset")="big5" 'iso-8859-1 'big5 'gb2312

end sub

c. 引用语言包

1.建立 bbs--> language -->script 目录, includelang.vbs

2.在各个asp,js,htc头部

<% call includelangfile("acmmainpageshow.asp.lang",session.contents("language"))%>

3.使用思想

o 将 *.lang 等语言包用function getfilecontents 读到变量中,

o 使用vbscript中execute方法在server执行

includelang.vbs 内容如下

'//'*********************************************************

'// ' purpose: open include 文件

'// ' inputs: strincludefile 路径

'// ' 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<<" & strincludefile & ">>!"

response.end

end if

end function

'//'*********************************************************

'// ' purpose: 动态 include 文件

'// ' inputs: strincludefile 路径,语言种类

'// ' returns: 执行变量到全局变量

'//'*********************************************************

function includelangfile(strfilename,language)

on error resume next

dim strlangpackagepath

dim strlanguagepath

strlanguagepath=language

strlangpackagepath="./language/" & strlanguagepath & "/" & strfilename

execute(getfilecontents(strlangpackagepath))

if err then

response.write "error include this language package file<<" & strincludefile & ">>! check the file's syntax"

response.end

end if

end function

2.图片部分

为带有汉字图片建立 bbs--> language -->simplified-->image

--->traditional-->image

--->english -->image

动态include

3.com部分

使用resource file 控制语言版本,由系统自动判断语言版本。

注意: resource file 简体字码必须在简体机器输入,繁体字码必须在繁体机器输入。

4.其他​

多语言版本参考规则﹕

  1. 英文翻译长度尽量与汉语长度相当。

  2. 要符合各个版本的语言习惯。

  3. 英文版中title ,text标签文本﹐按钮文本﹐select option 中英文单词 首字母大写,但介词﹐连词 ,冠词 使用小写。

  4. 英文版中缩写全部使用大写。

  5. 英文版中check ,radio ,英文首字母大写.

  6. 英文版中状态信息使用小写。


该文章在 2025/8/21 12:01:28 编辑过
关键字查询
相关文章
正在查询...
点晴ERP是一款针对中小制造业的专业生产管理软件系统,系统成熟度和易用性得到了国内大量中小企业的青睐。
点晴PMS码头管理系统主要针对港口码头集装箱与散货日常运作、调度、堆场、车队、财务费用、相关报表等业务管理,结合码头的业务特点,围绕调度、堆场作业而开发的。集技术的先进性、管理的有效性于一体,是物流码头及其他港口类企业的高效ERP管理信息系统。
点晴WMS仓储管理系统提供了货物产品管理,销售管理,采购管理,仓储管理,仓库管理,保质期管理,货位管理,库位管理,生产管理,WMS管理系统,标签打印,条形码,二维码管理,批号管理软件。
点晴免费OA是一款软件和通用服务都免费,不限功能、不限时间、不限用户的免费OA协同办公管理系统。
Copyright 2010-2025 ClickSun All Rights Reserved