From Clomosy Docs

No edit summary
No edit summary
 
(4 intermediate revisions by 2 users not shown)
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>
<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>


:'''TRObject 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>
  void deviceLanguageSupport;
If the device's language is English;<br>
  {
<div class="alert alert-success" role="alert" data-bs-theme="light">
  ShowMessage(clStrToLan('Ok|Tamam'));
Ok
  }
</div>
 
  {
  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'''
<h2> See Also </h2>
var
* [[System_Library#Cl_Utilities_Functions | Cl Utilities Functions]]
  MyForm:TclForm;
{{#seo:|title=ClStrToLan Using in Clomosy - Clomosy Docs}}
  testBtn : TclButton;
{{#seo:|description=Learn how the clStrToLan function in Clomosy adapts text to the device's language settings, supporting English and Turkish localization.}}
procedure deviceLanguageSupport;
begin
  ShowMessage(clStrToLan('Ok|Tamam'));
end;
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 =
* [[Controls| Controls]]

Latest revision as of 15:17, 24 December 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

var
 S : String;

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

Output:
If the device's language is Turkish;

If the device's language is English;

See Also