Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What technique would be the least effort to internationalise (at least multi-language) existing Delphi Applications?

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?

like image 768
Johan Bresler Avatar asked Dec 06 '22 07:12

Johan Bresler


2 Answers

We are using TsiLang and are very happy with it.

One of the best points is that you can pretranslate the project with a dictionary (which you filled from existing translations).

like image 83
gabr Avatar answered Jan 05 '23 01:01

gabr


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.

like image 36
Davy Landman Avatar answered Jan 05 '23 00:01

Davy Landman