mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 15:59:13 +02:00
LCLTranslator: Fix FindLocaleFilename failing if optional directory is absolute or ends with a path delimiter.
git-svn-id: trunk@52527 -
This commit is contained in:
parent
f62aa7b77d
commit
7f8864e5b6
@ -96,6 +96,7 @@ var
|
|||||||
var
|
var
|
||||||
LangShortID: string;
|
LangShortID: string;
|
||||||
AppDir,LCFileName,FullLCFileName: String;
|
AppDir,LCFileName,FullLCFileName: String;
|
||||||
|
absoluteDir: Boolean;
|
||||||
begin
|
begin
|
||||||
DefaultLang := LangID;
|
DefaultLang := LangID;
|
||||||
|
|
||||||
@ -107,8 +108,12 @@ var
|
|||||||
|
|
||||||
if Dir<>'' then
|
if Dir<>'' then
|
||||||
begin
|
begin
|
||||||
Result := AppDir + Dir + DirectorySeparator + LangID +
|
Dir := AppendPathDelim(Dir);
|
||||||
DirectorySeparator + LCFileName;
|
absoluteDir := FilenameIsWinAbsolute(Dir) or FilenameIsUnixAbsolute(Dir);
|
||||||
|
if absoluteDir then
|
||||||
|
Result := Dir + LangID + DirectorySeparator + LCFileName
|
||||||
|
else
|
||||||
|
Result := AppDir + Dir + LangID + DirectorySeparator + LCFileName;
|
||||||
if FileExistsUTF8(Result) then
|
if FileExistsUTF8(Result) then
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -145,8 +150,10 @@ var
|
|||||||
|
|
||||||
if Dir<>'' then
|
if Dir<>'' then
|
||||||
begin
|
begin
|
||||||
Result := AppDir + Dir + DirectorySeparator +
|
if absoluteDir then
|
||||||
LangShortID + DirectorySeparator + LCFileName;
|
Result := Dir + LangShortID + DirectorySeparator + LCFileName
|
||||||
|
else
|
||||||
|
Result := AppDir + Dir + LangShortID + DirectorySeparator + LCFileName;
|
||||||
if FileExistsUTF8(Result) then
|
if FileExistsUTF8(Result) then
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -176,7 +183,10 @@ var
|
|||||||
try
|
try
|
||||||
if Dir<>'' then
|
if Dir<>'' then
|
||||||
begin
|
begin
|
||||||
Result := AppDir + Dir + DirectorySeparator + FullLCFileName;
|
if absoluteDir then
|
||||||
|
Result := Dir + FullLCFileName
|
||||||
|
else
|
||||||
|
Result := AppDir + Dir + FullLCFileName;
|
||||||
if FileExistsUTF8(Result) then
|
if FileExistsUTF8(Result) then
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -207,7 +217,10 @@ var
|
|||||||
|
|
||||||
if Dir<>'' then
|
if Dir<>'' then
|
||||||
begin
|
begin
|
||||||
Result := AppDir + Dir + DirectorySeparator + FullLCFileName;
|
if absoluteDir then
|
||||||
|
Result := Dir + FullLCFileName
|
||||||
|
else
|
||||||
|
Result := AppDir + Dir + FullLCFileName;
|
||||||
if FileExistsUTF8(Result) then
|
if FileExistsUTF8(Result) then
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user