Delphi xe.
For Tab Administrative
- Unicode lang
use GetSystemDefaultLangID
For Tab Formats
-
use GetUserDefaultLangID
But what do I use for For Tab Location
?
For Tab "Keyboard and Language"
for Vista and above: Getlocaleinfo with key LOCALE_CUSTOM_UI_DEFAULT
Function GetLocaleInformation(flag: integer): string;
var
pclca: array[0..20] of char;
begin
if (GetLocaleInfo(
//locale_system_default - Always identical values returns
LOCALE_CUSTOM_UI_DEFAULT // work only Vista-Win7, not Xp **
,flag,pclca,19) <= 0 ) then begin
pclca[0] := #0;
end;
Result := pclca;
end;
1.1 - How to get selected geographical location (geographic ID) ?
Use the GetUserGeoID
function which returns the geographical location
currently selected by user.
1.2 - How to get selected display language for Multilingual User Interface (MUI) in Windows XP ?
Use the GetUserDefaultUILanguage
function which returns the language identifier
currently selected by user.
2 - Is there an universal way how to get the selected display language supported since Windows XP till Windows 7 ?
Yes, it is. It's just the previously mentioned GetUserDefaultUILanguage
function. There's a remark:
If the user UI language is part of a Language Interface Pack (LIP) and corresponds to a supplemental locale, this function returns LOCALE_CUSTOM_UI_DEFAULT.
It is supported since Windows 2000 and it should return selected display language even for Windows Vista above (LOCALE_CUSTOM_UI_DEFAULT
).
3 - How to get the list of available user interface languages ?
Use the EnumUILanguages
function. In Windows XP, it passes the language identifiers
to the EnumUILanguagesProc
callback function. Since Windows Vista you can even specify additional flags which supplies to pass the language names to that callback function or you can specify the filtering for licensed languages or for the languages allowed by the group policy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With