1@c This file is part of the GNU gettext manual. 2@c Copyright (C) 1995-2020 Free Software Foundation, Inc. 3@c See the file gettext.texi for copying conditions. 4 5@node Pascal 6@subsection Pascal - Free Pascal Compiler 7@cindex Pascal 8@cindex Free Pascal 9@cindex Object Pascal 10 11@table @asis 12@item RPMs 13fpk 14 15@item Ubuntu packages 16fp-compiler, fp-units-fcl 17 18@item File extension 19@code{pp}, @code{pas} 20 21@item String syntax 22@code{'abc'} 23 24@item gettext shorthand 25automatic 26 27@item gettext/ngettext functions 28---, use @code{ResourceString} data type instead 29 30@item textdomain 31---, use @code{TranslateResourceStrings} function instead 32 33@item bindtextdomain 34---, use @code{TranslateResourceStrings} function instead 35 36@item setlocale 37automatic, but uses only LANG, not LC_MESSAGES or LC_ALL 38 39@item Prerequisite 40@code{@{$mode delphi@}} or @code{@{$mode objfpc@}}@*@code{uses gettext;} 41 42@item Use or emulate GNU gettext 43emulate partially 44 45@item Extractor 46@code{ppc386} followed by @code{xgettext} or @code{rstconv} 47 48@item Formatting with positions 49@code{uses sysutils;}@*@code{format "%1:d %0:d"} 50 51@item Portability 52? 53 54@item po-mode marking 55--- 56@end table 57 58The Pascal compiler has special support for the @code{ResourceString} data 59type. It generates a @code{.rst} file. This is then converted to a 60@code{.pot} file by use of @code{xgettext} or @code{rstconv}. At runtime, 61a @code{.mo} file corresponding to translations of this @code{.pot} file 62can be loaded using the @code{TranslateResourceStrings} function in the 63@code{gettext} unit. 64 65An example is available in the @file{examples} directory: @code{hello-pascal}. 66