GetText unit
Unit implementing resource string translation using gettext files.
The gettext unit can be used to hook into the resource string mechanism
of Free Pascal to provide translations of the resource strings, based on the
GNU gettext mechanism. The unit provides a class (TMOFile) to read
the .mo files with localizations for various languages. It
also provides a couple of calls to translate all resource strings in an
application based on the translations in a .mo file.
Classes and records
EMOFileError | class | Exception raised in case of an error. |
TMOFile | class | Class providing access to a .mo file. |
TMOFileHeader | record | Structure found at the head of a .mo file. |
TMOStringInfo | record | Structure describing string. |
Procedures and functions
GetLanguageIDs | procedure | Return the current language IDs. |
TranslateResourceStrings | procedure | Translate the resource strings of the application. |
TranslateUnitResourceStrings | procedure | Translate the resource strings of a unit. |
Types
PLongWordArray | type | Pointer to a TLongWordArray array. |
PMOStringTable | type | Pointer to a TMOStringTable array. |
PPCharArray | type | Pointer to a TPCharArray array. |
TLongWordArray | type | Array of longword elements. |
TMOStringTable | type | Array of TMOStringInfo records. |
TPCharArray | type | Array of PChar elements. |
TTranslationErrorHandler | procedure type |
Constants
MOFileHeaderMagic | constant | file header bytes indicating a .mo file. |
Variables
OnTranslationError | variable |
Uses
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
