views:

333

answers:

4
+5  Q: 

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?

+2  A: 

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.

Gamecat
Thanks. Any recommendations concerning the translator tool?
Smasher
I added a link. It is not free, but we are extremely happy with it.
Gamecat
+1  A: 

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.

Ralph Rickenbach
+4  A: 

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.

Bruce McGee
A: 

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.

IanH