2. Multilanguage Driver

The pgExpress Driver distribution contains two versions: a standard one, English only, and a Multilanguage version. Functionality is identical, except that the standard only contains the English (enUS) language, and the multilanguage version contains all languages from the table below:

Table 3.2. Embedded languages in this release (multilanguage driver only)

LanguageLanguage Code
EnglishenUS
Portuguese (Brazilian)ptBR

This by no means limits the languages that can be used with the pgExpress Driver; you can always do a new translation and load it. Instructions are in the next section.

Note

The English language will be used by default, unless some other valid language is used.

To set localized messages, choose among the following methods:

  1. Do nothing!... If you use the multilanguage driver and it already has the same language reported by your OS, it will be loaded automatically. The same will happen if you have a directory locale\LL\LC_MESSAGES with a xx_XX.mo file that matches your language. Check the dxgettext documentation for details.

    Use the ErrorResourceFile parameter, with the xx_XX.mo language file. This parameter will be passed by the VCL/CLX to the pgExpress Driver, so it's the recommended standard way to handle languages.

  2. Use the Language special parameter. Set it to match one of the language codes of the Supported languages table.

    Example 3.1. 

    [PGEConnection]
    BlobSize=32
    Database=localhost/mydb,Language=deDE
    DriverName=PostgreSQL
    Password=temp123
    User_Name=john

    Note

    This example assumes the deDE (German) language is embedded in the multilanguage driver.

    These entries represent the languages embedded on the multilanguage driver. If the language is not supported by the driver, or if you're not using the multilanguage version of the driver, this parameter will be ignored.

  3. Call the PGEDriverUtils.SetLanguage() function, passing the language code as parameter (embedded languages only).

If you want to translate the pgExpress Driver to another language not listed in here, just translate the default.po (English) file. To customize/fix and existing translation, just edit it's .po file. Check the next section for details.

A language code usually consists of a two-letter lowercase language code, an underscore, and a two-letter uppercase country code. On Windows, this is not case sensitive, but on Linux, it is. German in Germany becomes de_DE, English in England becomes en_GB, etc.

If you translate to a new language, please consider contributing it to other users by sending the file to us. I this case, fill your translator's data at the .po file header if you want.

Tip

You might want also to translate the libpq library and/or PostgreSQL itself to get translated PostgreSQL error messages. Please refer to the PostgreSQL's documentation for details.