anik_cadieux
13 years agoContributor
How to set Regional Settings Language
function SetRegionalSettingsLanguage(strSetting)
{
if (Sys.OSInfo.Name == "WinXP")
{
if (aqEnvironment.GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SLANGUAGE) == strSetting)
return true;
else
return (aqEnvironment.SetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SLANGUAGE, strSetting));
}
else
{
if (aqEnvironment.GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SLOCALIZEDDISPLAYNAME) == strSetting)
return true;
else
return aqEnvironment.SetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SLOCALIZEDDISPLAYNAME, strSetting);
}
}
The problem is that GetLocaleInfo is unable to properly set the desired language. There are no erros, but GetLocaleInfo function always returns false and language is not changed.
GetLocaleInfo call works fine and return the displayed language.
We use Windows XP in Franch.
For example, if strSetting = "Français (Canada)", GetLocaleInfo returns "Français (Canada)". But SetLocaleInfo still returns false...
Anyone ever tried it ?