mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 20:59:06 +02:00
LCLTranslator: removed superfluous exception handling from FindLocaleFileName function
git-svn-id: trunk@61611 -
This commit is contained in:
parent
0e01330dd2
commit
14ccbadf1f
@ -218,31 +218,26 @@ begin
|
|||||||
if FileExistsUTF8(Result) then
|
if FileExistsUTF8(Result) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
//Full language in file name - this will be default for the project
|
if Dir<>'' then
|
||||||
//We need more careful handling, as it MAY result in incorrect filename
|
begin
|
||||||
try
|
Result := Dir + FullLCFileName;
|
||||||
if Dir<>'' then
|
|
||||||
begin
|
|
||||||
Result := Dir + FullLCFileName;
|
|
||||||
if FileExistsUTF8(Result) then
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
|
|
||||||
Result := AppDir + FullLCFileName;
|
|
||||||
if FileExistsUTF8(Result) then
|
if FileExistsUTF8(Result) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
//Common location (like in Lazarus)
|
|
||||||
Result := AppDir + 'locale' + DirectorySeparator + FullLCFileName;
|
|
||||||
if FileExistsUTF8(Result) then
|
|
||||||
exit;
|
|
||||||
|
|
||||||
Result := AppDir + 'languages' + DirectorySeparator + FullLCFileName;
|
|
||||||
if FileExistsUTF8(Result) then
|
|
||||||
exit;
|
|
||||||
except
|
|
||||||
Result := '';//Or do something else (useless)
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Result := AppDir + FullLCFileName;
|
||||||
|
if FileExistsUTF8(Result) then
|
||||||
|
exit;
|
||||||
|
|
||||||
|
//Common location (like in Lazarus)
|
||||||
|
Result := AppDir + 'locale' + DirectorySeparator + FullLCFileName;
|
||||||
|
if FileExistsUTF8(Result) then
|
||||||
|
exit;
|
||||||
|
|
||||||
|
Result := AppDir + 'languages' + DirectorySeparator + FullLCFileName;
|
||||||
|
if FileExistsUTF8(Result) then
|
||||||
|
exit;
|
||||||
|
|
||||||
{$IFDEF UNIX}
|
{$IFDEF UNIX}
|
||||||
Result := '/usr/share/locale/' + LangShortID + '/LC_MESSAGES/' +
|
Result := '/usr/share/locale/' + LangShortID + '/LC_MESSAGES/' +
|
||||||
LCFileName;
|
LCFileName;
|
||||||
|
Loading…
Reference in New Issue
Block a user