You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.2 KiB
Plaintext
63 lines
1.2 KiB
Plaintext
{
|
|
This file is part of R&Q.
|
|
Under same license
|
|
}
|
|
unit RnQLangFrm;
|
|
{$I ForRnQConfig.inc}
|
|
|
|
interface
|
|
|
|
uses
|
|
SciterLib, RnQLangs, UtilLib;
|
|
|
|
function ShowLangsFrm(Lngs: aLangInfo): Integer;
|
|
|
|
implementation
|
|
|
|
{$I PubRTTI.inc}
|
|
type
|
|
TRnQLang = record
|
|
path, fn: string;
|
|
desc: String;
|
|
utf: Boolean;
|
|
idx: Integer;
|
|
end;
|
|
{$I NoRTTI.inc}
|
|
|
|
function ShowLangsFrm(Lngs: aLangInfo): Integer;
|
|
var
|
|
I: Integer;
|
|
Langs: array of TRnQLang;
|
|
LangsVar: TParams;
|
|
begin
|
|
if Length(lngs) <= 1 then
|
|
begin
|
|
Result := Length(lngs) - 1;
|
|
Exit;
|
|
end;
|
|
|
|
SetLength(Langs, Length(Lngs) + 1);
|
|
SetLength(LangsVar, Length(Lngs) + 1);
|
|
|
|
Langs[0].desc := 'Original (English)';
|
|
Langs[0].path := '';
|
|
Langs[0].fn := '';
|
|
Langs[0].idx := -5;
|
|
Langs[0].utf := True;
|
|
LangsVar[0] := UI.RecordToVar(Langs[0]);
|
|
|
|
for I := 0 to Length(lngs) - 1 do
|
|
begin
|
|
Langs[I + 1].desc := lngs[i].desc;
|
|
Langs[I + 1].path := lngs[i].fn;
|
|
Langs[I + 1].fn := lngs[i].subFile;
|
|
Langs[I + 1].idx := I;
|
|
// Langs[I + 1].utf := lngs[i].isUTF;
|
|
LangsVar[I + 1] := UI.RecordToVar(Langs[I + 1]);
|
|
end;
|
|
|
|
Result := UI.OpenLangs(LangsVar);
|
|
end;
|
|
|
|
end.
|