Sign in Join
FPDoc Onlineexperiment

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

EMOFileErrorclassException raised in case of an error.
TMOFileclassClass providing access to a .mo file.
TMOFileHeaderrecordStructure found at the head of a .mo file.
TMOStringInforecordStructure describing string.

Procedures and functions

GetLanguageIDsprocedureReturn the current language IDs.
TranslateResourceStringsprocedureTranslate the resource strings of the application.
TranslateUnitResourceStringsprocedureTranslate the resource strings of a unit.

Types

PLongWordArraytypePointer to a TLongWordArray array.
PMOStringTabletypePointer to a TMOStringTable array.
PPCharArraytypePointer to a TPCharArray array.
TLongWordArraytypeArray of longword elements.
TMOStringTabletypeArray of TMOStringInfo records.
TPCharArraytypeArray of PChar elements.
TTranslationErrorHandlerprocedure type

Constants

MOFileHeaderMagicconstantfile header bytes indicating a .mo file.

Variables

OnTranslationErrorvariable

Uses

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.