| 1 |
{ |
| 2 |
Double Commander |
| 3 |
------------------------------------------------------------------------- |
| 4 |
Rar archiver plugin, language support |
| 5 |
|
| 6 |
Copyright (C) 2023 Alexander Koblov ([email protected]) |
| 7 |
|
| 8 |
This library is free software; you can redistribute it and/or |
| 9 |
modify it under the terms of the GNU Lesser General Public |
| 10 |
License as published by the Free Software Foundation; either |
| 11 |
version 2.1 of the License, or (at your option) any later version. |
| 12 |
|
| 13 |
This library is distributed in the hope that it will be useful, |
| 14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 |
Lesser General Public License for more details. |
| 17 |
|
| 18 |
You should have received a copy of the GNU Lesser General Public |
| 19 |
License along with this library; if not, write to the Free Software |
| 20 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 21 |
} |
| 22 |
|
| 23 |
unit RarLng; |
| 24 |
|
| 25 |
{$mode delphi} |
| 26 |
|
| 27 |
interface |
| 28 |
|
| 29 |
uses |
| 30 |
Classes, SysUtils; |
| 31 |
|
| 32 |
resourcestring |
| 33 |
rsMsgButtonCancel = '&Cancel'; |
| 34 |
rsMsgButtonExtract = '&Extract'; |
| 35 |
rsDictLargeWarning = 'Large dictionary warning'; |
| 36 |
rsMsgPasswordEnter = 'Please enter the password:'; |
| 37 |
rsDictNotAllowed = '%u GB dictionary exceeds %u GB limit and needs more than %u GB memory to unpack.'; |
| 38 |
rsMsgLibraryNotFound = 'Cannot load library %s! Please check your installation.'; |
| 39 |
rsMsgExecutableNotFound = 'Cannot find RAR executable!'#10#10'%s'#10#10'Please check the plugin settings.'; |
| 40 |
|
| 41 |
procedure TranslateResourceStrings; |
| 42 |
|
| 43 |
implementation |
| 44 |
|
| 45 |
uses |
| 46 |
UnRARFunc; |
| 47 |
|
| 48 |
function Translate(Name, Value: AnsiString; Hash: LongInt; Arg: Pointer): AnsiString; |
| 49 |
var |
| 50 |
ALen: Integer; |
| 51 |
begin |
| 52 |
with gStartupInfo do |
| 53 |
begin |
| 54 |
SetLength(Result, MaxSmallint); |
| 55 |
ALen:= TranslateString(Translation, PAnsiChar(Name), PAnsiChar(Value), PAnsiChar(Result), MaxSmallint); |
| 56 |
SetLength(Result, ALen); |
| 57 |
end; |
| 58 |
end; |
| 59 |
|
| 60 |
procedure TranslateResourceStrings; |
| 61 |
begin |
| 62 |
if Assigned(gStartupInfo.Translation) then |
| 63 |
begin |
| 64 |
SetResourceStrings(@Translate, nil); |
| 65 |
end; |
| 66 |
end; |
| 67 |
|
| 68 |
end. |
| 69 |
|