hedgewars/uLocale.pas
branchios-revival
changeset 11141 01e8e5a6a8c1
parent 10249 b47ac2c19de3
child 11151 5c40c65b619d
equal deleted inserted replaced
11140:3fbe54013b2b 11141:01e8e5a6a8c1
    28 function  Format(fmt: shortstring; var arg: shortstring): shortstring;
    28 function  Format(fmt: shortstring; var arg: shortstring): shortstring;
    29 function  FormatA(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(path: pchar; filename: pchar); cdecl; export;
    34 {$ENDIF}
    34 {$ENDIF}
    35 
    35 
    36 implementation
    36 implementation
    37 uses uRandom, uUtils, uVariables, uDebug, uPhysFSLayer;
    37 uses uRandom, uUtils, uVariables, uDebug, uPhysFSLayer;
    38 
    38 
   131 else
   131 else
   132     FormatA:= copy(fmt, 1, i - 1) + arg + FormatA(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(path: pchar; filename: pchar); cdecl; export;
   137 begin
   137 begin
   138     LoadLocale(Strpas(str));
   138     PathPrefix := Strpas(path);
       
   139  
       
   140     uUtils.initModule(false);
       
   141     uPhysFSLayer.initModule;
       
   142  
       
   143     LoadLocale(Strpas(filename));
       
   144  
       
   145     uPhysFSLayer.freeModule;
       
   146     uUtils.freeModule;
   139 end;
   147 end;
   140 {$ENDIF}
   148 {$ENDIF}
   141 
   149 
   142 end.
   150 end.