-

Project Language Translation (Localization)

PLCnext Engineer supports the translation of comments and HMI texts into other languages.
Two different methods are currently available:

Selecting the default language and target languages

Precondition for using the localization feature is that a default language and at least one alternative (target) language are set in the 'Options' dialog:
  1. Select 'Extras > Options'.
  2. Click the 'International' folder and select the 'Default Language Settings' category.
  3. Choose a 'Default' language.
  4. Define the alternative languages (target languages to be switched to): In the 'Available' group, select the respective entry and click 'Add Alternative'. The language is added to the 'Alternative' group (shows the list of available national languages in the project). Repeat this step for the desired languages.

    (You cannot add own languages to the 'Available' group.)

  5. Confirm the 'Options' dialog with 'OK'.
  6. Restart PLCnext Engineer to apply the changes.

Localization using the GET_LANG_STRING/GET_LANG_WSTRING FBs

Prior to performing the following steps, make sure that the project localization feature is activated in the 'Options' dialog and the desired target languages are added as alternative languages. See the description above.

  1. If variable comments are to be translated: Open the 'Variables' grid of the respective POU.
    Activate the 'Translate' flag of the desired variables.

    Note
    The 'Translate' variable property is not available in Data Lists. Instead of specifying the global declaration as translatable, this has to be done at the External declaration in the local variables tables.

    The 'Resources' table of the POU is updated automatically even if it is already open.
  2. Open the 'Resources' editor of each POU where texts are to be translated.
  3. In the 'Resources' editor, the translatable variable comments (section 'Variables') and free code comments (section 'Code') are already collected from the variables and code worksheets.

    You can add free user-defined text in the section 'User'.

  4. Fill in the translations in the target language columns. (The available target language column depend on the settings in the 'Options' dialog.)

    A mechanism to support external computer-aided translation will be available soon.

  5. Insert the GET_LANG_STRING or GET_LANG_WSTRING function block into a code worksheet. The FBs are contained in the PLCnext Controller library.

    Connect the formal parameters of the function block. Refer to the function block description ‣ GET_LANG_STRING
    ×‣ GET_LANG_WSTRING
    ×
    for details.

    Specify the string in the 'Resource' table as follows: POUname.TableSection.ID

    Example

    The strings applied to the FB inputs LANG_CODE and STRING_NAME can, for example, be provided by an upstream code part using character string functions (such as Concat, Find, etc.).

    By further processing the resulting string applied to the LOCALIZED_STRING FB output, the localized string can, for example, be visualized in the HMI application or evaluated in the code in order to control the application.