CurrentLocaleName Property

Applies to TestComplete 15.0, last modified on November 17, 2021
The information below concerns legacy mobile tests that work with mobile devices connected to the local computer. For new mobile tests, we recommend using the newer cloud-compatible approach.

Description

Returns the current locale of the Android device:

Declaration

ProgObj.CurrentLocaleName

Read-Only Property String
ProgObj An expression, variable or parameter that specifies a reference to one of the objects listed in the Applies To section

Applies To

The property is applied to the following object:

Property Value

A string representing the current locale.

Example

JavaScript, JScript

function Test()
{
  // Specify the current device
  Mobile.SetCurrent("MyDevice");

  // Post information about the locale to the log
  Log.Message(Mobile.Device().CurrentLocaleName);

}

Python

def Test():
  # Specify the current device
  Mobile.SetCurrent("MyDevice")

  # Post information about the locale to the log
  Log.Message(Mobile.Device().CurrentLocaleName)

VBScript

Sub Test
  ' Specify the current device
  Call Mobile.SetCurrent("MyDevice")

  ' Post information about the locale to the log
  Call Log.Message(Mobile.Device.CurrentLocaleName)

End Sub

DelphiScript

procedure Test;
begin
  // Specify the current device
  Mobile.SetCurrent('MyDevice');

  // Post information about the locale to the log
  Log.Message(Mobile.Device.CurrentLocaleName);

end;

C++Script, C#Script

function Test()
{
  // Specify the current device
  Mobile["SetCurrent"]("MyDevice");

  // Post information about the locale to the log
  Log["Message"](Mobile["Device"]["CurrentLocaleName"]);

}

See Also

AndroidDevice Object
Testing Android Applications (Legacy)
Working With Android Device Settings During Test Run (Legacy)

Highlight search results