Example: localizing a Coach View

This example shows how to add translations to a Coach View.

In this example, the Coach View has English labels. The default locale in this case is English. However, you want French-speaking users to be able to read these labels by providing translations. The Coach View contains a set of text controls for address fields:

Screen capture of the Coach View

  1. Create a Coach View.
  2. Create the localization resource for the locale:
    1. In the library of the Process Designer, hover over Setup for the process application and then click the Add icon. In the window that opens, select Localization Resource. The New Localization Resource wizard opens.
    2. Using the wizard, create the Address_resource localization resource. The editor for the Localization Resource opens.
    3. In the Localizations area, add the French locale.
      Tip: Select Français from the list.
      The French locale nested under the Default locale
    4. To create the key used to translate the Number field label, type keyAddressNumber into the key field below the Localization Keys list and then click Add. Repeat this step to add keys for the other fields:
      • keyAddressCity
      • keyAddressNumber
      • keyAddressPostalCode
      • keyAddressStreet
      The first three keys are in the Localization Keys list and the fourth key in the key field, ready to be added to the list
    5. To provide the translation for the Number field label, select it in the Localization Keys list. The Localization Values table lists the default locale and the French locale.
      The Localization Values table lists the default and French values for the keyAddressNumber key. The values are empty.
    6. Click the value for the default locale and type Number. To save this value and move to the French locale, press Ctrl+Enter. Type Nombre and then press Alt+Enter.
      Entering a value for the default locale
      Repeat the previous step and this step for the other keys.
      Table 1. Values for the keys
      Key Default value French value
      keyAddressCity City Ville
      keyAddressNumber Number Nombre
      keyAddressPostalCode Postal Code Code Postal
      keyAddressStreet Street Rue
    7. Save the changes to the localization resource.
    Tip: This example creates the content on the localization resource using the Designer. Alternatively, you can import the contents of existing resource.properties files into one or more localization resources. With a localization resource, the translations are stored as key=value pairs.
  3. Add the localization resource to the Coach View:
    1. Open the Coach View to its Variables page.
    2. Click the Add button for the Localization Resources and then select the localization resource.
    3. Save the changes to the Coach View.
  4. Replace the existing labels with the appropriate keys from the localization resource:
    1. Change to the Layout page and select the Number field.
    2. In the General properties, click the Assign a variable button for the label.
    3. Click Select. In the window that opens, expand the Localization Resources nodes to select the keyAddressNumber key.
      The keyAddressNumber key being selected
      The key replaces the previous label text.
      The label field now contains the full key name
    4. Repeat the previous step to assign the appropriate keys to the other fields in the Coach View.
    5. Save the changes to the Coach View.
  5. Test your localization.
    1. Add your Coach View to a Coach.
    2. Open your browser, log in to Process Portal, and change the locale preferences to the locale that you want to test.
    3. Run the human service containing the Coach.

In the same way, you can localize the configuration options. That is, you create the localization resource, add the localization resource to the view, create the configuration option, and replace its label with a key name.