Setting the System Language From Scripts

Applies to TestComplete 15.47, last modified on January 20, 2023

To get the current supported language or to set a new one from script in TestComplete, use the aqEnvironment.LanguageForNonUnicodePrograms property.

To specify the property value, use the string defined in the Control Panel | Regional and Language Options | Advanced | Language for non-Unicode programs option. If you type an incomplete language name as the value of this property, TestComplete will define the first language that starts with the specified string as the system language. For example, if you type Spanish as the value of this property, TestComplete will set the Spanish (Argentina) language as the system language. So, if you need the Spanish (Mexico) language, you should type the full string as the value of the LanguageForNonUnicodePrograms property.

Note that support for the needed language must be installed in the operating system before changing the language. To learn how to install language support, see Windows documentation.

If you change the setting, the changes will take effect only after the system is restarted. You can restart the system manually or use the aqEnvironment.RebootAndContinue method to restart the system automatically from script.

Once you have selected the language to be used for non-Unicode programs, TestComplete panels and dialogs can display Unicode strings in that language.

Examples

The following code demonstrates the use of the aqEnvironment.LanguageForNonUnicodePrograms property and of the aqEnvironment.RebootAndContinue method. The Main procedure sets the Zulu language as the system language and then restarts the system. After system rebooting, the Unit1.Proc1 procedure is executed under the specified user account (UserName1 and Password1).

JavaScript, JScript

function Main()
{
  aqEnvironment.LanguageForNonUnicodePrograms = "Zulu";
  aqEnvironment.RebootAndContinue("Unit1.Proc1", "Password1", "UserName", "");
}

Python

def Main():
  aqEnvironment.LanguageForNonUnicodePrograms = "Zulu";
  aqEnvironment.RebootAndContinue("Unit1.Proc1", "Password1", "UserName", "");

VBScript

Sub Main

  aqEnvironment.LanguageForNonUnicodePrograms = "Zulu"
  Call aqEnvironment.RebootAndContinue("Unit1.Proc1", "Password1", "UserName1", "")

End Sub

DelphiScript

procedure Main;
begin

  aqEnvironment.LanguageForNonUnicodePrograms := 'Zulu';
  aqEnvironment.RebootAndContinue('Unit1.Proc1', 'Password1', 'UserName1','');
    
end;

C++Script, C#Script

function Main()
{
  aqEnvironment["LanguageForNonUnicodePrograms"] = "Zulu";
  aqEnvironment["RebootAndContinue"]("Unit1.Proc1", "Password1", "UserName", "");
}

See Also

LanguageForNonUnicodePrograms Property
RebootAndContinue Method
Setting the System Language Manually

Highlight search results