From 14ccbadf1f19f81024e6896b7086989b3d716e35 Mon Sep 17 00:00:00 2001 From: maxim Date: Sun, 21 Jul 2019 22:35:23 +0000 Subject: [PATCH] LCLTranslator: removed superfluous exception handling from FindLocaleFileName function git-svn-id: trunk@61611 - --- lcl/lcltranslator.pas | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/lcl/lcltranslator.pas b/lcl/lcltranslator.pas index d1ffd8b0e4..dcadd2dde7 100644 --- a/lcl/lcltranslator.pas +++ b/lcl/lcltranslator.pas @@ -218,31 +218,26 @@ begin if FileExistsUTF8(Result) then exit; - //Full language in file name - this will be default for the project - //We need more careful handling, as it MAY result in incorrect filename - try - if Dir<>'' then - begin - Result := Dir + FullLCFileName; - if FileExistsUTF8(Result) then - exit; - end; - - Result := AppDir + FullLCFileName; + if Dir<>'' then + begin + Result := Dir + 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; - except - Result := '';//Or do something else (useless) 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} Result := '/usr/share/locale/' + LangShortID + '/LC_MESSAGES/' + LCFileName;