Canvas provides each Form Item with its own label text, which can be either the Display Name Key (i.e. property driven label text) or plain label (i.e., direct text). From Canvas 19.1 onwards, the display name keys and their values for forms and form items for all languages can be managed within Canvas Studio itself.
Display Name Key
The Display Name Key is a configuration-driven locale enabled label text. For displaying label text through resource bundles for form fields, the Display Name Key must be specified and the Plain Label field must be empty. The actual label text for the Display Name Keys can be specified using the Add Labels feature in the Form Designer.
Canvas fetches the label text using the following formula:
- If form level bundle key is not null:
LBL+ Display Name Key text in the property files of the FORM_DEFINITION.BUNDLE_KEY
- If form level bundle key is null or the label key is not found in the property file:
LBL + Display Name Key text in the property files of the FORM_ITEM_DEFINITION.BUNDLE_KEY
For example:
Consider a bundle key 'common' that is already mapped to UK and US languages. To add label text "First Name" for the Display Name Key of ''FIRST_NAME", add 'First Name' for 'LBL_FIRST_NAME' field for UK and US languages using the Add Labels feature in Form Designer. Refer Add Labels for more information.
Plain Label
On the other hand, Plain Label is direct text, which is directly rendered without any translation irrespective of the end-user locale.
Canvas renders the Display Name Key and Plain Label properties based on the following conditions:
- If the display name key (bundle key) for the form item is not provided but the plain label is provided, then the plain label will get rendered in the application for the form item.
The Plain Label field must be empty and the Display Name Key must have a value for a form item to invoke the Add Labels feature in the Form Designer.
- If both the display name key and the plain label are provided for the form item, then the plain label will be taken as priority.
- If only the display name key is provided for a form item, then Canvas will check if the key is available in the Add Labels screen at the item level and renders the value. If the key is not present at the item level, it will check whether the key is present at the form level and render the respective value for the form item.