mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: FTP - more strings translation
This commit is contained in:
parent
a8c21bc879
commit
a46139cea0
4 changed files with 64 additions and 12 deletions
|
|
@ -38,7 +38,7 @@ implementation
|
|||
|
||||
uses
|
||||
LazUTF8, DynLibs, FtpUtils, blcksock, synaip, ssl_openssl_lib, libssh,
|
||||
FtpProxy, TypInfo;
|
||||
FtpProxy, FtpLng, TypInfo;
|
||||
|
||||
var
|
||||
Protocol: PtrInt;
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@
|
|||
<VersionInfo>
|
||||
<UseVersionInfo Value="True"/>
|
||||
<MinorVersionNr Value="3"/>
|
||||
<RevisionNr Value="5"/>
|
||||
<StringTable FileDescription="FTP WFX plugin for Double Commander" LegalCopyright="Copyright (C) 2006-2024 Alexander Koblov"/>
|
||||
<RevisionNr Value="6"/>
|
||||
<StringTable FileDescription="FTP WFX plugin for Double Commander" LegalCopyright="Copyright (C) 2006-2026 Alexander Koblov"/>
|
||||
</VersionInfo>
|
||||
<BuildModes Count="2">
|
||||
<Item1 Name="Release" Default="True"/>
|
||||
|
|
@ -98,7 +98,7 @@ end;"/>
|
|||
<PackageName Value="LazUtils"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="6">
|
||||
<Units Count="7">
|
||||
<Unit0>
|
||||
<Filename Value="ftp.dpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
|
|
@ -130,6 +130,11 @@ end;"/>
|
|||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="SftpSend"/>
|
||||
</Unit5>
|
||||
<Unit6>
|
||||
<Filename Value="ftplng.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="FtpLng"/>
|
||||
</Unit6>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
-------------------------------------------------------------------------
|
||||
Wfx plugin for working with File Transfer Protocol
|
||||
|
||||
Copyright (C) 2009-2023 Alexander Koblov (alexx2000@mail.ru)
|
||||
Copyright (C) 2009-2026 Alexander Koblov (alexx2000@mail.ru)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
|
|
@ -31,10 +31,6 @@ uses
|
|||
SysUtils, Classes,
|
||||
WfxPlugin, Extension;
|
||||
|
||||
const
|
||||
cAddConnection = '<Add connection>';
|
||||
cQuickConnection = '<Quick connection>';
|
||||
|
||||
type
|
||||
|
||||
{ TConnection }
|
||||
|
|
@ -125,7 +121,7 @@ implementation
|
|||
uses
|
||||
IniFiles, StrUtils, FtpAdv, FtpUtils, FtpConfDlg, syncobjs, LazFileUtils,
|
||||
LazUTF8, DCClassesUtf8, DCConvertEncoding, SftpSend, ScpSend, FtpProxy,
|
||||
FtpPropDlg, DCFileAttributes;
|
||||
FtpPropDlg, FtpLng, DCFileAttributes;
|
||||
|
||||
var
|
||||
DefaultIniName: String;
|
||||
|
|
@ -139,7 +135,6 @@ threadvar
|
|||
|
||||
const
|
||||
FS_COPYFLAGS_FORCE = FS_COPYFLAGS_OVERWRITE or FS_COPYFLAGS_RESUME;
|
||||
RootList: array [0 .. 1] of AnsiString = (cAddConnection, cQuickConnection);
|
||||
|
||||
type
|
||||
TListRec = record
|
||||
|
|
@ -609,12 +604,15 @@ end;
|
|||
|
||||
function LocalFindNext(Hdl: THandle; var FindData: TWin32FindDataW): Boolean;
|
||||
var
|
||||
ListRec: PListRec absolute Hdl;
|
||||
I, RootCount: Integer;
|
||||
Connection: TConnection;
|
||||
ListRec: PListRec absolute Hdl;
|
||||
RootList: array [0..1] of String;
|
||||
begin
|
||||
Result := False;
|
||||
I := ListRec^.Index;
|
||||
RootList[0]:= cAddConnection;
|
||||
RootList[1]:= cQuickConnection;
|
||||
RootCount := High(RootList) + 1;
|
||||
FillChar(FindData, SizeOf(FindData), 0);
|
||||
if I < RootCount then
|
||||
|
|
@ -1177,6 +1175,7 @@ procedure ExtensionInitialize(StartupInfo: PExtensionStartupInfo);
|
|||
begin
|
||||
gStartupInfo:= StartupInfo^;
|
||||
DefaultIniName:= gStartupInfo.PluginConfDir + DefaultIniName;
|
||||
TranslateResourceStrings;
|
||||
|
||||
try
|
||||
IniFile := TIniFileEx.Create(DefaultIniName, fmOpenReadWrite);
|
||||
|
|
|
|||
48
plugins/wfx/ftp/src/ftplng.pas
Normal file
48
plugins/wfx/ftp/src/ftplng.pas
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
unit FtpLng;
|
||||
|
||||
{$mode Delphi}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils;
|
||||
|
||||
var
|
||||
cAddConnection: String;
|
||||
cQuickConnection: String;
|
||||
|
||||
resourcestring
|
||||
rsAddConnection = 'Add connection';
|
||||
rsQuickConnection = 'Quick connection';
|
||||
|
||||
procedure TranslateResourceStrings;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
FtpFunc;
|
||||
|
||||
function Translate(Name, Value: AnsiString; Hash: LongInt; Arg: Pointer): AnsiString;
|
||||
var
|
||||
ALen: Integer;
|
||||
begin
|
||||
with gStartupInfo do
|
||||
begin
|
||||
SetLength(Result, MaxSmallint);
|
||||
ALen:= TranslateString(Translation, PAnsiChar(Name), PAnsiChar(Value), PAnsiChar(Result), MaxSmallint);
|
||||
SetLength(Result, ALen);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TranslateResourceStrings;
|
||||
begin
|
||||
if Assigned(gStartupInfo.Translation) then
|
||||
begin
|
||||
SetResourceStrings(@Translate, nil);
|
||||
end;
|
||||
cAddConnection:= '<' + rsAddConnection + '>';
|
||||
cQuickConnection:= '<' + rsQuickConnection + '>';
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue