mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 01:57:57 +02:00
PoChecker: Textual fixes. Patch by Reinier.
git-svn-id: trunk@44199 -
This commit is contained in:
parent
1dcb742328
commit
0b643cfb88
@ -1,2 +1,2 @@
|
||||
A standalone application to checks the validity of translated PO files.
|
||||
A standalone application to check the validity of translated PO files.
|
||||
Uses the same source files as the PoChecker package.
|
||||
|
@ -3,5 +3,5 @@ This package checks the validity of translated PO files.
|
||||
Original version made by Bart Broersma
|
||||
|
||||
ToDo:
|
||||
- Find automatically all PO files belonging to the current project.
|
||||
- Automatically find all PO files belonging to the current project.
|
||||
- Improve IDE integration
|
||||
|
@ -59,8 +59,8 @@ type
|
||||
procedure SelectAllCheckBoxClick(Sender: TObject);
|
||||
private
|
||||
PoFamily: TPoFamily;
|
||||
FChoosenMasterName: String;
|
||||
FChoosenChildName: String;
|
||||
FChosenMasterName: String;
|
||||
FChosenChildName: String;
|
||||
procedure OnTestStart(const ATestName, APoFileName: String);
|
||||
procedure OnTestEnd(const ATestName: String; const ErrorCount: Integer);
|
||||
procedure FillTestListBox;
|
||||
@ -232,33 +232,33 @@ begin
|
||||
ShortFn := ExtractFileName(Fn);
|
||||
if IsMasterPoName(Fn) then
|
||||
begin
|
||||
FChoosenMasterName := Fn;
|
||||
FChoosenChildName := '';
|
||||
FChosenMasterName := Fn;
|
||||
FChosenChildName := '';
|
||||
end
|
||||
else
|
||||
begin //not a mastername, may be a child
|
||||
FChoosenChildName := Fn;
|
||||
FChoosenMasterName := ExtractMasterNameFromChildName(Fn);
|
||||
if (FChoosenMasterName = '') then
|
||||
FChosenChildName := Fn;
|
||||
FChosenMasterName := ExtractMasterNameFromChildName(Fn);
|
||||
if (FChosenMasterName = '') then
|
||||
begin
|
||||
FChoosenMasterName := '';
|
||||
FChoosenChildName := '';
|
||||
FChosenMasterName := '';
|
||||
FChosenChildName := '';
|
||||
ShowError(Format(sNotAProperFileName,[ShortFn]));
|
||||
end
|
||||
else if not FileExistsUtf8(FChoosenMasterName) then
|
||||
else if not FileExistsUtf8(FChosenMasterName) then
|
||||
begin
|
||||
FChoosenMasterName := '';
|
||||
FChoosenChildName := '';
|
||||
FChosenMasterName := '';
|
||||
FChosenChildName := '';
|
||||
ShowError(Format(sCannotFindMaster,[ShortFn]));
|
||||
end;
|
||||
end;
|
||||
OK := (FChoosenMasterName <> '');
|
||||
OK := (FChosenMasterName <> '');
|
||||
if OK then
|
||||
begin
|
||||
if Assigned(PoFamily) then
|
||||
PoFamily.Free;
|
||||
try
|
||||
PoFamily := TPoFamily.Create(FChoosenMasterName, FChoosenChildName);
|
||||
PoFamily := TPoFamily.Create(FChosenMasterName, FChosenChildName);
|
||||
PoFamily.OnTestStart := @OnTestStart;
|
||||
PoFamily.OnTestEnd := @OnTestEnd;
|
||||
except
|
||||
@ -302,9 +302,9 @@ begin
|
||||
SL := TStringList.Create;
|
||||
try
|
||||
StatusPanel.Enabled := True;
|
||||
if (not (ptoFindAllChilds in Options)) and Assigned(PoFamily.Child)
|
||||
and (PoFamily.ChildName <> FChoosenChildName) then
|
||||
PoFamily.ChildName := FChoosenChildName;
|
||||
if (not (ptoFindAllChildren in Options)) and Assigned(PoFamily.Child)
|
||||
and (PoFamily.ChildName <> FChosenChildName) then
|
||||
PoFamily.ChildName := FChosenChildName;
|
||||
PoFamily.RunTests(Options, ErrorCount, WarningCount, SL);
|
||||
debugln('RunSelectedTests: ',Format(sTotalErrors,[ErrorCount]));
|
||||
debugln(' ',Format(sTotalWarnings,[WarningCount]));
|
||||
|
@ -15,12 +15,12 @@ Type
|
||||
|
||||
TPoTestOption = (ptoCheckNrOfItems, ptoCheckFormatArgs, ptoCheckMissingIdentifiers,
|
||||
ptoCheckMismatchedOriginals, ptoCheckDuplicateOriginals, ptoCheckStatistics,
|
||||
ptoFindAllChilds);
|
||||
ptoFindAllChildren);
|
||||
TPoTestOptions = Set of TPoTestOption;
|
||||
|
||||
const
|
||||
optRunAllTests: TPoTestOptions = [];
|
||||
optRunAllTestsOnAllChilds: TPoTestOptions = [];
|
||||
optRunAllTestsOnAllChildren: TPoTestOptions = [];
|
||||
|
||||
PoTestOptionNames: array[TPoTestOption] of String = (
|
||||
'Check number of items',
|
||||
@ -655,7 +655,7 @@ begin
|
||||
Exit;
|
||||
end
|
||||
end;
|
||||
if not Assigned(FChild) and ([ptoFindAllChilds, ptoCheckDuplicateOriginals] * Options = []) then
|
||||
if not Assigned(FChild) and ([ptoFindAllChildren, ptoCheckDuplicateOriginals] * Options = []) then
|
||||
begin
|
||||
{$ifdef DebugSimplePoFiles}
|
||||
Debugln('TPoFamily.RunTests: no child assigned for ',ShortMasterName);
|
||||
@ -663,7 +663,7 @@ begin
|
||||
Exit;
|
||||
end;
|
||||
|
||||
if (ptoFindAllChilds in Options) then
|
||||
if (ptoFindAllChildren in Options) then
|
||||
begin
|
||||
SL := FindAllTranslatedPoFiles(FMasterName);
|
||||
//We want current Child (if currently assigned) at index 0
|
||||
@ -766,8 +766,8 @@ procedure InitTestOptions;
|
||||
var
|
||||
Index: TPoTestOption;
|
||||
begin
|
||||
for Index := Low(TPoTestOption) to High(TPotestOption) do optRunAllTestsOnAllChilds := optRunAllTestsOnAllChilds + [Index];
|
||||
optRunAllTests := optRunAllTestsOnAllChilds - [ptoFindAllChilds];
|
||||
for Index := Low(TPoTestOption) to High(TPotestOption) do optRunAllTestsOnAllChildren := optRunAllTestsOnAllChildren + [Index];
|
||||
optRunAllTests := optRunAllTestsOnAllChildren - [ptoFindAllChildren];
|
||||
end;
|
||||
|
||||
Initialization
|
||||
|
Loading…
Reference in New Issue
Block a user