hedgewars/uLocale.pas
changeset 7069 bcf9d8e64e92
parent 7049 35d762458d66
child 8026 4a4f21070479
child 8028 dc30104660d3
equal deleted inserted replaced
7068:b1b7eb9c8cc9 7069:bcf9d8e64e92
    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  Format(fmt: shortstring; var arg: shortstring): shortstring;
    28 function  Format(fmt: shortstring; var arg: shortstring): shortstring;
    29 function  Format(fmt: ansistring; var arg: ansistring): ansistring;
    29 function  FormatA(fmt: ansistring; var arg: ansistring): ansistring;
    30 function  GetEventString(e: TEventId): ansistring;
    30 function  GetEventString(e: TEventId): ansistring;
    31 
    31 
    32 {$IFDEF HWLIBRARY}
    32 {$IFDEF HWLIBRARY}
    33 procedure LoadLocaleWrapper(str: pchar); cdecl; export;
    33 procedure LoadLocaleWrapper(str: pchar); cdecl; export;
    34 {$ENDIF}
    34 {$ENDIF}
   120     Format:= fmt
   120     Format:= fmt
   121 else
   121 else
   122     Format:= copy(fmt, 1, i - 1) + arg + Format(copy(fmt, i + 2, Length(fmt) - i - 1), arg)
   122     Format:= copy(fmt, 1, i - 1) + arg + Format(copy(fmt, i + 2, Length(fmt) - i - 1), arg)
   123 end;
   123 end;
   124 
   124 
   125 function Format(fmt: ansistring; var arg: ansistring): ansistring;
   125 function FormatA(fmt: ansistring; var arg: ansistring): ansistring;
   126 var i: LongInt;
   126 var i: LongInt;
   127 begin
   127 begin
   128 i:= Pos('%1', fmt);
   128 i:= Pos('%1', fmt);
   129 if i = 0 then
   129 if i = 0 then
   130     Format:= fmt
   130     FormatA:= fmt
   131 else
   131 else
   132     Format:= copy(fmt, 1, i - 1) + arg + Format(copy(fmt, i + 2, Length(fmt) - i - 1), arg)
   132     FormatA:= copy(fmt, 1, i - 1) + arg + FormatA(copy(fmt, i + 2, Length(fmt) - i - 1), arg)
   133 end;
   133 end;
   134 
   134 
   135 {$IFDEF HWLIBRARY}
   135 {$IFDEF HWLIBRARY}
   136 procedure LoadLocaleWrapper(str: pchar); cdecl; export;
   136 procedure LoadLocaleWrapper(str: pchar); cdecl; export;
   137 begin
   137 begin