Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi Exception message text in wrong language

I have an application where I catch exceptions and show the message text to the user as part of the error message. Allthough RAD Studio (10.1) is set to English and the Locale ID is set to 409 English in the Version Info options for all Targets the error message is output in German. This happens both on a German Windows 10 and other Windows machines with other languages, even a Japanese customer got this.

The exception is a system exception like failed to open file, file not found, but it seems it happens on all kind of exceptions that I do not raise with my own message text.

The project has been migrated from Delphi 2007 recently and I had to do some manual clean up in the project files regarding the version numbers. But checking the Locale in the project file reveals no surprise: 1033 -> $0409 - English.

Where could be the reason for the German messages?

like image 402
Veit Zimmermann Avatar asked Nov 08 '22 14:11

Veit Zimmermann


1 Answers

After searching for the solution every time I could spend some minutes in the last days, I solved it!

When using the BDSSetLanguage.exe tool in the bin folder of Rad Studio you not only can change the IDE's language but also the library's language. IDE was set to English and Library was set to German. Setting the library's language to English solved the problem.

Thanks to @mrabat sending me in the right direction. But since his tip was only a hack rather than a permanent solution, I think I can't give any official credits here.

like image 185
Veit Zimmermann Avatar answered Nov 15 '22 06:11

Veit Zimmermann