Using JScript in TestComplete, how do I retrieve the locale name?
Should I use
GetLocaleInfo
orGetLocaleInfoEx
?It looks like the
LOCALE_SNAME
constant 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 justGetLocaleInfo
for short. It's a wrapper for the Windows API functionGetLocaleInfo
.The
LOCALE_SNAME
constant isn't defined in TestComplete; you need to define it manually: