什么技术将是最小化国际化(至少是多语言)现有的Delphi应用程序? [英] What technique would be the least effort to internationalise (at least multi-language) existing Delphi Applications?

查看:202
本文介绍了什么技术将是最小化国际化(至少是多语言)现有的Delphi应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了大约300个应用程序,我想提供独立于操作系统的多语言功能。我已经写了一个即时翻译器,但是在许多组件的应用程序中这太慢了。你会建议我做什么?

解决方案

我听说过 TsiLang组件是不错的,但你看一个在...的解决方案...



我使用 Delphi的GNU gettext 完全符合您的要求,它从文本文件加载翻译并替换组件中的文本。它甚至有一个pas / dfm扫描器自动生成英文翻译文件。



还可以自动更改您的pascal源代码,以注入gettext过程,代替您的静态字符串。如果我没有错误,它只是添加一个下划线作为函数,如下所示。

  ShowMessage('Hello'); // before 
ShowMessage(_('Hello')); // after

我必须说,自从我上次使用这种方法以来已经2年了。 >

有一件事仍然有问题,Delphi组件不启用unicode(D2009修复这个),所以当你不更改组件时,你仍然对其他语言的支持仍然有限。


I have developed about 300 Applications which I would like to provide with multi-language capabilities independent from the Operating System. I have written a just-in-time translator, but that is too slow in applications with many components. What would you suggest I do?

解决方案

I've heard that the TsiLang components are nice, but your looking at an inplace solution...

I've used GNU gettext for Delphi which does exactly the thing you want, it loads the translations from a text file and replaces the text in your components. It even has a pas/dfm scanner to automatically generate the English translation file.

It's also possible to automatically change your pascal source code to inject the gettext procedure inplace of your static strings. If I'm not mistaken it just adds a underscore as function to it, as below.

ShowMessage('Hello'); // before
ShowMessage(_('Hello')); // after

I must say it has been 2 years since I last used this method.

One thing will remain problematic, the Delphi components are not unicode enabled (D2009 fixes this), so when you don't change the components you'll still have limited support for other languages.

这篇关于什么技术将是最小化国际化(至少是多语言)现有的Delphi应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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