Monday, December 14, 2015

Project Localization / Multi-Language Support with InTouch Machine Edition HMI



This post explores the multi language support of InTouch Machine Edition and includes an example that demonstrates how to translate an HMI application to different languages during the runtime.
You can quickly translate your project's user interface to multiple languages, using either machine translation (e.g., Google Translate) or a human translator, and then you can switch your project's language during runtime with a simple function call.

The Translation Table is a worksheet that you can use to create a multilingual user interface (MUI) for your project. (This is different from changing the language of the development environment itself; that is done with the Language command on the View tab of the ribbon.) The worksheet is divided into a Source column, which contains original pieces of text from your project screens, and a Target column, which contains the translated equivalents of the items in the Source column.


The following functions can be used to access the translation tool during runtime.
  • Ext: Ext is a built-in function that uses the Translation Table feature to translate specified text.
  • SetLanguage: The function SetLanguage sets the project translation to one of the languages configured in the Translation Table.
  • SetTranslationFile: SetTranslationFile is a built-in function that sets the active translation file and then translates all enabled text within the project.
  • TranslationLoad: TranslationLoad is a built-in function that loads an external translation file and either replaces or appends to the current translation.
  • TranslationLookupClose: The function TranslationLookupClose closes a lookup map that was previously loaded into memory by the function TranslationLookupLoad.
  • TranslationLookupGet: The function TranslationLookupGet gets the translation of a specified source text, using a lookup map that was previously loaded into memory by the function TranslationLookupLoad.
  • TranslationLookupLoad: The function TranslationLookupLoad creates a lookup map from the Translation Table for the specified source and target languages, and then it loads the map into memory so that it can be used by the function TranslationLookupGet.