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