From Clomosy Docs

No edit summary
No edit summary
Line 1: Line 1:
The clStrToLan function operates based on the language setting of the device where the application is being used. It processes by using the vertical bar '|' as a separator. The sentence on the left side of the separator is defined in English, while the one on the right side is defined in Turkish.
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert">
function clStrToLan(const S:String):String;
</div>


BtnOk.Text = clStrToLan('Ok|Tamam');
The clStrToLan function operates based on the language setting of the device where the application is being used. It processes by using the vertical bar '|' as a separator. The sentence on the left side of the separator is defined in English, while the one on the right side is defined in Turkish.<br>


'''Example:'''<br>
<b>Example</b><br>
<b>TRObject Syntax</b><br>
<pre>
var
S : String;


Change your device's language settings to Turkish or English so you can see this feature change.
{
S = clStrToLan('Ok|Tamam');
ShowMessage(S);
}
</pre>
<b>Base Syntax</b><br>
<pre>
var
S : String;


:'''TRObject Syntax'''
begin
  var
S := clStrToLan('Ok|Tamam');
  MyForm:TclForm;
ShowMessage(S);
  testBtn : TclButton;
end;
 
</pre>
  void deviceLanguageSupport;
  {
  ShowMessage(clStrToLan('Ok|Tamam'));
  }
 
  {
  MyForm = TclForm.Create(Self);
 
  testBtn= MyForm.AddNewButton(MyForm,'testBtn','Send message according to device language support...');
  testBtn.TextSettings.Font.Size=20;
  testBtn.Align = alCenter;
  testBtn.Height = 50;
  testBtn.Width = 300;
 
  MyForm.AddNewEvent(testBtn,tbeOnClick,'deviceLanguageSupport');
 
  MyForm.Run;
  }


:'''Base Syntax'''
<b>Output:</b><br>
var
If the device's language is Turkish;<br>
  MyForm:TclForm;
<div class="alert alert-success" role="alert" data-bs-theme="light">
  testBtn : TclButton;
Tamam
</div>
procedure deviceLanguageSupport;
If the device's language is English;<br>
begin
<div class="alert alert-success" role="alert" data-bs-theme="light">
  ShowMessage(clStrToLan('Ok|Tamam'));
Ok
end;
</div>
begin
  MyForm := TclForm.Create(Self);
  testBtn:= MyForm.AddNewButton(MyForm,'testBtn','Send message according to device language support...');
  testBtn.TextSettings.Font.Size:=20;
  testBtn.Align := alCenter;
  testBtn.Height := 50;
  testBtn.Width := 300;
  MyForm.AddNewEvent(testBtn,tbeOnClick,'deviceLanguageSupport');
  MyForm.Run;
end;


= See Also =
<h2> See Also </h2>
* [[Controls| Controls]]
* [[System_Library#Cl_Utilities_Functions | Cl Utilities Functions]]

Revision as of 06:56, 10 October 2024

The clStrToLan function operates based on the language setting of the device where the application is being used. It processes by using the vertical bar '|' as a separator. The sentence on the left side of the separator is defined in English, while the one on the right side is defined in Turkish.

Example
TRObject Syntax

var
 S : String;

{
 S = clStrToLan('Ok|Tamam');
 ShowMessage(S);
}

Base Syntax

var
 S : String;

begin
 S := clStrToLan('Ok|Tamam');
 ShowMessage(S);
end;

Output:
If the device's language is Turkish;

If the device's language is English;

See Also