Using JScript in TestComplete, how do I retrieve the locale name?
Should I use
GetLocaleInfoorGetLocaleInfoEx?It looks like the
LOCALE_SNAMEconstant is not defined in TestComplete. What value should I pass instead?
I tried this code:
function GetTimeSettings()
{
  var rrr = Win32API.GetUserDefaultLCID();
  LOCALE_SNAME = rrr;
  Log.Message("Locale Name: " + GetLocaleInfoEx(LOCALE_USER_DEFAULT, LOCALE_SNAME));
}
but it throws the "Object expected" error.
                        
Use
aqEnvironment.GetLocaleInfo, or justGetLocaleInfofor short. It's a wrapper for the Windows API functionGetLocaleInfo.The
LOCALE_SNAMEconstant isn't defined in TestComplete; you need to define it manually: