GNU gettext for Delphi, C++ Builder and Kylix 1.2 beta
<<< Previous | Experienced programmers' topics | Next >>>

# Directives

It is possible to control the string extraction from Pascal source code using directives, very much like the compiler directives. Currently, the directives only support extraction of string constants defined using the `const` keyword, into a specified text domain:

    {gnugetext: scan-all [text-domain='domain name'] }
    .
    . in this section the string constants will be extracted
    .
    {gnugettext: reset }

`{gnugettext: scan-all }` is named the 'start directive' in this document. `{gnugettext: reset }` is named the 'end directive' in this document.

If a start directive exists, the end one must exist in the same file. The directives are local to a file. Several start directive can exists before the end one and is used to change the target domain. This directive actually works for constants only! Initialized variables are not taken in care. The domain name, if present, must be enclosed by single quote. If the domain name include a single quote (but remember that the domain name will becomes a file name), it must be doubled. There are no check on the domain name. It is assumed that you know what you type!

| Example:
    {gnugettext: scan-all text-domain='toto' }
    Const
      a = 'toto';
    {gnugettext: scan-all text-domain='titi' }
      b = 'titi';
    {gnugettext: reset }
In this example, the msgid 'toto' will be put into `toto.po` and 'titi' will be put into the file named `titi.po`.

It is the plan to extend the directive system in the future to disable/enable string extraction etc.

<<< Previous | Home | Next >>>
Debugging | Up | Advanced topics