关于多语言的问题:程序中使用了DevExpress Bar这样的第三方控件,使用BCB自带的Langrague Trans功能进行Update Resource

L

lujun

Unregistered / Unconfirmed
GUEST, unregistred user!
关于多语言的问题:程序中使用了DevExpress Bar这样的第三方控件,使用BCB自带的Langrague Trans功能进行Update Resource Dlls处理,警告说错误!(200分)<br /> 按照教父的指点,找到BCB5里面的一个关于RichEdit的多语言例子。根据这个例子
进行了相应的更改,但发现有题目中的问题。打开相应文件夹,如/ENU下的dfm文件,
发现出错的form文件被改名为xxx.ERR_dfm,打开到错误处,发现大段语法错。直接把
原始的dfm复制进去,可以编译通过,但运行时出错,说“Ancester for 'xxx' not
found”。不得要领。怎么办???
在BCB5的帮助中找到下列有关的说明:
In addition to locating a resource DLL at application startup,
it is possible to switch resource DLLs dynamically at runtime. To
add this functionality to your own applications, you need to
include the ReInit unit in your project.(ReInit is located in the
Richedit sample in the Examples directory.)
To switch languages, you should call LoadResourceModule, passing
the LCID for the new language, and then
call ReinitializeForms.
For example, the following code switches the interface language
to French:
const FRENCH = (SUBLANG_FRENCH << 10) | LANG_FRENCH;
if (LoadNewResourceModule(FRENCH))
ReinitializeForms();
The advantage of this technique is that the current instance of
the application and all of its forms are used. It is not necessary
to update the registry settings and restart the application or re-acquire
resources required by the application, such as logging in to database
servers.
When you switch resource DLLs the properties specified in the new
DLL overwrite the properties in the running instances of the forms.
Note: Any changes made to the form properties at runtime will be
lost. Once the new DLL is loaded, default values are not reset. Avoid
code that assumes that the form objects are reinitialized to the their
startup state, apart from differences due to localization.
 
我只能提供一点意见,按我的经验,
我没这样汉化过DevExpress Bar,
而是直间对DevExpress Bar所提供的资源文件进行汉化!
其效果也是挺好的,如果不是系统要求是多语言的话,只是想
汉话,建议这样做要好些!
 
不好意思没说清楚,不是要进行汉化,是要进行多语言编程。希望能够
做到NetAnts那样的,运行时动态切换不同的语言界面。BCB内部由上述的一
个例子,但不知道是不是BCB自身支持考虑的不周还是什么的问题呢?
 
没人有办法吗?
 
真是的,没人给点提示吗!!?
 
我在使用多语言编数据库软件时,添加中文(中国)后,资源项目多出了两个窗体文件,
但是在连接项目时又出错。注销掉这两个文件后,能编译连接,但是运行程序时,修改
了的数据库相关资源无法显示,而窗口框架资源是可修改的。请哪位大虾给予指点!
 
http://delphi.ktop.com.tw/topic.asp?TOPIC_ID=28843
推荐一组实现多语言的Delphi元件,所有文字,讯息都可以实现,简单,扩展性强,
第三方元件也没问题;附专业的资料字典编辑工具。
 
顶部