equal
deleted
inserted
replaced
23 uses uTypes; |
23 uses uTypes; |
24 |
24 |
25 const MAX_EVENT_STRINGS = 100; |
25 const MAX_EVENT_STRINGS = 100; |
26 |
26 |
27 procedure LoadLocale(FileName: shortstring); |
27 procedure LoadLocale(FileName: shortstring); |
|
28 function FormatPChar(fmt: PChar; arg: PChar): PChar; |
28 function Format(fmt: shortstring; var arg: shortstring): shortstring; |
29 function Format(fmt: shortstring; var arg: shortstring): shortstring; |
29 function FormatA(fmt: PChar; arg: ansistring): ansistring; |
30 function FormatA(fmt: PChar; arg: ansistring): ansistring; |
30 function GetEventString(e: TEventId): PChar; |
31 function GetEventString(e: TEventId): PChar; |
31 procedure initModule; |
32 procedure initModule; |
32 procedure freeModule; |
33 procedure freeModule; |
107 GetEventString:= '*missing translation*' |
108 GetEventString:= '*missing translation*' |
108 else |
109 else |
109 GetEventString:= trevt[e][GetRandom(trevt_n[e])]; // Pick a random message and return it |
110 GetEventString:= trevt[e][GetRandom(trevt_n[e])]; // Pick a random message and return it |
110 end; |
111 end; |
111 |
112 |
|
113 function FormatPChar(fmt: PChar; arg: PChar): PChar; |
|
114 var |
|
115 s: shortstring; |
|
116 begin |
|
117 s:= arg; |
|
118 FormatPChar:= Str2PChar(FormatA(fmt, s)); |
|
119 end; |
|
120 |
112 function Format(fmt: shortstring; var arg: shortstring): shortstring; |
121 function Format(fmt: shortstring; var arg: shortstring): shortstring; |
113 var i: LongInt; |
122 var i: LongInt; |
114 begin |
123 begin |
115 i:= Pos('%1', fmt); |
124 i:= Pos('%1', fmt); |
116 if i = 0 then |
125 if i = 0 then |