mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-16 02:10:44 +01:00
* Added some fileexists() near places where a stream was opened, but
relied on the exception mechanism to handle file not found. Makes debugging easier. git-svn-id: trunk@24274 -
This commit is contained in:
parent
b27e03346b
commit
3cc61e6195
@ -331,30 +331,39 @@ procedure TranslateResourceStrings(const AFilename: String);
|
||||
var
|
||||
mo: TMOFile;
|
||||
lang, FallbackLang: String;
|
||||
fn: String;
|
||||
begin
|
||||
GetLanguageIDs(Lang, FallbackLang);
|
||||
try
|
||||
mo := TMOFile.Create(Format(AFilename, [FallbackLang]));
|
||||
try
|
||||
TranslateResourceStrings(mo);
|
||||
finally
|
||||
mo.Free;
|
||||
end;
|
||||
except
|
||||
on e: Exception do;
|
||||
end;
|
||||
fn:=Format(AFilename, [FallbackLang]);
|
||||
|
||||
lang := Copy(lang, 1, 5);
|
||||
try
|
||||
mo := TMOFile.Create(Format(AFilename, [lang]));
|
||||
try
|
||||
TranslateResourceStrings(mo);
|
||||
finally
|
||||
mo.Free;
|
||||
if fileexists(fn) then
|
||||
begin
|
||||
try
|
||||
mo := TMOFile.Create(fn);
|
||||
try
|
||||
TranslateResourceStrings(mo);
|
||||
finally
|
||||
mo.Free;
|
||||
end;
|
||||
except
|
||||
on e: Exception do;
|
||||
end;
|
||||
end;
|
||||
lang := Copy(lang, 1, 5);
|
||||
fn:=Format(AFilename, [lang]);
|
||||
if fileexists(fn) then
|
||||
begin
|
||||
try
|
||||
mo := TMOFile.Create(Format(AFilename, [lang]));
|
||||
try
|
||||
TranslateResourceStrings(mo);
|
||||
finally
|
||||
mo.Free;
|
||||
end;
|
||||
except
|
||||
on e: Exception do;
|
||||
end;
|
||||
end;
|
||||
except
|
||||
on e: Exception do;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user