LanguageStrings property
- Last UpdatedNov 26, 2024
- 2 minute read
Use the LanguageStrings property to provide the SPC Chart control with an object for translating strings. You must use this property to provide the translation object because there is no user logged on to the control. This is a run-time property.
You can pass the translation object to the SPC Chart control in the following ways.
If your InTouch application is using other MES controls that require a user login, use the following script to use the logged in user’s translation object:
dim clienSession as aaFactMES.aaClientSession;
dim result as aaFactMES.Result;
result = aaFactMES.ClientSession.GetInstance();
if (result.Exception <> null) then
‘ Log or display an error
else
clientSession = result.Value;
if (clientSession.curUser <> null) then
spcChartControl.LanguageStrings =
clientSession.curUser.LangStrings;
else
spcChartControl.LanguageStrings = null;
endif;
endif;
If your InTouch application is not using other MES controls, use the following script to get a language translation object:
dim clientsession as aaFactMES.aaClientSession;
dim result as aaFactMES.result;
dim languageId as integer;
dim langStrings as aaFactMES.aaLangStrings;
‘ Set the language ID to your user’s language. This must be a valid language ID in the MES database.
languageId=1000;
result=aaFactMES.aaclientsession.GetInstance();
if (result.Exception<>null) then
LogMessage(result.Exception.Message);
else
clientsession=result.value;
result = clientsession.GetLangStringsObject(languageId);
if (result.Exception<>null) then
LogMessage(result.Exception.Message);
else
langStrings = result.Value;
SpcChartControl1.LanguageStrings=langStrings.ClientAPIClass;
endif;
endif;
This script must be called before calling the DisplayChart() method. If you want to change the language after calling the DisplayChart() method, then you will have to call DisplayChart() again before you will see the language change.
You can set this property to Null. If the LanguageStrings property is set to Null, the strings are not translated. Instead, the strings are displayed in the language used by the developer.
|
Data Type |
Read/Write |
Default Value |
|---|---|---|
|
ILanguageStrings |
R/W |
Null |