GNU gettext
The unit gettext provides a way to internationalize an application with the GNU gettext utilities. This unit is supplied with the Free Component Library (FCL). it can be used as follows:
for a given application, the following steps must be followed:
Collect all resource string files and concatenate them together.
Invoke the
rstconvprogram with the file resulting out of step 1, resulting in a single.pofile containing all resource strings of the program.Translate the
.pofile of step 2 in all required languages.Run the
msgfmtformatting program on all the.pofiles, resulting in a set of.mofiles, which can be distributed with your application.Call the
gettextunit’sTranslateResourceStringsmethod, giving it a template for the location of the.mofiles, e.g. as inTranslateResourcestrings('intl/restest.%s.mo');the
%sspecifier will be replaced by the contents of theLANGenvironment variable. This call should happen at program startup.
An example program restest.pp exists in the FCL-base sources, in the fcl-base/examples directory.
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
