A. API reference ..................................................................................................................29
procedure AddDomainForResourceString (domain:string);...............................29
procedure RemoveDomainForResourceString (domain:string); ........................29
function LoadResString(ResStringRec: PResStringRec): widestring;.................29
function LoadResStringW(ResStringRec: PResStringRec): widestring;.............29
function LoadResStringA(ResStringRec: PResStringRec): ansistring; ...............29
var ExecutableFilename:string; ................................................................................29
procedure HookIntoResourceStrings (enabled:boolean=true;
SupportPackages:boolean=false);...................................................................29
const DebugLogFilename=’c:\dxgettext-log.txt’; .................................................30
TExecutable.................................................................................................................30
TGetPluralForm..........................................................................................................30
TGnuGettextInstance class........................................................................................30
procedure UseLanguage(LanguageCode: string); ................................................30
function _(msg:widestring):widestring; .................................................................31
function GetCurrentLanguage:string;.....................................................................31
function gettext(msg:widestring):widestring; .......................................................31
function dgettext(Domain: string; MsgId: widestring): widestring; ..................32
function ngettext(const
singular,plural:widestring;Number:longint):widestring;...........................32
function dnget-
text(Domain,singular,plural:widestring;Number:longint):widestring;
32
function getcurrenttextdomain:string;....................................................................32
procedure textdomain(Domain:string); ..................................................................32
procedure bindtextdomain(Domain:string; Directory:string);............................33
procedure bindtextdomainToFile (Domain,Filename:string); .............................33
procedure GetListOfLanguages (domain:string; list:TStrings); ..........................33
function GetTranslationProperty (Propertyname:string):WideString;...............34
function GetTranslatorNameAndEmail:widestring;.............................................34
procedure SaveUntranslatedMsgids(filename: string);........................................34
procedure TranslateProperties(AnObject:TObject; textdomain:string=”); ........34
procedure TranslateComponent(AnObject: TComponent;
TextDomain:string=”); .....................................................................................35
function TP_CreateRetranslator:TExecutable;.......................................................35
procedure TP_Ignore(AnObject:TObject; const name:string);.............................35
procedure TP_GlobalIgnoreClass (IgnClass:TClass); ...........................................35
procedure TP_GlobalIgnoreClassProperty
(IgnClass:TClass;propertyname:string);........................................................35
procedure TP_GlobalHandleClass (HClass:TClass;Handler:TTranslator); .......36
B. "Hello, World" source code...........................................................................................37
Sample.dpr ..................................................................................................................37
gginitializer.pas...........................................................................................................37
SampleForm.pas.........................................................................................................37
SampleForm.dfm........................................................................................................38
C. Dxgettext command-line tools reference...................................................................41
assemble.......................................................................................................................41
dfntopo.........................................................................................................................41
dxgettext ......................................................................................................................41
dxgreg ..........................................................................................................................42
ixtopo ...........................................................................................................................42
msgimport ...................................................................................................................43
msgmergePOT............................................................................................................43
msgmkignore ..............................................................................................................44
msgremove..................................................................................................................44
msgshowheader..........................................................................................................44
msgsplitTStrings.........................................................................................................45
msgstripCR..................................................................................................................45
iv