I am using Delphi XE3. The default language is English and I add a language of Chinese.
THen I use the following method to detect the locale of the current application:
procedure TForm1.Button1Click(Sender: TObject);
var
strNameBuffer : array [0..LOCALE_NAME_MAX_LENGTH-1] of WideChar;
begin
if (LCIDToLocaleName(GetThreadLocale(), strNameBuffer, LOCALE_NAME_MAX_LENGTH, 0) = 0) then
RaiseLastOSError
else
Application.MessageBox(strNameBuffer, 'Info');
end;
When I set the locale override key under HKEY_CURRENT_USER\Software\Embarcadero\Locales to "EN", then the UI will show English. But clicking the Button1 will show the current thread locale as zh-CN, why?