<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Text list, get text from surtain language.</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/4c8bbac001/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Visualization/thread/4c8bbac001/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Visualization/thread/4c8bbac001/</id><updated>2022-05-08T14:18:52.866000Z</updated><subtitle>Recent posts to Text list, get text from surtain language.</subtitle><entry><title>Text list, get text from surtain language.</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/4c8bbac001/?limit=25#34e9" rel="alternate"/><published>2022-05-08T14:18:52.866000Z</published><updated>2022-05-08T14:18:52.866000Z</updated><author><name>Ton</name><uri>https://forge.codesys.com/u/ton/</uri></author><id>https://forge.codesys.com270521027c8aec7209bbea025a337c5a74f00af4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;This solution takes a lot of performance.&lt;br/&gt;
When for example two alarm bits comes at the same time the second has a delay of few seconds.&lt;br/&gt;
I quess my visu do also get translated, so not a good solution.&lt;br/&gt;
For now i just take default language.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Text list, get text from surtain language.</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/4c8bbac001/?limit=25#8c28" rel="alternate"/><published>2022-04-27T12:27:32.375000Z</published><updated>2022-04-27T12:27:32.375000Z</updated><author><name>Ton</name><uri>https://forge.codesys.com/u/ton/</uri></author><id>https://forge.codesys.com5b84eb783f34e8d62953b404d529cb64dd4533e5</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Kislov,&lt;/p&gt;
&lt;p&gt;This is what i was looking for.&lt;/p&gt;
&lt;p&gt;Many thanks!!!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Text list, get text from surtain language.</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/4c8bbac001/?limit=25#fbb3" rel="alternate"/><published>2022-04-27T11:22:42.847000Z</published><updated>2022-04-27T11:22:42.847000Z</updated><author><name>kislov</name><uri>https://forge.codesys.com/u/kislov/</uri></author><id>https://forge.codesys.com5b08907e154d39bf0568cdb5ea78e47054816f27</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I do it this way:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;PROGRAM&lt;/span&gt; &lt;span class="nt"&gt;PLC_PRG&lt;/span&gt;
&lt;span class="nt"&gt;VAR&lt;/span&gt;
   &lt;span class="nt"&gt;xGetText&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;BOOL&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
   &lt;span class="nt"&gt;sCurrentLanguage&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;STRING&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;20&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
   &lt;span class="nt"&gt;sTextListName&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;STRING&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="s1"&gt;'TextList'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
   &lt;span class="nt"&gt;sTextId&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;STRING&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="s1"&gt;'0'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
   &lt;span class="nt"&gt;psText&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;POINTER&lt;/span&gt; &lt;span class="nt"&gt;TO&lt;/span&gt; &lt;span class="nt"&gt;STRING&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
   &lt;span class="nt"&gt;sText&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;STRING&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;END_VAR&lt;/span&gt;

&lt;span class="nt"&gt;IF&lt;/span&gt; &lt;span class="nt"&gt;xGetText&lt;/span&gt; &lt;span class="nt"&gt;THEN&lt;/span&gt;
   &lt;span class="nt"&gt;sCurrentLanguage&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;CmpDynamicText&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;DynamicTextGetCurrentLanguage&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
   &lt;span class="o"&gt;**//&lt;/span&gt; &lt;span class="nt"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;language&lt;/span&gt; &lt;span class="nt"&gt;what&lt;/span&gt; &lt;span class="nt"&gt;you&lt;/span&gt; &lt;span class="nt"&gt;need&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;
   &lt;span class="nt"&gt;CmpDynamicText&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;DynamicTextChangeLanguage&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'en'&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
   &lt;span class="nt"&gt;sText&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;CmpDynamicText&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;DynamicTextGetText&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;ADR&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;sTextListName&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt; &lt;span class="nt"&gt;ADR&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;sTextId&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;)^;&lt;/span&gt;
   &lt;span class="nt"&gt;CmpDynamicText&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;DynamicTextChangeLanguage&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;sCurrentLanguage&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
   &lt;span class="nt"&gt;xGetText&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;FALSE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;END_IF&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry><entry><title>Text list, get text from surtain language.</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/4c8bbac001/?limit=50#6c43" rel="alternate"/><published>2022-04-26T08:28:57.887000Z</published><updated>2022-04-26T08:28:57.887000Z</updated><author><name>ludecus</name><uri>https://forge.codesys.com/u/ludecus/</uri></author><id>https://forge.codesys.com7e19bf10bf5d01c19d4e1a840b7e1857bdfed386</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Try to use this &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;VisuElems.cmpDynamictext.DynamicTextGetDefaultText(ADR(_sTextList),ADR(_sTextIndex))&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry><entry><title>Text list, get text from surtain language.</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/4c8bbac001/?limit=25#c114" rel="alternate"/><published>2022-04-26T08:09:12.532000Z</published><updated>2022-04-26T08:09:12.532000Z</updated><author><name>Ton</name><uri>https://forge.codesys.com/u/ton/</uri></author><id>https://forge.codesys.com63ebb84f3bfa235545bb3b6602988a874ed79916</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Ludecus,&lt;/p&gt;
&lt;p&gt;Thanks for your input.&lt;/p&gt;
&lt;p&gt;With this function i have the same problem.&lt;br/&gt;
I want a specific language ('en') and not the activated language (might be unreadable if 'jp').&lt;/p&gt;
&lt;p&gt;I don't thinks this function exist.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br/&gt;
Ton.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Text list, get text from surtain language.</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/4c8bbac001/?limit=50#3ff3" rel="alternate"/><published>2022-04-26T07:15:13.788000Z</published><updated>2022-04-26T07:15:13.788000Z</updated><author><name>ludecus</name><uri>https://forge.codesys.com/u/ludecus/</uri></author><id>https://forge.codesys.comf78b698b19b64e17710544a8d948b9f4ac3575f8</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hallo Ton,&lt;/p&gt;
&lt;p&gt;we use the GetText function of the TextListUtils (TLU) library. The function returns the text in the activated language. In case the text doesn't exist in this language the function gives the text in the default language.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;TLU.GetText(_sTextList,_sTextIndex,ADR(_sTranslatedText),SIZEOF(_sTranslatedText));&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;We do have 2 default languages and the third language is country-specific. We simple replace the .txt file on the target device.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Text list, get text from surtain language.</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/4c8bbac001/?limit=25#3077" rel="alternate"/><published>2022-04-25T11:35:58.583000Z</published><updated>2022-04-25T11:35:58.583000Z</updated><author><name>Ton</name><uri>https://forge.codesys.com/u/ton/</uri></author><id>https://forge.codesys.com3fbabb93ab6ede2a0c687df760d31d39e6d4d1e2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;For my logger i need to get the text from 'en' language.&lt;br/&gt;
To see items in my logger in Japanese or polisch doesn't tell me much.&lt;/p&gt;
&lt;p&gt;To get the text from the Text list i use cmpDynamictext library:&lt;br/&gt;
sText:= cmpDynamictext.DynamicTextGetText(ADR(sAlarmGroup), ADR(sAlarmID))^;                //Get name, language dependent&lt;br/&gt;
sDefaultText:= cmpDynamictext.DynamicTextGetDefaultText(ADR(sAlarmGroup), ADR(sAlarmID))^;  //Get default name&lt;/p&gt;
&lt;p&gt;The easy way is to put the 'en' text in the default, but this is my alarm ID.&lt;/p&gt;
&lt;p&gt;Is there a way to get from a specific language the text?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br/&gt;
Ton.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>