jpfollenius
jpfollenius

Reputation: 16612

Delphi and i18n

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?

Upvotes: 8

Views: 2553

Answers (5)

Marco van de Voort
Marco van de Voort

Reputation: 26356

Amd then there is dxgettext:

http://dxgettext.po.dk/

traditionally one of the tools used to change language runtime without restart.

Note that with Delphi/unicode the amount of code changes with this packages has decreased (one no longer has to change any resourcestring use)

Upvotes: 1

IanH
IanH

Reputation: 304

I second the recommendation for using the TsiLang components(www.sicomponents.com). I've just used them to upgrade from English-only to English + Chinese, selectable at run-time, and found the process to be quite a lot easier than I was expecting. The end results are not perfect, but certainly good enough to work with.

Upvotes: -1

Bruce McGee
Bruce McGee

Reputation: 15334

Delphi ships with some tools to do this.

Here is a tutorial for Delphi 2005, and a video of Nick Hodges showing off the more recent version for Delphi 2009.

Upvotes: 5

Ralph M. Rickenbach
Ralph M. Rickenbach

Reputation: 13173

I have been using the SiComponents before. They allow you to change all text independently from the executable. You can embed the diferent languages in your executable (not recomended) or load them from files. There is also an editor to support translation. They are very good, stable, and fast.

In Delphi 2006 under Tools, Options, Translation Tools Options you can configure the translation tools, especially theTranslation Repository. It can be found under View, Translation Manager. All translated strings will be ressource strings and can be stored in language specific dll. Searching the help for Translation Manager will point you in the right direction.

Upvotes: 0

Toon Krijthe
Toon Krijthe

Reputation: 53366

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.

Upvotes: 1

Related Questions