mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-10 19:47:17 +01:00
PoChecker: use FindAllTranslatedPoFiles function from Translations unit
git-svn-id: trunk@57829 -
This commit is contained in:
parent
401c1ad2dd
commit
91d023c1b6
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user