Translation Placeholders
The Translation Placeholders property was added in Profound UI Versions 6 Fix Pack 20.0 and later.Â
The Translation Placeholders property allows you to define values to replace into translations set for widgets not located within a grid. To apply placeholders to widgets that are located within a grid use the Grid Row Translation Placeholders property instead. This screen-level Translation Placeholders property is superseded by the widget-level Translation Placeholders property.
Overview
Profound UI now allows you to replace specific placeholder values in your custom translations set up with the International Language Support (Translations) feature. To replace the value you must first edit your translation to have a special placeholder keyword, and then you must set up the replacement value using the new Translation Placeholders property. The special placeholder keywords must be formatted within the translation to start with an open parenthesis followed directly by the ampersand character. Then you can supply the customizable keyword value followed by the close parenthesis. For example, (&key) would be a special placeholder keyword, with key as the customizable keyword. You will then need to set up the Translation Placeholders property to define a placeholder using the matching customizable keyword as well as the replacement value. The value of the translation placeholder can be bound to an RPG field for even more customizability.Â
Example
This example will show the process of how the translation is set up to allow a placeholder keyword, as well as show how to set up the placeholder in the screen.
Step 1: Set up the translation to contain the placeholder keyword.Â
This image shows the translation edit screen of the Work with Language Translations Tool. This translation defined the special placeholder keyword (&testplaceholder) inside of the translation text. This is the part of the translation that will be replaced with the value of the translation placeholder property.Â
Step 2: Set up the translation placeholder.
This image shows the Translations Placeholders property as well as the special dialog box used to modify the property values. This property cannot be edited directly within the properties window and instead requires a special dialog box to edit them as seen above. The Placeholder Key must match the special placeholder keyword set up in the translation from Step 1. However the parenthesis and ampersand characters will automatically be added to the keyword, therefore they do not need to be supplied in the dialog box here. The Placeholder Value will be what is replaced into the translation text, and can be bound to an RPG field using the field binding dialog button shown above. You can add more Translation Placeholders by pressing the "Add" button in the Translations Placeholders dialog box.Â
Step 3: Set up a widget to use the translation from Step 1.
In this example, an Output Field widget is set up to use the translation, including the translation placeholder, we set up in Step 1. To do this, there is a translation setup button that is shown when the value property is selected. This will open a new dialog box where the translation can be specified. In the visual designer, the widget will show the special placeholder keyword in the translation text for the widget on the canvas, regardless if there is a translation placeholder set up for this special placeholder keyword. Note: not every property allows translations; and if the value is already bound to an RPG field, you must use the right click context menu to remove the field binding before the translations button will appear.Â
Results:
When the application is executed, the widget will show the translation set up in Step 1, except the special placeholder keyword will be replaced with the value of the Translation Placeholder property.
More details:
If a translation is set up with a special placeholder keyword but no replacement value is supplied in the Translation Placeholders property, then the widget will continue to display the special placeholder keyword when the application is executed.Â
Promptable? YES
Possible Values:Â N/A
Bindable? YES
Some documentation pages have recently moved to a new section: Profound AppDev. If you are having trouble finding specific pages, try the documentation search capability or reach out to our Support team!