Forum Discussion
- HKosova
Alumni
aqEnvironment.SetLocaleInfo lets you change individual parameters like the date/time format ot decimal separator, but not the locale itself.
Different Windows versions have different ways to change the locale programmatically:
- Windows 8+: Use the PowerShell cmdlet Set-WinSystemLocale. You can run PowerShell commands from TestComplete as explained here.
- Windows Vista, XP: run the "control intl.cpl" and pass an .xml (for Vista) or .txt (for XP) file containing the locale info. See these links for details:
https://blogs.msdn.microsoft.com/shawnste/2007/04/12/configuring-regional-and-language-options-international-settings-with-command-line-automation/
https://msdn.microsoft.com/en-us/goglobal/bb964650
https://superuser.com/questions/395818/how-to-change-keyboard-layout-via-command-line-cmd-exe-on-windows-xp-7
https://www.autoitscript.com/forum/topic/118706-fastest-way-command-line-to-change-system-locale/
To run external commands from TestComplete you can use WshShell.Run() or Sys.OleObject("WScript.Shell").Run().
If you could elaborate why you need to change the locale, we might be able to suggest a better solution.
- Windows 8+: Use the PowerShell cmdlet Set-WinSystemLocale. You can run PowerShell commands from TestComplete as explained here.
Hi,
Take a look at the SetLocaleInfo Method of the aqEnvironment Object. I suppose it should allow you to do what you want.
Also, TestComplete works with the standard Windows dialogs quite well. So, you can just record actions which will open the control panel and set the required value in the combobox.
I hope this helps.