For my logger i need to get the text from 'en' language.
To see items in my logger in Japanese or polisch doesn't tell me much.
To get the text from the Text list i use cmpDynamictext library:
sText:= cmpDynamictext.DynamicTextGetText(ADR(sAlarmGroup), ADR(sAlarmID))^; //Get name, language dependent
sDefaultText:= cmpDynamictext.DynamicTextGetDefaultText(ADR(sAlarmGroup), ADR(sAlarmID))^; //Get default name
The easy way is to put the 'en' text in the default, but this is my alarm ID.
Is there a way to get from a specific language the text?
Thanks,
Ton.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
This solution takes a lot of performance.
When for example two alarm bits comes at the same time the second has a delay of few seconds.
I quess my visu do also get translated, so not a good solution.
For now i just take default language.
π
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
For my logger i need to get the text from 'en' language.
To see items in my logger in Japanese or polisch doesn't tell me much.
To get the text from the Text list i use cmpDynamictext library:
sText:= cmpDynamictext.DynamicTextGetText(ADR(sAlarmGroup), ADR(sAlarmID))^; //Get name, language dependent
sDefaultText:= cmpDynamictext.DynamicTextGetDefaultText(ADR(sAlarmGroup), ADR(sAlarmID))^; //Get default name
The easy way is to put the 'en' text in the default, but this is my alarm ID.
Is there a way to get from a specific language the text?
Thanks,
Ton.
more posts ...
Hallo Ton,
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.
TLU.GetText(_sTextList,_sTextIndex,ADR(_sTranslatedText),SIZEOF(_sTranslatedText));
We do have 2 default languages and the third language is country-specific. We simple replace the .txt file on the target device.
Hi Ludecus,
Thanks for your input.
With this function i have the same problem.
I want a specific language ('en') and not the activated language (might be unreadable if 'jp').
I don't thinks this function exist.
Thanks,
Ton.
Please try this
VisuElems.cmpDynamictext.DynamicTextGetDefaultText(ADR(_sTextList),ADR(_sTextIndex))
Last edit: ludecus 2022-04-26
I do it this way:
Last edit: kislov 2022-04-27
Hi Kislov,
This is what i was looking for.
Many thanks!!!
This solution takes a lot of performance.
When for example two alarm bits comes at the same time the second has a delay of few seconds.
I quess my visu do also get translated, so not a good solution.
For now i just take default language.