Languages Property

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

Description

A file can contain multiple version information blocks translated in different languages. The Languages property lets you get the number of different version information blocks included in the file.

To get the translation languages and code pages, use the Language and CodePage properties.

Declaration

aqFileVersionInfoObj.Languages

Read-Only Property Integer
aqFileVersionInfoObj An expression, variable or parameter that specifies a reference to an aqFileVersionInfo object

Applies To

The property is applied to the following object:

Property Value

The total number of version information translations in the file.

Example

The following example posts information about Notepad’s version information translations to the test log:

JavaScript, JScript

function VersionInfoSample()
{
  var FileName = Sys.OSInfo.WindowsDirectory + "\\notepad.exe";
  var VerInfo = aqFileSystem.GetFileInfo(FileName).VersionInfo;

  for (var i = 0; i < VerInfo.Languages; i++)
    Log.Message("Language: " + VerInfo.Language(i) + ", Code page: " + VerInfo.CodePage(i));
  Log.Message("Total number of languages: " + VerInfo.Languages);
}

Python

def VersionInfoSample():
  FileName = Sys.OSInfo.WindowsDirectory + "\\notepad.exe"
  VerInfo = aqFileSystem.GetFileInfo(FileName).VersionInfo
  for i in range(0, VerInfo.Languages):
    Log.Message("Language: " + VerInfo.Language[i] + ", Code page: " + str(VerInfo.CodePage[i]))
  Log.Message("Total number of languages: " + str(VerInfo.Languages))

VBScript

Sub VersionInfoSample
  Dim FileName, VerInfo, i

  FileName = Sys.OSInfo.WindowsDirectory & "\notepad.exe"
  Set VerInfo = aqFileSystem.GetFileInfo(FileName).VersionInfo

  For i = 0 To VerInfo.Languages - 1
    Log.Message "Language: " & VerInfo.Language(i) & ", Code page: " & VerInfo.CodePage(i)
  Next
  Log.Message "Total number of languages: " & VerInfo.Languages
End Sub

DelphiScript

procedure VersionInfoSample;
var FileName, VerInfo, i;
begin
  FileName := Sys.OSInfo.WindowsDirectory + '\notepad.exe';
  VerInfo := aqFileSystem.GetFileInfo(FileName).VersionInfo;

  for i := 0 to VerInfo.Languages - 1 do
    Log.Message('Language: ' + VerInfo.Language[i] + ', Code page: ' + VerToStr(VerInfo.CodePage[i]));
  Log.Message('Total number of languages: ' + VarToStr(VerInfo.Languages));
end;

C++Script, C#Script

function VersionInfoSample()
{
  var FileName = Sys["OSInfo"]["WindowsDirectory"] + "\\notepad.exe";
  var VerInfo = aqFileSystem["GetFileInfo"](FileName)["VersionInfo"];

  for (var i = 0; i < VerInfo["Languages"]; i++)
    Log["Message"]("Language: " + VerInfo["Language"](i) + ", Code page: " + VerInfo["CodePage"](i));
  Log["Message"]("Total number of languages: " + VerInfo["Languages"]);
}

See Also

Language Property
CodePage Property

Highlight search results