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
for a given application, the following steps must be followed:
- Collect all resource string files and concatenate them together.
- Invoke the rstconv program with the file resulting out of step 1, resulting in a single
.po file containing all resource strings of the program.
- Translate the .po file of step 2 in all required languages.
- Run the msgfmt formatting program on all the .po files, resulting in a set of .mo files,
which can be distributed with your application.
- Call the gettext unit’s TranslateResourceStrings method, giving it a template for the
location of the .mo files, e.g. as in
the %s specifier will be replaced by the contents of the LANG environment variable. This call
should happen at program startup.
An example program exists in the FCL-base sources, in the fcl-base/tests directory.