Changeset 79


Ignore:
Timestamp:
Aug 2, 2016, 10:06:50 PM (8 years ago)
Author:
chronos
Message:
  • Fixed: Use correct path for language files under Linux.
Location:
trunk
Files:
1 deleted
5 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
  • trunk/Install/deb/build-deb-amd64.sh

    r49 r79  
    77cat >AcronymDecoder/DEBIAN/control << EOF
    88Package: AcronymDecoder
    9 Version: 1.0.1
     9Version: 1.2.0
    1010Section: custom
    1111Priority: optional
    1212Architecture: amd64
    1313Essential: no
    14 Installed-Size: 6461192
    1514Maintainer: Chronos <robie@centrum.cz>
    16 Description: A tool for quick searching of acronym meaning
     15Description: A tool for quick searching of acronym or abbreviaton meaning
    1716HomePage: http://svn.zdechov.net/trac/AcronymDecoder
    1817EOF
  • trunk/Install/deb/build-deb-i386.sh

    r49 r79  
    77cat >AcronymDecoder/DEBIAN/control << EOF
    88Package: AcronymDecoder
    9 Version: 1.0.1
     9Version: 1.2.0
    1010Section: custom
    1111Priority: optional
    1212Architecture: i386
    1313Essential: no
    14 Installed-Size: 6461192
    1514Maintainer: Chronos <robie@centrum.cz>
    1615Description: A tool for quick searching of acronym meaning
  • trunk/Packages/Common/Languages/UJobProgressView.cs.po

    r54 r79  
    3939msgid "Total estimated time: %s"
    4040msgstr "Celkový odhadovaný čas: %s"
     41
  • trunk/Packages/CoolTranslator/UCoolTranslator.pas

    r43 r79  
    4646    procedure TranslateProperty(Component: TPersistent; PropInfo: PPropInfo);
    4747    function IsExcluded(Component: TPersistent; PropertyName: string): Boolean;
     48    function GetLangFileDir: string;
    4849  public
    4950    ComponentExcludes: TComponentExcludesList;
     
    161162    if LocaleShort <> '' then SearchMask := SearchMask + '.' + LocaleShort;
    162163    SearchMask := SearchMask + '.po';
    163     FileList := FindAllFiles(ExtractFileDir(UTF8Encode(Application.ExeName)) +
    164       DirectorySeparator + FPOFilesFolder, SearchMask);
     164    FileList := FindAllFiles(GetLangFileDir, SearchMask);
    165165    for I := 0 to FileList.Count - 1 do begin
    166166      FileName := FileList[I];
     
    180180  FPoFilesFolder := AValue;
    181181  ReloadFiles;
     182  CheckLanguageFiles;
    182183end;
    183184
     
    290291end;
    291292
     293function TCoolTranslator.GetLangFileDir: string;
     294begin
     295  Result := FPOFilesFolder;
     296  if Copy(Result, 1, 1) <> DirectorySeparator then
     297    Result := ExtractFileDir(UTF8Encode(Application.ExeName)) +
     298      DirectorySeparator + Result;
     299end;
     300
    292301procedure TCoolTranslator.LanguageListToStrings(Strings: TStrings);
    293302var
     
    349358var
    350359  I: Integer;
    351 begin
     360  LangDir: string;
     361begin
     362  LangDir := GetLangFileDir;
    352363  TLanguage(Languages[0]).Available := True; // Automatic
    353364
    354365  for I := 1 to Languages.Count - 1 do
    355366  with TLanguage(Languages[I]) do begin
    356     Available := FileExists(ExtractFileDir(UTF8Encode(Application.ExeName)) +
    357       DirectorySeparator + POFilesFolder + DirectorySeparator + ExtractFileNameOnly(Application.ExeName) +
     367    Available := FileExists(LangDir + DirectorySeparator + ExtractFileNameOnly(Application.ExeName) +
    358368      '.' + Code + ExtensionSeparator + 'po') or (Code = 'en');
    359369  end;
Note: See TracChangeset for help on using the changeset viewer.