德尔福和i18n [英] Delphi and i18n

查看:169
本文介绍了德尔福和i18n的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

德尔福是否以任何方式支持国际化?



我看到我可以为项目添加不同的语言,但是似乎创建了dfm的多个实例文件。我是对的语言因此在运行时不能改变?



如何处理国际化(如果你这样做)?有没有最佳做法?

解决方案

我曾经尝试过运行时更改语言。它工作得很好,但是我需要自己编写很多代码(并规避dfm文件)。问题是,这很麻烦,你几乎从来不需要这个。



更好的选择(在我看来)是创建基本语言版本并使用翻译工具用于其他语言。我们使用可执行文件和dll上的第三方翻译器。它替换资源中的字符串并创建新的二进制文件。



此工具的一大优点是它显示已翻译的对话框(仅限标准的Windows组件),因此您可以如果标签太大,请直接反馈。


Does Delphi support internationalization in any way?

I've seen that I can add different languages for a project, but that seems to create multiple instances of the dfm files. Am I right that the language therefore cannot be changed at runtime?

How do you handle internationalization (if you do)? Are there any best-practices?

解决方案

I have once experimented with runtime change of languages. It worked great, but I needed to write lots of code myself (and circumvent the dfm files). The problem is, it is a lot of hassle and you almost never need this.

The better option (in my opinion) is to create a base language version and use a translator tool for the other language. We use a third party translator that works on the executable and dll. It replaces the strings in the resources and creates new binary files.

One big plus of this tool is that it shows the translated dialogs (standard windows components only) so you have direct feedback if labels are too large.

这篇关于德尔福和i18n的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆