Advertisement
Guest User

patch

a guest
Mar 23rd, 2011
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.92 KB | None | 0 0
  1. --- unit1.pas   2011-01-25 00:27:02.000000000 -0500
  2. +++ unit2.pas   2011-03-23 16:24:16.234563500 -0400
  3. @@ -23,13 +23,13 @@
  4.  interface
  5.  
  6.  uses
  7. -  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,
  8. +  Classes, LResources, Forms, Controls, Graphics, Dialogs,
  9.    {$IFDEF WIN32} windows, shellapi, dos,{$endif}
  10.    {$IFDEF unix} baseunix, unix, {$endif}
  11.    laz_xmlcfg, dom, xmlread, xmlwrite, StdCtrls, Buttons, ActnList, Menus, unit2, unit3,
  12.    unit4, unit5, gettext, translations, process
  13.    {$IFDEF TRANSLATESTRING}, DefaultTranslator{$ENDIF}, ExtCtrls, ComCtrls, MaskEdit, Spin,
  14. -  PoTranslator;
  15. +  PoTranslator, SysUtils;
  16.  
  17.  type
  18.  
  19. @@ -309,7 +309,7 @@
  20.                      // start setup
  21.    {$IFDEF WIN32}
  22.    ansicodepage:=getacp();
  23. -  presetspath :=GetappdataPath() + '\Winff\';
  24. +  presetspath :=extraspath + '\config\';
  25.  
  26.    if not DirectoryExists(presetspath) then
  27.      createdir(presetspath);
  28. @@ -963,12 +963,7 @@
  29.  var
  30.    ppidl: PItemIdList;
  31.  begin
  32. -  ppidl := nil;
  33. -  SHGetSpecialFolderLocation(frmMain.Handle,CSIDL_APPDATA , ppidl);
  34. -  SetLength(Result, MAX_PATH);
  35. -   if not SHGetPathFromIDList(ppidl, PChar(Result)) then
  36. -        raise exception.create('SHGetPathFromIDList failed : invalid pidl');
  37. -   SetLength(Result, lStrLen(PChar(Result)));
  38. + result := extraspath;
  39.  end;
  40.  {$endif}
  41.  {$ifdef unix}
  42. @@ -1818,11 +1813,15 @@
  43.    {$I unit1.lrs}
  44.    {$ifdef win32}PODirectory := extraspath + '\languages\'{$endif};
  45.    {$ifdef unix}PODirectory := '/usr/share/winff/languages/'{$endif};
  46. +  Lang := GetEnvironmentVariable('LC_ALL');
  47. +  FallbackLang := '';
  48. +  if Lang = '' then
  49. +  Lang := GetEnvironmentVariable('LANG');
  50. +  if Lang = '' then
  51.    GetLanguageIDs(Lang, FallbackLang); // in unit gettext
  52.    POFile := PODirectory + 'winff.' + Lang + '.po';
  53.    if not FileExists(POFile) then
  54.       POFile := PODirectory + 'winff.' + FallbackLang + '.po';
  55. -
  56.    if FileExists(POFile) then
  57.    begin
  58.      try
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement