Labels are not translated using switchLang when label text is set in a control script

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
4 posts • Page 1 of 1
flindecke
Posts:69
Joined: Wed Jun 24, 2015 1:54 pm

Labels are not translated using switchLang when label text is set in a control script

Post by flindecke »

Hello,

i am currently checking if switching the language (e.g. via the language selector in the preview window of a panel) also switches the text for all ui elements i need.

Situation 1:
In an intialize script i will set the text of buttons and labels (i do not use the GEDI to set all the text of all ui elements!!!), by creating a langString and setting the "text" property of the button or label.
Then i change the language in the preview window.

Expectation: Text is changed on buttons and on labels
Actual: Text is only changed on buttons. Labels do not change their text.

This is a little bit weird, because my expectation is, that the text on labels will change as well.

Situation 2:
In a second test i added an additional button and label, but using GEDI to set the text on them.
In this case both ui elements change their text.

Problem:
Label text is changed if and only if text is set via GEDI!? Text of labels is not updated, when it was set in Control via langString!? Why are buttons behave different?

Question: How to handle this situation?

flindecke
Posts:69
Joined: Wed Jun 24, 2015 1:54 pm

Re: Labels are not translated using switchLang when label text is set in a control script

Post by flindecke »

Update: Now it is getting really weird. When i set GEDI property "LangChange redraw only" to "TRUE" everything works as expected.

So there seems to be a bug in
a) the button implementation, or
b) the label implementation or
c) "LangChange redraw only" = FALSE is an old compatibility flag, which should be overridable/project configurable and set to true by default for future versions, due to the unexpected behavior of ui elements
d) a utility exists, which set the LangChange redraw for my project to "true", when WinCC OA panels insists on the current behavior

So i might have a solution for my problem, but i definitely want an answer to the above mentioned situation.
If "LangChange redraw only"=TRUE is the solution, my whish is, that this will be depicted in the multilanguage help (by discussing the different behavior according to the API, GEDI etc.)

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: Labels are not translated using switchLang when label text is set in a control script

Post by mkoller »

Warning: The language combobox in a Vision Module is NOT the same as switchLang() !
I know this is confusing, but it just tells this single Vision Module which language to display but not to change the one and only manager global "active language".

When testing switchLang(), please prepare a panel in which you really call this method!

flindecke
Posts:69
Joined: Wed Jun 24, 2015 1:54 pm

Re: Labels are not translated using switchLang when label text is set in a control script

Post by flindecke »

Hello Martin,

thanks for the fast response.

Martin Koller wrote:
Warning: The language combobox in a Vision Module is NOT the same as switchLang() !
I know this is confusing, but it just tells this single Vision Module which language to display but not to change the one and only manager global "active language".

When testing switchLang(), please prepare a panel in which you really call this method!
Ok... short test using switchLang and it works independently from property.
So Vision Module language change has the "problem".

Everything works as expected now for the application which will use switchLang / changeLang.

4 posts • Page 1 of 1