mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 20:39:23 +02:00
Converter: improved localization
git-svn-id: trunk@28421 -
This commit is contained in:
parent
0fe0f065e0
commit
830ebc5eec
@ -298,7 +298,8 @@ begin
|
|||||||
if CompareFileExt(Filename,'.pas',false)<>0 then begin
|
if CompareFileExt(Filename,'.pas',false)<>0 then begin
|
||||||
Result:=QuestionDlg(lisNotADelphiUnit,
|
Result:=QuestionDlg(lisNotADelphiUnit,
|
||||||
Format(lisTheFileIsNotADelphiUnit, ['"', Filename, '"']),
|
Format(lisTheFileIsNotADelphiUnit, ['"', Filename, '"']),
|
||||||
mtError,[mrCancel,'Skip this file',mbAbort,'Abort'],0);
|
mtError, [mrCancel, lisConvDelphiSkipThisFile, mbAbort,
|
||||||
|
lisInfoBuildMakeAbort], 0);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
Result:=mrOk;
|
Result:=mrOk;
|
||||||
@ -329,7 +330,7 @@ begin
|
|||||||
Format(lisTheCurrentUnitPathForTheFileIsThePathToTheLCLUnits,
|
Format(lisTheCurrentUnitPathForTheFileIsThePathToTheLCLUnits,
|
||||||
[sLineBreak,'"',Filename,'"',sLineBreak,'"',UnitPath,'"',sLineBreak,
|
[sLineBreak,'"',Filename,'"',sLineBreak,'"',UnitPath,'"',sLineBreak,
|
||||||
sLineBreak,'"',LCLPath,'"',sLineBreak,sLineBreak,sLineBreak]),
|
sLineBreak,'"',LCLPath,'"',sLineBreak,sLineBreak,sLineBreak]),
|
||||||
mtError,[mrOK,'Continue',mrAbort,'Abort'],0);
|
mtError, [mrOK, lisContinue, mrAbort, lisInfoBuildMakeAbort], 0);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
Result:=mrOk;
|
Result:=mrOk;
|
||||||
@ -340,7 +341,7 @@ begin
|
|||||||
if CompareFileExt(Filename,'.dpr',false)<>0 then begin
|
if CompareFileExt(Filename,'.dpr',false)<>0 then begin
|
||||||
Result:=QuestionDlg(lisNotADelphiProject,
|
Result:=QuestionDlg(lisNotADelphiProject,
|
||||||
Format(lisTheFileIsNotADelphiProjectDpr, ['"', Filename, '"']),
|
Format(lisTheFileIsNotADelphiProjectDpr, ['"', Filename, '"']),
|
||||||
mtError,[mrCancel,'Skipt this step',mbAbort],0);
|
mtError, [mrCancel, lisConvDelphiSkipThisStep, mbAbort], 0);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
Result:=mrOk;
|
Result:=mrOk;
|
||||||
@ -471,14 +472,14 @@ begin
|
|||||||
fFlags:=AFlags;
|
fFlags:=AFlags;
|
||||||
fLazFileExt:='';
|
fLazFileExt:='';
|
||||||
if fOwnerConverter=nil then begin
|
if fOwnerConverter=nil then begin
|
||||||
fSettings:=TConvertSettings.Create('Convert Delphi Unit');
|
fSettings:=TConvertSettings.Create(lisConvDelphiConvertDelphiUnit);
|
||||||
fSettings.MainFilename:=fOrigUnitFilename;
|
fSettings.MainFilename:=fOrigUnitFilename;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
fSettings:=fOwnerConverter.fSettings;
|
fSettings:=fOwnerConverter.fSettings;
|
||||||
fUnitInfo:=nil;
|
fUnitInfo:=nil;
|
||||||
if not LazarusIDE.BeginCodeTools then
|
if not LazarusIDE.BeginCodeTools then
|
||||||
IDEMessagesWindow.AddMsg('BeginCodeTools failed!','',-1);
|
IDEMessagesWindow.AddMsg(lisConvDelphiBeginCodeToolsFailed, '', -1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TConvertDelphiUnit.Destroy;
|
destructor TConvertDelphiUnit.Destroy;
|
||||||
@ -509,9 +510,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if Result=mrOk then
|
if Result=mrOk then
|
||||||
IDEMessagesWindow.AddMsg('Ready.','',-1)
|
IDEMessagesWindow.AddMsg(lisConvDelphiReady, '', -1)
|
||||||
else
|
else
|
||||||
IDEMessagesWindow.AddMsg('Aborted.','',-1)
|
IDEMessagesWindow.AddMsg(lisConvDelphiAborted, '', -1)
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TConvertDelphiUnit.GetDfmFileName: string;
|
function TConvertDelphiUnit.GetDfmFileName: string;
|
||||||
@ -560,7 +561,8 @@ begin
|
|||||||
fUnitsToRename:=TStringToStringTree.Create(false);
|
fUnitsToRename:=TStringToStringTree.Create(false);
|
||||||
fUnitsToComment:=TStringList.Create;
|
fUnitsToComment:=TStringList.Create;
|
||||||
try
|
try
|
||||||
IDEMessagesWindow.AddMsg('Converting unit file '+fOrigUnitFilename,'',-1);
|
IDEMessagesWindow.AddMsg(Format(lisConvDelphiConvertingUnitFile, [
|
||||||
|
fOrigUnitFilename]), '', -1);
|
||||||
Application.ProcessMessages;
|
Application.ProcessMessages;
|
||||||
fLFMBuffer:=nil;
|
fLFMBuffer:=nil;
|
||||||
// Get DFM file name and close it in editor.
|
// Get DFM file name and close it in editor.
|
||||||
@ -642,7 +644,8 @@ var
|
|||||||
begin
|
begin
|
||||||
// Fix the LFM file and the pascal unit, updates fPascalBuffer and fLFMBuffer.
|
// Fix the LFM file and the pascal unit, updates fPascalBuffer and fLFMBuffer.
|
||||||
if fLFMBuffer<>nil then begin
|
if fLFMBuffer<>nil then begin
|
||||||
IDEMessagesWindow.AddMsg('Repairing form file '+fLFMBuffer.Filename,'',-1);
|
IDEMessagesWindow.AddMsg(Format(lisConvDelphiRepairingFormFile, [fLFMBuffer.
|
||||||
|
Filename]), '', -1);
|
||||||
Application.ProcessMessages;
|
Application.ProcessMessages;
|
||||||
LfmFixer:=TLFMFixer.Create(fPascalBuffer,fLFMBuffer,@IDEMessagesWindow.AddMsg);
|
LfmFixer:=TLFMFixer.Create(fPascalBuffer,fLFMBuffer,@IDEMessagesWindow.AddMsg);
|
||||||
try
|
try
|
||||||
@ -683,8 +686,8 @@ begin
|
|||||||
if InPos=0 then ;
|
if InPos=0 then ;
|
||||||
fPascalBuffer.AbsoluteToLineCol(NamePos,Line,Col);
|
fPascalBuffer.AbsoluteToLineCol(NamePos,Line,Col);
|
||||||
end;
|
end;
|
||||||
Result:=ShortFilename+'('+IntToStr(Line)+','+IntToStr(Col)+') Error: '
|
Result:=Format(lisConvDelphiErrorCanTFindUnit, [ShortFilename, IntToStr(Line)
|
||||||
+'Can''t find unit '+MissingUnit;
|
, IntToStr(Col), MissingUnit]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TConvertDelphiUnit.CommentAutomatically: integer;
|
function TConvertDelphiUnit.CommentAutomatically: integer;
|
||||||
@ -727,7 +730,8 @@ begin
|
|||||||
UnitDirDialog:=TSelectDirectoryDialog.Create(nil);
|
UnitDirDialog:=TSelectDirectoryDialog.Create(nil);
|
||||||
try
|
try
|
||||||
UnitDirDialog.InitialDir:=fOwnerConverter.fPrevSelectedPath;
|
UnitDirDialog.InitialDir:=fOwnerConverter.fPrevSelectedPath;
|
||||||
UnitDirDialog.Title:='All sub-directories will be scanned for unit files';
|
UnitDirDialog.Title:=
|
||||||
|
lisConvDelphiAllSubDirectoriesWillBeScannedForUnitFiles;
|
||||||
if UnitDirDialog.Execute then begin
|
if UnitDirDialog.Execute then begin
|
||||||
if Assigned(fOwnerConverter) then begin
|
if Assigned(fOwnerConverter) then begin
|
||||||
fOwnerConverter.fPrevSelectedPath:=ExtractFilePath(UnitDirDialog.Filename);
|
fOwnerConverter.fPrevSelectedPath:=ExtractFilePath(UnitDirDialog.Filename);
|
||||||
@ -767,13 +771,13 @@ begin
|
|||||||
if MissingIncludeFilesCodeXYPos<>nil then begin
|
if MissingIncludeFilesCodeXYPos<>nil then begin
|
||||||
for i:=0 to MissingIncludeFilesCodeXYPos.Count-1 do begin
|
for i:=0 to MissingIncludeFilesCodeXYPos.Count-1 do begin
|
||||||
CodePos:=PCodeXYPosition(MissingIncludeFilesCodeXYPos[i]);
|
CodePos:=PCodeXYPosition(MissingIncludeFilesCodeXYPos[i]);
|
||||||
Msg:=CodePos^.Code.Filename
|
Msg:=Format(lisConvDelphiMissingIncludeFile, [CodePos^.Code.Filename,
|
||||||
+'('+IntToStr(CodePos^.y)+','+IntToStr(CodePos^.x)+')'
|
IntToStr(CodePos^.y), IntToStr(CodePos^.x)]);
|
||||||
+' missing include file';
|
|
||||||
IDEMessagesWindow.AddMsg(Msg, '', -1);
|
IDEMessagesWindow.AddMsg(Msg, '', -1);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
IDEMessagesWindow.AddMsg('Error="'+CodeToolBoss.ErrorMessage+'"', '', -1);
|
IDEMessagesWindow.AddMsg(Format(lisConvDelphiError, [CodeToolBoss.
|
||||||
|
ErrorMessage]), '', -1);
|
||||||
Application.ProcessMessages;
|
Application.ProcessMessages;
|
||||||
Result:=mrCancel;
|
Result:=mrCancel;
|
||||||
exit;
|
exit;
|
||||||
@ -798,12 +802,13 @@ var
|
|||||||
and (not ConvTool.ExistingUsesImplementation.Find(ANewName, x)) then begin
|
and (not ConvTool.ExistingUsesImplementation.Find(ANewName, x)) then begin
|
||||||
fUnitsToRename[AOldName]:=ANewName;
|
fUnitsToRename[AOldName]:=ANewName;
|
||||||
IDEMessagesWindow.AddMsg(Format(
|
IDEMessagesWindow.AddMsg(Format(
|
||||||
'Replaced unit "%s" with "%s" in uses section.',[AOldName, ANewName]),'',-1);
|
lisConvDelphiReplacedUnitSWithSInUsesSection, [AOldName, ANewName]), ''
|
||||||
|
, -1);
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
fUnitsToRemove.Append(AOldName);
|
fUnitsToRemove.Append(AOldName);
|
||||||
IDEMessagesWindow.AddMsg(Format(
|
IDEMessagesWindow.AddMsg(Format(
|
||||||
'Removed used unit "%s" in uses section.',[AOldName]),'',-1);
|
lisConvDelphiRemovedUsedUnitSInUsesSection, [AOldName]), '', -1);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -817,7 +822,8 @@ var
|
|||||||
Result:=mrOk;
|
Result:=mrOk;
|
||||||
CTResult:=CodeToolBoss.FindMissingUnits(fPascalBuffer,fMissingUnits,true);
|
CTResult:=CodeToolBoss.FindMissingUnits(fPascalBuffer,fMissingUnits,true);
|
||||||
if not CTResult then begin
|
if not CTResult then begin
|
||||||
IDEMessagesWindow.AddMsg('Error="'+CodeToolBoss.ErrorMessage+'"','',-1);
|
IDEMessagesWindow.AddMsg(Format(lisConvDelphiError, [CodeToolBoss.
|
||||||
|
ErrorMessage]), '', -1);
|
||||||
Result:=mrCancel;
|
Result:=mrCancel;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -865,7 +871,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
if (fSettings.UnitsReplaceMode=rlInteractive) and (MapToEdit.Tree.Count>0) then begin
|
if (fSettings.UnitsReplaceMode=rlInteractive) and (MapToEdit.Tree.Count>0) then begin
|
||||||
// Edit, then remove or replace units.
|
// Edit, then remove or replace units.
|
||||||
Result:=EditMap(MapToEdit, 'Units to replace in '+ExtractFileName(fOrigUnitFilename));
|
Result:=EditMap(MapToEdit, Format(lisConvDelphiUnitsToReplaceIn, [
|
||||||
|
ExtractFileName(fOrigUnitFilename)]));
|
||||||
if Result<>mrOK then exit;
|
if Result<>mrOK then exit;
|
||||||
// Iterate the map and rename / remove.
|
// Iterate the map and rename / remove.
|
||||||
Node:=MapToEdit.Tree.FindLowest;
|
Node:=MapToEdit.Tree.FindLowest;
|
||||||
@ -912,9 +919,11 @@ function TConvertDelphiUnit.CheckFailed(PrevResult: TModalResult): TModalResult;
|
|||||||
begin
|
begin
|
||||||
Result:=PrevResult;
|
Result:=PrevResult;
|
||||||
if Result=mrCancel then begin
|
if Result=mrCancel then begin
|
||||||
Result:=QuestionDlg('Failed converting unit',
|
Result:=QuestionDlg(lisConvDelphiFailedConvertingUnit,
|
||||||
'Failed to convert unit'+#13+fOrigUnitFilename+#13,
|
Format(lisConvDelphiFailedToConvertUnit, [#13,
|
||||||
mtWarning,[mrIgnore,'Ignore and continue',mrAbort],0);
|
fOrigUnitFilename, #13]),
|
||||||
|
mtWarning, [mrIgnore, lisIgnoreAndContinue, mrAbort], 0)
|
||||||
|
;
|
||||||
if Result=mrIgnore then
|
if Result=mrIgnore then
|
||||||
Result:=mrOK;
|
Result:=mrOK;
|
||||||
end;
|
end;
|
||||||
@ -932,7 +941,7 @@ begin
|
|||||||
fUnitSearchPaths.StrictDelimiter:=True;
|
fUnitSearchPaths.StrictDelimiter:=True;
|
||||||
fCachedUnitNames:=TStringToStringTree.Create(false);
|
fCachedUnitNames:=TStringToStringTree.Create(false);
|
||||||
fCachedRealFileNames:=TStringToStringTree.Create(true);
|
fCachedRealFileNames:=TStringToStringTree.Create(true);
|
||||||
fSettings:=TConvertSettings.Create('Convert Delphi '+ADescription);
|
fSettings:=TConvertSettings.Create(ADescription);
|
||||||
fSettings.MainFilename:=fOrigPFilename;
|
fSettings.MainFilename:=fOrigPFilename;
|
||||||
fAllMissingUnits:=TStringList.Create;
|
fAllMissingUnits:=TStringList.Create;
|
||||||
fAllMissingUnits.Sorted:=true;
|
fAllMissingUnits.Sorted:=true;
|
||||||
@ -987,9 +996,9 @@ begin
|
|||||||
Result:=ConvertSub;
|
Result:=ConvertSub;
|
||||||
end;
|
end;
|
||||||
if Result=mrOk then
|
if Result=mrOk then
|
||||||
IDEMessagesWindow.AddMsg('Conversion Ready.','',-1)
|
IDEMessagesWindow.AddMsg(lisConvDelphiConversionReady, '', -1)
|
||||||
else
|
else
|
||||||
IDEMessagesWindow.AddMsg('Conversion Aborted.','',-1)
|
IDEMessagesWindow.AddMsg(lisConvDelphiConversionAborted, '', -1)
|
||||||
finally
|
finally
|
||||||
CacheUnitsThread.Free;
|
CacheUnitsThread.Free;
|
||||||
end;
|
end;
|
||||||
@ -1040,7 +1049,7 @@ var
|
|||||||
Converter: TConvertDelphiUnit;
|
Converter: TConvertDelphiUnit;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
IDEMessagesWindow.AddMsg('*** Repairing form files... ***','',-1);
|
IDEMessagesWindow.AddMsg(lisConvDelphiRepairingFormFiles, '', -1);
|
||||||
Application.ProcessMessages;
|
Application.ProcessMessages;
|
||||||
Screen.Cursor:=crHourGlass;
|
Screen.Cursor:=crHourGlass;
|
||||||
try
|
try
|
||||||
@ -1350,7 +1359,7 @@ end;
|
|||||||
|
|
||||||
constructor TConvertDelphiProject.Create(const aProjectFilename: string);
|
constructor TConvertDelphiProject.Create(const aProjectFilename: string);
|
||||||
begin
|
begin
|
||||||
inherited Create(aProjectFilename, 'Project');
|
inherited Create(aProjectFilename, lisConvDelphiConvertDelphiProject);
|
||||||
fLazPSuffix:='.lpi';
|
fLazPSuffix:='.lpi';
|
||||||
fDelphiPSuffix:='.dpr';
|
fDelphiPSuffix:='.dpr';
|
||||||
fMainUnitConverter:=nil;
|
fMainUnitConverter:=nil;
|
||||||
@ -1469,11 +1478,12 @@ begin
|
|||||||
if FilenameIsPascalUnit(AUnitName) then begin
|
if FilenameIsPascalUnit(AUnitName) then begin
|
||||||
CurUnitInfo:=LazProject.UnitWithUnitname(ExtractFileNameOnly(AUnitName));
|
CurUnitInfo:=LazProject.UnitWithUnitname(ExtractFileNameOnly(AUnitName));
|
||||||
if CurUnitInfo<>nil then begin
|
if CurUnitInfo<>nil then begin
|
||||||
Result:=QuestionDlg('Unitname exists twice',
|
Result:=QuestionDlg(lisConvDelphiUnitnameExistsTwice,
|
||||||
'There are two units with the same unitname:'#13
|
Format(lisConvDelphiThereAreTwoUnitsWithTheSameUnitname, [#13,
|
||||||
+CurUnitInfo.Filename+#13+AUnitName+#13,
|
CurUnitInfo.Filename, #13, AUnitName, #13]),
|
||||||
mtWarning,[mrYes,'Remove first',mrNo,'Remove second',
|
mtWarning, [mrYes, lisConvDelphiRemoveFirst, mrNo,
|
||||||
mrIgnore,'Keep both',mrAbort],0);
|
lisConvDelphiRemoveSecond,
|
||||||
|
mrIgnore, lisConvDelphiKeepBoth, mrAbort], 0);
|
||||||
case Result of
|
case Result of
|
||||||
mrYes: CurUnitInfo.IsPartOfProject:=false;
|
mrYes: CurUnitInfo.IsPartOfProject:=false;
|
||||||
mrNo: exit(mrNo);
|
mrNo: exit(mrNo);
|
||||||
@ -1505,7 +1515,7 @@ begin
|
|||||||
MisUnits:=nil;
|
MisUnits:=nil;
|
||||||
NormalUnits:=nil;
|
NormalUnits:=nil;
|
||||||
try
|
try
|
||||||
IDEMessagesWindow.AddMsg('*** Find all unit files... ***','',-1);
|
IDEMessagesWindow.AddMsg(lisConvDelphiFindAllUnitFiles, '', -1);
|
||||||
Application.ProcessMessages;
|
Application.ProcessMessages;
|
||||||
if not CodeToolBoss.FindDelphiProjectUnits(fMainUnitConverter.fPascalBuffer,
|
if not CodeToolBoss.FindDelphiProjectUnits(fMainUnitConverter.fPascalBuffer,
|
||||||
FoundUnits, MisUnits, NormalUnits) then
|
FoundUnits, MisUnits, NormalUnits) then
|
||||||
@ -1515,7 +1525,8 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if (MisUnits<>nil) and (MisUnits.Count>0) then
|
if (MisUnits<>nil) and (MisUnits.Count>0) then
|
||||||
raise Exception.Create('At this point there should be no missing units!');
|
raise Exception.Create(lisConvDelphiAtThisPointThereShouldBeNoMissingUnits
|
||||||
|
);
|
||||||
try
|
try
|
||||||
// add all units to the project
|
// add all units to the project
|
||||||
for i:=0 to FoundUnits.Count-1 do begin
|
for i:=0 to FoundUnits.Count-1 do begin
|
||||||
@ -1575,7 +1586,7 @@ begin
|
|||||||
ConvUnits:=TObjectList.create;
|
ConvUnits:=TObjectList.create;
|
||||||
try
|
try
|
||||||
// convert all units and fix .lfm files
|
// convert all units and fix .lfm files
|
||||||
IDEMessagesWindow.AddMsg('*** Converting unit files... ***','',-1);
|
IDEMessagesWindow.AddMsg(lisConvDelphiConvertingUnitFiles, '', -1);
|
||||||
Application.ProcessMessages;
|
Application.ProcessMessages;
|
||||||
for i:=0 to LazProject.UnitCount-1 do begin
|
for i:=0 to LazProject.UnitCount-1 do begin
|
||||||
CurUnitInfo:=LazProject.Units[i];
|
CurUnitInfo:=LazProject.Units[i];
|
||||||
@ -1681,7 +1692,7 @@ end;
|
|||||||
|
|
||||||
constructor TConvertDelphiPackage.Create(const aPackageFilename: string);
|
constructor TConvertDelphiPackage.Create(const aPackageFilename: string);
|
||||||
begin
|
begin
|
||||||
inherited Create(aPackageFilename, 'Package');
|
inherited Create(aPackageFilename, lisConvDelphiConvertDelphiPackage);
|
||||||
fLazPSuffix:='.lpk';
|
fLazPSuffix:='.lpk';
|
||||||
fDelphiPSuffix:='.dpk';
|
fDelphiPSuffix:='.dpk';
|
||||||
end;
|
end;
|
||||||
@ -1711,9 +1722,9 @@ begin
|
|||||||
// there is already a package loaded with this name ...
|
// there is already a package loaded with this name ...
|
||||||
if CompareFilenames(LazPackage.Filename,fLazPFilename)<>0 then begin
|
if CompareFilenames(LazPackage.Filename,fLazPFilename)<>0 then begin
|
||||||
// ... but it is not the package file we want -> stop
|
// ... but it is not the package file we want -> stop
|
||||||
MessageDlg('Package name exists',
|
MessageDlg(lisConvDelphiPackageNameExists,
|
||||||
'There is already a package with the name "'+PkgName+'"'#13
|
Format(lisConvDelphiThereIsAlreadyAPackageWithTheNamePleaseCloseThisPa,
|
||||||
+'Please close this package first.',mtError,[mbAbort],0);
|
[PkgName, #13]), mtError, [mbAbort], 0);
|
||||||
PackageEditingInterface.DoOpenPackageFile(LazPackage.Filename,
|
PackageEditingInterface.DoOpenPackageFile(LazPackage.Filename,
|
||||||
[pofAddToRecent],true);
|
[pofAddToRecent],true);
|
||||||
Result:=mrAbort;
|
Result:=mrAbort;
|
||||||
@ -1748,7 +1759,7 @@ begin
|
|||||||
ConvUnits:=TObjectList.create;
|
ConvUnits:=TObjectList.create;
|
||||||
try
|
try
|
||||||
// convert all units and fix .lfm files
|
// convert all units and fix .lfm files
|
||||||
IDEMessagesWindow.AddMsg('*** Converting unit files... ***','',-1);
|
IDEMessagesWindow.AddMsg(lisConvDelphiConvertingUnitFiles, '', -1);
|
||||||
Application.ProcessMessages;
|
Application.ProcessMessages;
|
||||||
for i:=0 to LazPackage.FileCount-1 do begin
|
for i:=0 to LazPackage.FileCount-1 do begin
|
||||||
PkgFile:=LazPackage.Files[i];
|
PkgFile:=LazPackage.Files[i];
|
||||||
@ -1796,9 +1807,9 @@ begin
|
|||||||
// warn about missing units
|
// warn about missing units
|
||||||
if (MissingInUnits<>nil) and (MissingInUnits.Count>0) then begin
|
if (MissingInUnits<>nil) and (MissingInUnits.Count>0) then begin
|
||||||
NotFoundUnits:=MissingInUnits.Text;
|
NotFoundUnits:=MissingInUnits.Text;
|
||||||
Result:=QuestionDlg('Units not found',
|
Result:=QuestionDlg(lisConvDelphiUnitsNotFound,
|
||||||
'Some units of the delphi package are missing:'#13
|
Format(lisConvDelphiSomeUnitsOfTheDelphiPackageAreMissing, [#13,
|
||||||
+NotFoundUnits,mtWarning,[mrIgnore,mrAbort],0);
|
NotFoundUnits]), mtWarning, [mrIgnore, mrAbort], 0);
|
||||||
if Result<>mrIgnore then exit;
|
if Result<>mrIgnore then exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1822,11 +1833,10 @@ begin
|
|||||||
// check unitname
|
// check unitname
|
||||||
OffendingUnit:=LazPackage.FindUnit(ExtractFileNameOnly(CurFilename));
|
OffendingUnit:=LazPackage.FindUnit(ExtractFileNameOnly(CurFilename));
|
||||||
if OffendingUnit<>nil then begin
|
if OffendingUnit<>nil then begin
|
||||||
Result:=QuestionDlg('Unitname exists twice',
|
Result:=QuestionDlg(lisConvDelphiUnitnameExistsTwice,
|
||||||
'There are two units with the same unitname:'#13
|
Format(lisConvDelphiThereAreTwoUnitsWithTheSameUnitname, [#13,
|
||||||
+OffendingUnit.Filename+#13
|
OffendingUnit.Filename, #13, CurFilename, #13]),
|
||||||
+CurFilename+#13,
|
mtWarning, [mrNo, lisConvDelphiRemoveSecond, mrAbort], 0);
|
||||||
mtWarning,[mrNo,'Remove second',mrAbort],0);
|
|
||||||
case Result of
|
case Result of
|
||||||
mrNo: continue;
|
mrNo: continue;
|
||||||
mrIgnore: ;
|
mrIgnore: ;
|
||||||
@ -1879,9 +1889,9 @@ begin
|
|||||||
DPKFilename:=ChangeFileExt(LazPackage.Filename,'.dpk');
|
DPKFilename:=ChangeFileExt(LazPackage.Filename,'.dpk');
|
||||||
DPKFilename:=CodeToolBoss.DirectoryCachePool.FindDiskFilename(DPKFilename);
|
DPKFilename:=CodeToolBoss.DirectoryCachePool.FindDiskFilename(DPKFilename);
|
||||||
if not FileExistsCached(DPKFilename) then begin
|
if not FileExistsCached(DPKFilename) then begin
|
||||||
Result:=MessageDlg('File not found',
|
Result:=MessageDlg(lisFileNotFound,
|
||||||
'Delphi package main source (.dpk) file not found for package'#13
|
Format(lisConvDelphiDelphiPackageMainSourceDpkFileNotFoundForPackage, [#13
|
||||||
+LazPackage.Filename,mtError,[mbAbort],0);
|
, LazPackage.Filename]), mtError, [mbAbort], 0);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
Result:=LoadCodeBuffer(fDpkCode,DPKFilename,[],true);
|
Result:=LoadCodeBuffer(fDpkCode,DPKFilename,[],true);
|
||||||
|
@ -5006,6 +5006,51 @@ resourcestring
|
|||||||
//IDE info dialog
|
//IDE info dialog
|
||||||
lisIDEInfoInformationAboutTheIDE = 'Information about the IDE';
|
lisIDEInfoInformationAboutTheIDE = 'Information about the IDE';
|
||||||
|
|
||||||
|
//Delphi units and projects converter
|
||||||
|
lisConvDelphiSkipThisFile = 'Skip this file';
|
||||||
|
lisConvDelphiSkipThisStep = 'Skip this step';
|
||||||
|
lisConvDelphiConvertDelphiUnit = 'Convert Delphi unit';
|
||||||
|
lisConvDelphiBeginCodeToolsFailed = 'BeginCodeTools failed!';
|
||||||
|
lisConvDelphiReady = 'Ready.';
|
||||||
|
lisConvDelphiAborted = 'Aborted.';
|
||||||
|
lisConvDelphiConvertingUnitFile = 'Converting unit file %s';
|
||||||
|
lisConvDelphiRepairingFormFile = 'Repairing form file %s';
|
||||||
|
lisConvDelphiErrorCanTFindUnit = '%s(%s,%s) Error: Can''t find unit %s';
|
||||||
|
lisConvDelphiAllSubDirectoriesWillBeScannedForUnitFiles = 'All sub-directorie'
|
||||||
|
+'s will be scanned for unit files';
|
||||||
|
lisConvDelphiMissingIncludeFile = '%s(%s,%s) missing include file';
|
||||||
|
lisConvDelphiError = 'Error="%s"';
|
||||||
|
lisConvDelphiReplacedUnitSWithSInUsesSection = 'Replaced unit "%s" with "%'
|
||||||
|
+'s" in uses section.';
|
||||||
|
lisConvDelphiRemovedUsedUnitSInUsesSection = 'Removed used unit "%s" in '
|
||||||
|
+'uses section.';
|
||||||
|
lisConvDelphiUnitsToReplaceIn = 'Units to replace in %s';
|
||||||
|
lisConvDelphiFailedConvertingUnit = 'Failed converting unit';
|
||||||
|
lisConvDelphiFailedToConvertUnit = 'Failed to convert unit%s%s%s';
|
||||||
|
lisConvDelphiConvertDelphiProject = 'Convert Delphi project';
|
||||||
|
lisConvDelphiConvertDelphiPackage = 'Convert Delphi package';
|
||||||
|
lisConvDelphiConversionReady = 'Conversion Ready.';
|
||||||
|
lisConvDelphiConversionAborted = 'Conversion Aborted.';
|
||||||
|
lisConvDelphiRepairingFormFiles = '*** Repairing form files... ***';
|
||||||
|
lisConvDelphiUnitnameExistsTwice = 'Unitname exists twice';
|
||||||
|
lisConvDelphiThereAreTwoUnitsWithTheSameUnitname = 'There are two units '
|
||||||
|
+'with the same unitname:%s%s%s%s%s';
|
||||||
|
lisConvDelphiRemoveFirst = 'Remove first';
|
||||||
|
lisConvDelphiRemoveSecond = 'Remove second';
|
||||||
|
lisConvDelphiKeepBoth = 'Keep both';
|
||||||
|
lisConvDelphiFindAllUnitFiles = '*** Find all unit files... ***';
|
||||||
|
lisConvDelphiAtThisPointThereShouldBeNoMissingUnits = 'At this point there '
|
||||||
|
+'should be no missing units!';
|
||||||
|
lisConvDelphiConvertingUnitFiles = '*** Converting unit files... ***';
|
||||||
|
lisConvDelphiPackageNameExists = 'Package name exists';
|
||||||
|
lisConvDelphiThereIsAlreadyAPackageWithTheNamePleaseCloseThisPa = 'There is '
|
||||||
|
+'already a package with the name "%s"%sPlease close this package first.';
|
||||||
|
lisConvDelphiUnitsNotFound = 'Units not found';
|
||||||
|
lisConvDelphiSomeUnitsOfTheDelphiPackageAreMissing = 'Some units of the '
|
||||||
|
+'Delphi package are missing:%s%s';
|
||||||
|
lisConvDelphiDelphiPackageMainSourceDpkFileNotFoundForPackage = 'Delphi '
|
||||||
|
+'package main source (.dpk) file not found for package%s%s';
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user