mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-26 01:19:36 +02:00
Bug fix. Translate category names in the tree, reported by Péter Gábor(#31038)
git-svn-id: trunk@53554 -
This commit is contained in:
parent
41db170ef6
commit
d8b8e86cdf
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -3291,7 +3291,7 @@ components/onlinepackagemanager/languages/opkman_VirtualTrees.hu.po svneol=nativ
|
|||||||
components/onlinepackagemanager/languages/opkman_VirtualTrees.po svneol=native#text/plain
|
components/onlinepackagemanager/languages/opkman_VirtualTrees.po svneol=native#text/plain
|
||||||
components/onlinepackagemanager/languages/opkman_const.de.po svneol=native#text/plain
|
components/onlinepackagemanager/languages/opkman_const.de.po svneol=native#text/plain
|
||||||
components/onlinepackagemanager/languages/opkman_const.es.po svneol=native#text/plain
|
components/onlinepackagemanager/languages/opkman_const.es.po svneol=native#text/plain
|
||||||
components/onlinepackagemanager/languages/opkman_const.fi.po -text svneol=native#text/plain
|
components/onlinepackagemanager/languages/opkman_const.fi.po svneol=native#text/plain
|
||||||
components/onlinepackagemanager/languages/opkman_const.hu.po svneol=native#text/plain
|
components/onlinepackagemanager/languages/opkman_const.hu.po svneol=native#text/plain
|
||||||
components/onlinepackagemanager/languages/opkman_const.po svneol=native#text/plain
|
components/onlinepackagemanager/languages/opkman_const.po svneol=native#text/plain
|
||||||
components/onlinepackagemanager/languages/opkman_httpclient.fi.po -text svneol=native#text/plain
|
components/onlinepackagemanager/languages/opkman_httpclient.fi.po -text svneol=native#text/plain
|
||||||
|
@ -112,6 +112,7 @@ type
|
|||||||
function LoadPackageData(const APath: String; AData: PData): Boolean;
|
function LoadPackageData(const APath: String; AData: PData): Boolean;
|
||||||
procedure ShowHideControls(const AType: Integer);
|
procedure ShowHideControls(const AType: Integer);
|
||||||
procedure SaveExtraInfo(const ANode: PVirtualNode);
|
procedure SaveExtraInfo(const ANode: PVirtualNode);
|
||||||
|
function TranslateCategories(const AStr: String): String;
|
||||||
public
|
public
|
||||||
procedure InitializeFrame;
|
procedure InitializeFrame;
|
||||||
procedure FinalizeFrame;
|
procedure FinalizeFrame;
|
||||||
@ -727,6 +728,45 @@ begin
|
|||||||
pnBrowse.Enabled := True;
|
pnBrowse.Enabled := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCreateRepositoryPackagefr.TranslateCategories(const AStr: String): String;
|
||||||
|
var
|
||||||
|
SL: TStringList;
|
||||||
|
I, J: Integer;
|
||||||
|
Str: String;
|
||||||
|
begin
|
||||||
|
if Categories[0] = CategoriesEng[0] then
|
||||||
|
begin
|
||||||
|
Result := AStr;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
Result := '';
|
||||||
|
SL := TStringList.Create;
|
||||||
|
try
|
||||||
|
SL.Delimiter := ',';
|
||||||
|
SL.StrictDelimiter := True;
|
||||||
|
SL.DelimitedText := AStr;
|
||||||
|
for I := 0 to SL.Count - 1 do
|
||||||
|
begin
|
||||||
|
Str := Trim(SL.Strings[I]);
|
||||||
|
for J := 0 to MaxCategories - 1 do
|
||||||
|
begin
|
||||||
|
if Str = Categories[J] then
|
||||||
|
begin
|
||||||
|
if Result = '' then
|
||||||
|
Result := CategoriesEng[J]
|
||||||
|
else
|
||||||
|
Result := Result + ', ' + CategoriesEng[J];
|
||||||
|
Break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
SL.Free;
|
||||||
|
end;
|
||||||
|
if Result = '' then
|
||||||
|
Result := AStr;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCreateRepositoryPackagefr.DoOnZipCompleted(Sender: TObject);
|
procedure TCreateRepositoryPackagefr.DoOnZipCompleted(Sender: TObject);
|
||||||
var
|
var
|
||||||
SerializablePackages: TSerializablePackages;
|
SerializablePackages: TSerializablePackages;
|
||||||
@ -748,7 +788,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
RootData := FVSTPackages.GetNodeData(RootNode);
|
RootData := FVSTPackages.GetNodeData(RootNode);
|
||||||
Package := SerializablePackages.AddPackage(RootData^.FName);
|
Package := SerializablePackages.AddPackage(RootData^.FName);
|
||||||
Package.Category := RootData^.FCategory;
|
Package.Category := TranslateCategories(RootData^.FCategory);
|
||||||
Package.RepositoryFileName := ExtractFileName(FPackageFile);
|
Package.RepositoryFileName := ExtractFileName(FPackageFile);
|
||||||
Package.RepositoryFileSize := FileUtil.FileSize(FPackageFile);
|
Package.RepositoryFileSize := FileUtil.FileSize(FPackageFile);
|
||||||
Package.RepositoryFileHash := MD5Print(MD5File(FPackageFile));
|
Package.RepositoryFileHash := MD5Print(MD5File(FPackageFile));
|
||||||
|
@ -495,7 +495,7 @@ msgid "Shapes"
|
|||||||
msgstr "Formen"
|
msgstr "Formen"
|
||||||
|
|
||||||
#: opkman_const.rsmainfrm_vsttext_packagecategory23
|
#: opkman_const.rsmainfrm_vsttext_packagecategory23
|
||||||
msgid "Sizers, Scrollers"
|
msgid "Sizers and Scrollers"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: opkman_const.rsmainfrm_vsttext_packagecategory24
|
#: opkman_const.rsmainfrm_vsttext_packagecategory24
|
||||||
@ -519,7 +519,7 @@ msgid "Dialogs"
|
|||||||
msgstr "Dialoge"
|
msgstr "Dialoge"
|
||||||
|
|
||||||
#: opkman_const.rsmainfrm_vsttext_packagecategory5
|
#: opkman_const.rsmainfrm_vsttext_packagecategory5
|
||||||
msgid "Edit, Memos"
|
msgid "Edit and Memos"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: opkman_const.rsmainfrm_vsttext_packagecategory6
|
#: opkman_const.rsmainfrm_vsttext_packagecategory6
|
||||||
|
@ -495,8 +495,8 @@ msgid "Shapes"
|
|||||||
msgstr "Figuras"
|
msgstr "Figuras"
|
||||||
|
|
||||||
#: opkman_const.rsmainfrm_vsttext_packagecategory23
|
#: opkman_const.rsmainfrm_vsttext_packagecategory23
|
||||||
msgid "Sizers, Scrollers"
|
msgid "Sizers and Scrollers"
|
||||||
msgstr "Redimensionadores, Desplazamientos"
|
msgstr "Redimensionadores y Desplazamientos"
|
||||||
|
|
||||||
#: opkman_const.rsmainfrm_vsttext_packagecategory24
|
#: opkman_const.rsmainfrm_vsttext_packagecategory24
|
||||||
msgid "System"
|
msgid "System"
|
||||||
@ -519,8 +519,8 @@ msgid "Dialogs"
|
|||||||
msgstr "Dialogos"
|
msgstr "Dialogos"
|
||||||
|
|
||||||
#: opkman_const.rsmainfrm_vsttext_packagecategory5
|
#: opkman_const.rsmainfrm_vsttext_packagecategory5
|
||||||
msgid "Edit, Memos"
|
msgid "Edit and Memos"
|
||||||
msgstr "Editores, Memos"
|
msgstr "Editores y Memos"
|
||||||
|
|
||||||
#: opkman_const.rsmainfrm_vsttext_packagecategory6
|
#: opkman_const.rsmainfrm_vsttext_packagecategory6
|
||||||
msgid "Files and Drives"
|
msgid "Files and Drives"
|
||||||
|
@ -483,8 +483,8 @@ msgid "Shapes"
|
|||||||
msgstr "Muodot"
|
msgstr "Muodot"
|
||||||
|
|
||||||
#: opkman_const.rsmainfrm_vsttext_packagecategory23
|
#: opkman_const.rsmainfrm_vsttext_packagecategory23
|
||||||
msgid "Sizers, Scrollers"
|
msgid "Sizers and Scrollers"
|
||||||
msgstr "Koon muuttajat, vierityspalkit"
|
msgstr "Koon muuttajat ja vierityspalkit"
|
||||||
|
|
||||||
#: opkman_const.rsmainfrm_vsttext_packagecategory24
|
#: opkman_const.rsmainfrm_vsttext_packagecategory24
|
||||||
msgid "System"
|
msgid "System"
|
||||||
@ -507,8 +507,8 @@ msgid "Dialogs"
|
|||||||
msgstr "Dialogit"
|
msgstr "Dialogit"
|
||||||
|
|
||||||
#: opkman_const.rsmainfrm_vsttext_packagecategory5
|
#: opkman_const.rsmainfrm_vsttext_packagecategory5
|
||||||
msgid "Edit, Memos"
|
msgid "Edit and Memos"
|
||||||
msgstr "Tekstiruudut, muistiot"
|
msgstr "Tekstiruudut ja muistiot"
|
||||||
|
|
||||||
#: opkman_const.rsmainfrm_vsttext_packagecategory6
|
#: opkman_const.rsmainfrm_vsttext_packagecategory6
|
||||||
msgid "Files and Drives"
|
msgid "Files and Drives"
|
||||||
|
@ -439,7 +439,7 @@ msgstr "Titkosítás"
|
|||||||
|
|
||||||
#: opkman_const.rsmainfrm_vsttext_packagecategory10
|
#: opkman_const.rsmainfrm_vsttext_packagecategory10
|
||||||
msgid "Indicators and Gauges"
|
msgid "Indicators and Gauges"
|
||||||
msgstr "Kijelzők, mérők"
|
msgstr "Kijelzők és mérők"
|
||||||
|
|
||||||
#: opkman_const.rsmainfrm_vsttext_packagecategory11
|
#: opkman_const.rsmainfrm_vsttext_packagecategory11
|
||||||
msgid "Labels"
|
msgid "Labels"
|
||||||
@ -495,8 +495,8 @@ msgid "Shapes"
|
|||||||
msgstr "Alakzatok"
|
msgstr "Alakzatok"
|
||||||
|
|
||||||
#: opkman_const.rsmainfrm_vsttext_packagecategory23
|
#: opkman_const.rsmainfrm_vsttext_packagecategory23
|
||||||
msgid "Sizers, Scrollers"
|
msgid "Sizers and Scrollers"
|
||||||
msgstr "Méretezők, görgetők"
|
msgstr "Méretezők és görgetők"
|
||||||
|
|
||||||
#: opkman_const.rsmainfrm_vsttext_packagecategory24
|
#: opkman_const.rsmainfrm_vsttext_packagecategory24
|
||||||
msgid "System"
|
msgid "System"
|
||||||
@ -519,8 +519,8 @@ msgid "Dialogs"
|
|||||||
msgstr "Párbeszédek"
|
msgstr "Párbeszédek"
|
||||||
|
|
||||||
#: opkman_const.rsmainfrm_vsttext_packagecategory5
|
#: opkman_const.rsmainfrm_vsttext_packagecategory5
|
||||||
msgid "Edit, Memos"
|
msgid "Edit and Memos"
|
||||||
msgstr "Szerkesztés, jegyzetelés"
|
msgstr "Szerkesztés és jegyzetelés"
|
||||||
|
|
||||||
#: opkman_const.rsmainfrm_vsttext_packagecategory6
|
#: opkman_const.rsmainfrm_vsttext_packagecategory6
|
||||||
msgid "Files and Drives"
|
msgid "Files and Drives"
|
||||||
|
@ -483,7 +483,7 @@ msgid "Shapes"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: opkman_const.rsmainfrm_vsttext_packagecategory23
|
#: opkman_const.rsmainfrm_vsttext_packagecategory23
|
||||||
msgid "Sizers, Scrollers"
|
msgid "Sizers and Scrollers"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: opkman_const.rsmainfrm_vsttext_packagecategory24
|
#: opkman_const.rsmainfrm_vsttext_packagecategory24
|
||||||
@ -507,7 +507,7 @@ msgid "Dialogs"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: opkman_const.rsmainfrm_vsttext_packagecategory5
|
#: opkman_const.rsmainfrm_vsttext_packagecategory5
|
||||||
msgid "Edit, Memos"
|
msgid "Edit and Memos"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: opkman_const.rsmainfrm_vsttext_packagecategory6
|
#: opkman_const.rsmainfrm_vsttext_packagecategory6
|
||||||
|
@ -80,7 +80,7 @@ const
|
|||||||
'DataControls',
|
'DataControls',
|
||||||
'Date and Time',
|
'Date and Time',
|
||||||
'Dialogs',
|
'Dialogs',
|
||||||
'Edit, Memos',
|
'Edit and Memos',
|
||||||
'Files and Drives',
|
'Files and Drives',
|
||||||
'GUIContainers',
|
'GUIContainers',
|
||||||
'Graphics',
|
'Graphics',
|
||||||
@ -98,7 +98,7 @@ const
|
|||||||
'Science',
|
'Science',
|
||||||
'Security',
|
'Security',
|
||||||
'Shapes',
|
'Shapes',
|
||||||
'Sizers, Scrollers',
|
'Sizers and Scrollers',
|
||||||
'System',
|
'System',
|
||||||
'Tabbed Components',
|
'Tabbed Components',
|
||||||
'Other');
|
'Other');
|
||||||
|
@ -91,7 +91,7 @@ resourcestring
|
|||||||
rsMainFrm_VSTText_PackageCategory2 = 'DataControls';
|
rsMainFrm_VSTText_PackageCategory2 = 'DataControls';
|
||||||
rsMainFrm_VSTText_PackageCategory3 = 'Date and Time';
|
rsMainFrm_VSTText_PackageCategory3 = 'Date and Time';
|
||||||
rsMainFrm_VSTText_PackageCategory4 = 'Dialogs';
|
rsMainFrm_VSTText_PackageCategory4 = 'Dialogs';
|
||||||
rsMainFrm_VSTText_PackageCategory5 = 'Edit, Memos';
|
rsMainFrm_VSTText_PackageCategory5 = 'Edit and Memos';
|
||||||
rsMainFrm_VSTText_PackageCategory6 = 'Files and Drives';
|
rsMainFrm_VSTText_PackageCategory6 = 'Files and Drives';
|
||||||
rsMainFrm_VSTText_PackageCategory7 = 'GUIContainers';
|
rsMainFrm_VSTText_PackageCategory7 = 'GUIContainers';
|
||||||
rsMainFrm_VSTText_PackageCategory8 = 'Graphics';
|
rsMainFrm_VSTText_PackageCategory8 = 'Graphics';
|
||||||
@ -109,7 +109,7 @@ resourcestring
|
|||||||
rsMainFrm_VSTText_PackageCategory20 = 'Science';
|
rsMainFrm_VSTText_PackageCategory20 = 'Science';
|
||||||
rsMainFrm_VSTText_PackageCategory21 = 'Security';
|
rsMainFrm_VSTText_PackageCategory21 = 'Security';
|
||||||
rsMainFrm_VSTText_PackageCategory22 = 'Shapes';
|
rsMainFrm_VSTText_PackageCategory22 = 'Shapes';
|
||||||
rsMainFrm_VSTText_PackageCategory23 = 'Sizers, Scrollers';
|
rsMainFrm_VSTText_PackageCategory23 = 'Sizers and Scrollers';
|
||||||
rsMainFrm_VSTText_PackageCategory24 = 'System';
|
rsMainFrm_VSTText_PackageCategory24 = 'System';
|
||||||
rsMainFrm_VSTText_PackageCategory25 = 'Tabbed Components';
|
rsMainFrm_VSTText_PackageCategory25 = 'Tabbed Components';
|
||||||
rsMainFrm_VSTText_PackageCategory26 = 'Other';
|
rsMainFrm_VSTText_PackageCategory26 = 'Other';
|
||||||
|
@ -46,6 +46,7 @@ type
|
|||||||
PackageFileName: String;
|
PackageFileName: String;
|
||||||
Version: String;
|
Version: String;
|
||||||
InstalledVersion: String;
|
InstalledVersion: String;
|
||||||
|
UpdateVersion: String;
|
||||||
Description: String;
|
Description: String;
|
||||||
Author: String;
|
Author: String;
|
||||||
LazCompatibility: String;
|
LazCompatibility: String;
|
||||||
@ -119,6 +120,7 @@ type
|
|||||||
procedure ButtonClick(Sender: TObject);
|
procedure ButtonClick(Sender: TObject);
|
||||||
procedure ShowButtons;
|
procedure ShowButtons;
|
||||||
procedure HideButtons;
|
procedure HideButtons;
|
||||||
|
function TranslateCategories(const AStr: String): String;
|
||||||
public
|
public
|
||||||
constructor Create(const AParent: TWinControl; const AImgList: TImageList;
|
constructor Create(const AParent: TWinControl; const AImgList: TImageList;
|
||||||
APopupMenu: TPopupMenu);
|
APopupMenu: TPopupMenu);
|
||||||
@ -294,6 +296,7 @@ begin
|
|||||||
ChildData := FVST.GetNodeData(ChildNode);
|
ChildData := FVST.GetNodeData(ChildNode);
|
||||||
ChildData^.PackageFileName := PackageFile.Name;
|
ChildData^.PackageFileName := PackageFile.Name;
|
||||||
ChildData^.InstalledVersion := PackageFile.InstalledFileVersion;
|
ChildData^.InstalledVersion := PackageFile.InstalledFileVersion;
|
||||||
|
ChildData^.UpdateVersion := PackageFile.UpdateVersion;
|
||||||
ChildData^.Version := PackageFile.VersionAsString;
|
ChildData^.Version := PackageFile.VersionAsString;
|
||||||
ChildData^.PackageState := PackageFile.PackageState;
|
ChildData^.PackageState := PackageFile.PackageState;
|
||||||
ChildData^.DataType := 2;
|
ChildData^.DataType := 2;
|
||||||
@ -499,6 +502,45 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TVisualTree.TranslateCategories(const AStr: String): String;
|
||||||
|
var
|
||||||
|
SL: TStringList;
|
||||||
|
I, J: Integer;
|
||||||
|
Str: String;
|
||||||
|
begin
|
||||||
|
if Categories[0] = CategoriesEng[0] then
|
||||||
|
begin
|
||||||
|
Result := AStr;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
Result := '';
|
||||||
|
SL := TStringList.Create;
|
||||||
|
try
|
||||||
|
SL.Delimiter := ',';
|
||||||
|
SL.StrictDelimiter := True;
|
||||||
|
SL.DelimitedText := AStr;
|
||||||
|
for I := 0 to SL.Count - 1 do
|
||||||
|
begin
|
||||||
|
Str := Trim(SL.Strings[I]);
|
||||||
|
for J := 0 to MaxCategories - 1 do
|
||||||
|
begin
|
||||||
|
if Str = CategoriesEng[J] then
|
||||||
|
begin
|
||||||
|
if Result = '' then
|
||||||
|
Result := Categories[J]
|
||||||
|
else
|
||||||
|
Result := Result + ', ' + Categories[J];
|
||||||
|
Break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
SL.Free;
|
||||||
|
end;
|
||||||
|
if Result = '' then
|
||||||
|
Result := AStr;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TVisualTree.VSTScroll(Sender: TBaseVirtualTree; DeltaX,
|
procedure TVisualTree.VSTScroll(Sender: TBaseVirtualTree; DeltaX,
|
||||||
DeltaY: Integer);
|
DeltaY: Integer);
|
||||||
begin
|
begin
|
||||||
@ -1167,6 +1209,11 @@ begin
|
|||||||
end
|
end
|
||||||
else if Column = 3 then
|
else if Column = 3 then
|
||||||
begin
|
begin
|
||||||
|
if Data^.UpdateVersion = '' then
|
||||||
|
Data^.UpdateVersion := '-';
|
||||||
|
if Data^.DataType = 2 then
|
||||||
|
CellText := Data^.UpdateVersion
|
||||||
|
else
|
||||||
CellText := '';
|
CellText := '';
|
||||||
end
|
end
|
||||||
else if Column = 4 then
|
else if Column = 4 then
|
||||||
@ -1200,7 +1247,7 @@ begin
|
|||||||
9: CellText := GetDisplayString(Data^.License);
|
9: CellText := GetDisplayString(Data^.License);
|
||||||
10: CellText := Data^.Dependencies;
|
10: CellText := Data^.Dependencies;
|
||||||
11: CellText := '';
|
11: CellText := '';
|
||||||
12: CellText := Data^.Category;
|
12: CellText := TranslateCategories(Data^.Category);
|
||||||
13: CellText := Data^.RepositoryFileName;
|
13: CellText := Data^.RepositoryFileName;
|
||||||
14: CellText := FormatSize(Data^.RepositoryFileSize);
|
14: CellText := FormatSize(Data^.RepositoryFileSize);
|
||||||
15: CellText := Data^.RepositoryFileHash;
|
15: CellText := Data^.RepositoryFileHash;
|
||||||
|
Loading…
Reference in New Issue
Block a user