gettext: Pascal
1
1 15.5.14 Pascal - Free Pascal Compiler
1 -------------------------------------
1
1 RPMs
1 fpk
1
1 File extension
1 ‘pp’, ‘pas’
1
1 String syntax
1 ‘'abc'’
1
1 gettext shorthand
1 automatic
1
1 gettext/ngettext functions
1 —, use ‘ResourceString’ data type instead
1
1 textdomain
1 —, use ‘TranslateResourceStrings’ function instead
1
1 bindtextdomain
1 —, use ‘TranslateResourceStrings’ function instead
1
1 setlocale
1 automatic, but uses only LANG, not LC_MESSAGES or LC_ALL
1
1 Prerequisite
1 ‘{$mode delphi}’ or ‘{$mode objfpc}’
1 ‘uses gettext;’
1
1 Use or emulate GNU gettext
1 emulate partially
1
1 Extractor
1 ‘ppc386’ followed by ‘xgettext’ or ‘rstconv’
1
1 Formatting with positions
1 ‘uses sysutils;’
1 ‘format "%1:d %0:d"’
1
1 Portability
1 ?
1
1 po-mode marking
1 —
1
1 The Pascal compiler has special support for the ‘ResourceString’ data
1 type. It generates a ‘.rst’ file. This is then converted to a ‘.pot’
1 file by use of ‘xgettext’ or ‘rstconv’. At runtime, a ‘.mo’ file
1 corresponding to translations of this ‘.pot’ file can be loaded using
1 the ‘TranslateResourceStrings’ function in the ‘gettext’ unit.
1
1 An example is available in the ‘examples’ directory: ‘hello-pascal’.
1