Translation of strings inside scripts - IWS8.0

We're running IWS version 8.0 on a desktop computer. The project is multilingual.

We have for example buttons, that you click to initiate a certain crtitical function. For Button OnDown() we have written a script that records the button press by using SendEvent() and writing a certain string to the event log.

This string is human readable and should be translated, but the line does not seem to appear in Translation table when the project texts are refreshed. I would expect it would, since the "Enable translation" is checked under Advanced settings of the button object. What is going wrong?
  • Are you talking about the text on the button, or the text inside the SendEvents() function?

    For the button, if there is a carriage return in the text of the button, those texts will be split into separate items in the translation table.

    For the Function, Anything inside double quotes should show up in the translation table. If you are building a string with variables/tags/constants, then only the individual components can show up in the translation table.

    If you are talking about whether or not the text gets translated at runtime, use the Ext() function inside all of your scripts for items that you want translated. (Note: as of v8.1, you do not need Ext() for the text to show up in the translation table, it should show up regardless)

  • Yes, Ext() function was the missing link - thank you for this.

    Unfortunately, another issue regarding events popped up. Apparently it's not linked to the translation thing, but: Event logging stopped completely!

    The other day, after stopping and restarting the project, probably there was also reboot in between, event recording just stopped for no apparent reason. The scripts that are supposed to write events (SendEvent()) are still functioning, as they eg. request a confirmation with modal popup, and that works, but nothing is written to the event log any more (talking about the event log that can be displayed with Alarm/EventControl object). I can still see the old events when browsing, but nothing new is written. Also no new files of type .evt have been written in Alarm folder after the day it stopped.

    When calling SendEvent(), would there be a way to see in output console if something should fail? I'm not sure how to trace where the functioning stops.

    It could be something really trivial, but I failed to find the cause for the muting. Any ideas please?
  • Just the obvious. (Event Logger settings)

    Is event logger enabled? (Check box)
    Is it disabled? (tag or expression in Disable field)
    Are 'Custom Messages' enabled? (Check box)
    Is the database configured properly? (Proprietary?)

    There are also recommendations for using the SendEvent() function in background tasks. Improper usage could cause all background tasks to be suspended indefinitely.
  • Thanks for your reply.

    The scripts are not executed in the background and they request no user input.
    I double checked the settings and they are as described.

    On execution, SendEvent() returns value 2, which goes for "The Event Logger is enabled, but the Custom Messages option is not selected". This is strange, since custom messages _are_ enabled just as your checklist suggests. Apparently something else in the background doesn't function as it should.