Translate OExport to your language

OExport comes with the following translations: English (default), German, Czech, French, Hungarian, Dutch.
If you translated OExport to your language, you are welcome to send me the language file and I'll add it to the OExport package.

Use a prepared translation file

Add the OExportLNG_** to your uses clause and call OExportLNG_**.Translate. (Use a language definition instead of **, e.g. "DE").

Create a new translation

OExportLNG.pas

All OExport language definitions can be found in OExportLNG.pas. To assure Lazarus, non-unicode Delphi and unicode Delphi support, you cannot use international characters in pascal units. Therefore I prepared a simple translation class that works independently on the IDE and OS used.

(If you only need Delphi 2009+ support, you can just change the language variables in run-time in a Delphi unit.)

Create your own language file

Navigate to the directory OEXPORT\translations. There you have to create an own .lng file (e.g. OExportLNG_PL.lng for Polish language) and translate it.
Please note that all language definitions miss the "OExportLNG_" prefix of the variables.

If you have the .lng you either send it to me to include it to OExport or continue with this tutorial.

Modify the file "OExportLNG.bat", add your a command for .lng file to a new line. You'll also have to change the path of lazres.exe (from your Lazarus installation).

Then create an OExport_**.pas file in the units directory with the following contents (replace ** with your language constant):

unit OExportLNG_**;

interface

procedure Translate;

implementation

uses
  OExportLNG;

procedure Translate;
begin
  {$I OExportLNG_**.inc}
end;

end.

You'll be then able to use OExportLNG_**.pas in your Pascal project and a call to OExportLNG_**.Translate translates OExport to your language.

Categories