Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

 

Language Selection

Because Ignition has multiple visualization systems, each system has separate ways to switch the current language.

Vision

In Vision, the language can be selected using the language selector dropdown before logging in to the client, or can be added to the client in the form of the language selector component.

Perspective

New_in
Version8.0.2


In Perspective, the language is selected by changing the locale of the session by modifying the session.props.locale. This can be written to using a script when the session first opens, or something can be bound to it that the user can change.

Expression and Scripting Functions

You can look up translations using the following functions:

  • Expression Function
    translate()
  • Scripting Functions
    system.util.translate()
    system.util.modifyTranslation() scripting functions. 

Translations are matched by looking for the base language value in the translation database. This is especially useful for message boxes and other warnings or errors that you show in your scripts.


On_this_page

 



 

System Considerations During Translation

The inherent operating system may affect Ignition's ability to provide a complete translation in certain circumstances.

For example, suppose a user selected the Spanish option from their Language Selector component. An English to Spanish translation term exist for the word "Information" as well as "Start." The message box script takes two parameters: one for the content while the other parameter is optional. If the second parameter is not included in the function then the resulting title of the message box will include the English word "Information." The following code is executed on a button clicked event handler. 

Code Block
languagepy
message = system.util.translate("Start")
system.gui.messageBox(message)

What results is a message box with a translated content while the title remains in English. In addition, the accept button is translated as well even though the English word for "OK" does not exist in the Translation manager. This is due to the system level translations that exist for inherent language support.

A similar occurrence exist with the file open dialog window. The following code is executed on a button clicked event handler.

Code Block
languagepy
system.file.openFile()

The result is a translation for the title as well as the open and cancel buttons while the references to the "File Name" and the "Files of Type" remain in the operating system's language and thus are beyond the scope of Ignition's ability to translate.

Similar occurrences will appear in print and error dialog boxes.

 


Next_link