PoChecker: use FindAllTranslatedPoFiles function from Translations unit

git-svn-id: trunk@57829 -
This commit is contained in:
maxim 2018-05-07 22:44:33 +00:00
parent 401c1ad2dd
commit 91d023c1b6

View File

@ -141,7 +141,6 @@ Type
function IsMasterPoName(const Fn: String): Boolean;
function ExtractMasterNameFromChildName(const AChildName: String): String;
function ExtractLanguageFromChildName(const AChildName: string): TLangID;
function FindAllTranslatedPoFiles(const Filename: string): TStringList;
procedure LocalizePoTestTypeNames;
const
@ -234,36 +233,6 @@ begin
Result := LangAbbrToLangId(Abbr);
end;
function FindAllTranslatedPoFiles(const Filename: string): TStringList;
var
Path: String;
Name: String;
NameOnly: String;
Ext: String;
FileInfo: TSearchRec;
CurExt: String;
begin
Result := TStringList.Create;
Path := ExtractFilePath(Filename);
Name := ExtractFilename(Filename);
Ext := ExtractFileExt(Filename);
NameOnly := LeftStr(Name,length(Name)-length(Ext));
if FindFirstUTF8(Path+GetAllFilesMask,faAnyFile,FileInfo)=0 then
begin
repeat
if (FileInfo.Name = '.') or (FileInfo.Name = '..') or (FileInfo.Name = '')
or (CompareFilenames(FileInfo.Name,Name) = 0) then continue;
CurExt:=ExtractFileExt(FileInfo.Name);
if (CompareFilenames(CurExt,'.po') <> 0)
or (CompareFilenames(LeftStr(FileInfo.Name,length(NameOnly)),NameOnly) <> 0)
then
continue;
Result.Add(Path+FileInfo.Name);
until FindNextUTF8(FileInfo)<>0;
end;
FindCloseUTF8(FileInfo);
end;
procedure LocalizePoTestTypeNames;
begin
PoTestTypeNames[pttCheckNrOfItems] := sCheckNumberOfItems;