Ignore:
Timestamp:
Aug 2, 2016, 10:06:50 PM (8 years ago)
Author:
chronos
Message:
  • Fixed: Use correct path for language files under Linux.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.pas

    r75 r79  
    99  ComCtrls, StdCtrls, ExtCtrls, ActnList, UAcronym, UPersistentForm, URegistry,
    1010  ULastOpenedList, UListViewSort, UJobProgressView, UCoolTranslator, Registry,
    11   SpecializedList, LazUTF8;
     11  SpecializedList, LazUTF8, LazFileUtils;
    1212
    1313type
     
    167167  ProjectExt = '.adp';
    168168  DefaultFileName = 'Acronyms' + ProjectExt;
    169   DefaultRegKey = '\Software\Acronym Decoder';
     169  DefaultRegKey = '\Software\Chronosoft\Acronym Decoder';
    170170  RegistryRunKey = '\Software\Microsoft\Windows\CurrentVersion\Run';
    171171  ExampleFile = 'Example acronyms.adp';
     
    480480    LoadConfig;
    481481
    482 {$IFDEF 0}
     482    {$IFDEF 0}
    483483    if Application.HasOption('h', 'help') then begin
    484484      WriteLn('AcronymDecoder <project file>');
     
    488488      Exit;
    489489    end;
    490 {$ENDIF}
     490    {$ENDIF}
     491
    491492    if Application.HasOption('t', 'tray') then begin
    492493      Visible := False;
     
    504505    end else begin
    505506      // Open default database with examples if no item is in recent openned history
    506       ProjectOpen(ExtractFileDir(Application.ExeName) + DirectorySeparator + ExampleFile);
     507      FileNameOption := ExtractFileDir(Application.ExeName) + DirectorySeparator + ExampleFile;
     508      {$IFDEF Linux}
     509      // If installed in Linux system then use installation directory for po files
     510      if Application.ExeName = '/usr/bin/' + ExtractFileNameOnly(Application.ExeName) then
     511        FileNameOption := '/usr/share/' + ExtractFileNameOnly(Application.ExeName) + '/Examples/' + ExampleFile;
     512      {$ENDIF}
     513      ProjectOpen(FileNameOption);
    507514    end;
    508515    UpdateAcronymsList;
     
    620627  LastOpenedList1.LoadFromRegistry(RegistryContext);
    621628
     629  {$IFDEF Linux}
     630  // If installed in Linux system then use installation directory for po files
     631  if Application.ExeName = '/usr/bin/' + ExtractFileNameOnly(Application.ExeName) then
     632    CoolTranslator1.POFilesFolder := '/usr/share/' + ExtractFileNameOnly(Application.ExeName) + '/languages';
     633  {$ENDIF}
     634
    622635  with TRegistryEx.Create do
    623636  try
Note: See TracChangeset for help on using the changeset viewer.