Forum Discussion

anik_cadieux's avatar
anik_cadieux
Contributor
13 years ago

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 ?

2 Replies

  • Note that the MSDN article Tanya references does not say it is declared for Win7 - it says it is deprecated for Win7 and later.  LOCALE_SLANGUAGE (0x00000002) is in fact available on XP.