Detecting Selected Language

Morberis
2020-07-30
2020-07-31
  • Morberis

    Morberis - 2020-07-30

    I have a project I'm working on that will have 3 languages. Setting it up isn't the issue. However what I would like to do is change the color of a display element when a specific language is selected. For instance I'm using a rectangular box with the text "ENGLISH" that on mouse click changes the selected language to english. I would also like to change the fill color of that rectangle to indicate that english is selected.

    How can I read which language is selected? Is there something that I can put in the Toggle Color element without doing some minor logic?

    I could have each language selection box use ST to change an int value or to toggle multiple boolean variables but I'm interested in whether there is a way to directly detect language settings.

     
  • kislov

    kislov - 2020-07-31

    Hi. You can use VisuElems.CURRENTLANGUAGE (STRING) for it.

     
    👍
    1
    • Morberis

      Morberis - 2020-07-31

      Thank you!

      Edit: I'm having some weird errors with help.codesys.com where the menu says "Nothing found" so I'm a little cut off from the easy library documentation so I appreciate this.

      Edit 2: That is actually perfect. It uses the name I assign the language which opens the doors to some shortcuts.

       

      Last edit: Morberis 2020-07-31

Log in to post a comment.