Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/VCL    [ Add a report in this area ]  
Report #:  77627   Status: Reported
LoadResourceModule does not let you to choose the initial language
Project:  Delphi Build #:  3513
Version:    14.0 Submitted By:   Jaakko Salmenius
Report Type:  Basic functionality failure Date Reported:  9/12/2009 8:36:16 AM
Severity:    Serious / Highly visible problem Last Updated: 9/13/2009 7:10:10 PM
Platform:    All platforms Internal Tracking #:  
Resolution: None  Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: (2 Total Ratings)
5.00 out of 5
Total Votes: 11
Delphi 2010 has dramatically changed LoadResourceModule function. As a result all localized application work in a different way as they did earlier.

Before 2010 VCL checked if there was a locale override in system registry. If there was it was used. If the was no locale override then locale matching the default locale of the system was used (SABBREVLANGNAME). As a result if there was no locale override in the registry VCL loaded resource DLL that matched the current locale settings (set in Control Panel | Reginonal settings). For example if I have Project1.exe, Project1.DE and Project1.JP and I run the app in German Windows or English Windows having German formats turned on VCL loaded German resources (Project1.DE).

Delphi 2010 changed this. The locale overrides are read from registry in the same way as in the previous versions. However things get different when there is not entry in registry. Instead of reading system default locale and loading resource DLL matching to that Delphi uses locale returned by GetUserDefaultUILanguage. Why is this bad? Because there is not easy way to change this value. The ONLY way to change it to install multilingual user interface of OS itself and then set user to use that language.

The old method was much more flexible because without installing any multilingual interface you could set the Formats combo in the regional settings to the language you wanted and then your application would run in that language (if you have a matching resource DLL)

Can you please change the logic. A good solution would be this:
1) Check if any locale override. If is use it.
2) Check if user default UI locale (GetUserDefaultUILanguage) is different from default system UI locale (GetSystemDefaultUILanguage) . If does use it
3) Finally read the system default locale and use if (as Delphi 2009 did)

If you have any questions please contact me
Steps to Reproduce:

Tomohiro Takahashi at 9/13/2009 7:08:50 PM -
I corrected Project field, Version field and Area field as Sysop.

Server Response from: ETNACODE01