LSPS documentation logo
LSPS Documentation
Localization

The LSPS Application User Interface supports switching of locales so that the GUI can be displayed in another language. To display also the texts that originate from your Models in the correct language, use localization identifiers in the underlying expressions: Localization identifiers are special functions that return the localization of the string in the current locale. They support position text parameters so you can pass values to the localization text on runtime.

Note: In the Default Application User Interface, you can switch locales, on the Settings page. Note that the default application supports the English, German, and Slovak locale and localization identifiers in other languages will not be used unless you add a new locale to the application. For instructions on how to add a new locale to the application, refer to the Developing a Custom Application guide.

You can define a localization identifiers in the Localization Editor or from the Expression Editor.

Creating Localization Identifiers in the Localization Editor

To create a localization identifier with the Localization Editor, do the following:

  1. From the GO-BPMN Explorer, create a localization definition (right-click a Module and select New > Localization Definition).

    Important: It is considered good practice to define localization definitions with all identifiers used by the given module to keep modules self-contained.

  2. In the editor, select the Default Language in the Default Language combo box.

    Localization in this language will be used if the localization version requested by the application is not available.

  3. In the Localization Identifiers area in the left part of the editor, click Add.
  4. In the Localization Details area on the right, do the following:
    • Enter the identifier name into the Identifier field: you will use the name to use the identifier.
    • In the Number of parameters field, enter the number of position parameters the identifier will take.
    • Select the Public check box if you need to use the identifier in importing Modules.
  5. In the Translations area, click Add and provide a translation of the string:
    1. In the Language drop-down box, select the language.
    2. In the Text area, type the translation: use the syntax %<position_number> to insert values of the parameters.
      LocalizationEditorWithDef.png
      Identifier with parameter

Creating and Calling Localization Identifier in the Expression Editor

To define a localization identifier directly from the Expression Editor, do the following:

  1. In the Expression Editor, type the name of the identifier as a String value and select it.

    To create an identifier with parameters, define the entire value with concatenation, such as, "You requested the following book " + getBookName() and select the entire expression: any concatenation elements that are not string literals will be interpreted as position parameters.

  2. Press Shift + Alt + L.

    To change the shortcut, go to Window > Preferences, then General > Keys, search for Localize and set the new shortcut in the Binding field.

  3. In the Localize dialog, define the identifier details.
    localizationDialog.png
    Localization dialog box with an identifier definition
    Based on the data in the dialog box, the system creates a localization identifier in the selected localization definition with the translation and substitutes the string or the selected expression with a call of the identifier into the expression.

Calling Localization Identifiers

To call a localization identifier from your expressions, use the syntax:

$<identifier>(<comma-separated_arguments>)

For example, to call the identifier deviceAdjust with two parameters, enter $deviceAdjust("#123", sectorA).

To force a localization in a locale, call the localize() function, for example:

localize($save_button())

Searching for Usages of Localization Identifiers

To search for usages of a localization identifier, right-click the definition of the localization identifier in the Localization Editor and go to Search For -> Usages or select the identifier definition and press Ctrl+ALT+g.

Identifying Unlocalized Strings

If you are using localization identifiers and you want to make sure that everything is localized, you can set the validation feature to detect unlocalized Strings. Note that you can explicitly mark a String as non-localizable with the hashtag sign (#): such Strings are excluded from the validation check.

To have unlocalized Strings detected on validation, do the following:

  1. Go to Window > Preferences.
  2. In the Preferences dialog, open the nodes Process Design Suite > Modeling > Validation
  3. On the right pane in the Non-localized string item, select the validation severity.
  4. Set the Ignore strings with no letters option as required.