| GNU gettext for Delphi, C++ Builder and Kylix 1.2 beta | ||
|---|---|---|
| <<< Previous | Action | Next >>> |
A typical problem with Delphi is to create a program in a non-English language, because the runtime library is in English. You can easily put a chinese caption on a button, but you cannot easily make the "Division by zero" message turn chinese, because that message is hidden deeply in the Delphi runtime library. With GNU gettext for Delphi, you can easily solve this problem:
Install GNU gettext for Delphi
Add gnugettext.pas to your project.
Get the default.po file for the Delphi runtime libraries and translate it to your language. Maybe there is already a translation for your language online.
Compile the default.po file to a default.mo file by clicking on it with the right mouse button and choose "compile to .mo file".
Create a locale\LL\LC_MESSAGES subdirectory to where your exe file is, where LL is the two letter ISO 639 language code (see the Section called ISO 639 language codes in the appendix called Standards>) of the language that your program uses (da for danish, de for german etc.) and put your default.mo file there.
Give your translations to us, so that other people may use your translation.
In order to have one .exe file that contains everything, including the translations, you can now click with the right mouse button on the executable, and choose "Embed translations". This will append the default.mo file, that is in the locale\LL\LC_MESSAGES subdirectory into the .exe file. Please note that you have to do this every time that you have compiled and generated a new .exe file.
| <<< Previous | Home | Next >>> |
| New program versions, old translation files | Up | Uses clauses |