Switching the Current Language

Setting the Client Language

The currently displayed language can be changed in a number of ways:

  • On the project Login page.
    The user can select their desired language when they login to the project.

  • Using a Language Selector component in the project.
    This component displays the languages that have translations available, and changes the current language based on selection.

  • With the system.util.setLocale() function.
    This function takes an ISO 639-1 two-letter code for the language to use (for example, "en", "fr", "de", "es", and so on).

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.

System Considerations During Translation

Inherent operating system and Java configurations may affect Ignition's ability to provide a complete translation in certain circumstances.

For example, suppose a user has 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.

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.

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.