TranslateText
The TranslateText workflow activity translates text that originates in a workflow and needs to be displayed to the user. The activity is not used for translations of text that originates from the forms created in Forms Builder.
The TranslateText activity performs server-side translations for text strings in the Workflow Composer application using C# code and database queries. A precondition for this process is that the text to be translated (OriginalText) exists in the Forms Builder database and has been translated using the Gettext tools (.pot and .po files). See Internationalization and Localization in Forms Builder.
Use cases:
-
Translation of messages created using CreateValidationItem activities (see Custom Validations)
Prerequisites: The custom validation messages are known, have been entered in a .pot file, have been translated, and the .po files have been imported into Forms Builder. The text string specified in the OriginalText field of the TranslateText activity must match the text of the custom validation message exactly.
-
Translation of individual values returned from other workflow activities
When workflow activities such as LookupReferenceItem are used to retrieve values from the database, these values can be entered in a .pot file, translated, and imported into Forms Builder via .po files. TranslateText activities can then be used to translate individual values as users are completing the form sequences.
Note: To provide translations for arrays such as text strings returned by OData queries in the selection lists, refer to Steps to Localize Sequences.
The image below shows the property settings for a TranslateText activity followed by a CreateValidationItem activity that uses the variable "TransText". The variable is defined as the Translation out argument in the TranslateText activity. The OriginalText argument "Complete the form before Clicking Next." will be translated based on the default Locale when an invalid condition causes the validation message to be displayed.
Properties
Property | Value | Required | Notes |
---|---|---|---|
CultureCode | InArgument<String>
|
No |
The CultureCode is optional. If the CultureCode is not specified, by default the activity will use the formInstance.Locale value. The Locale component, which is typically placed on first form of the sequence, sets the formInstance.Locale value. You can specify a CultureCode value in the TranslateText activity to override the formInstance.Locale value on any form or to assign the CultureCode if the Locale component is not used. |
DisplayName | String
|
No | Specify a name for the activity or accept the default. |
OriginalText | InArgument<String>
|
Yes | Specify the OriginalText value. The TranslateText activity takes the OriginalText value and returns a Translation value that is retrieved from the Forms Builder database. The OriginalText value must match a string in the database table exactly. |
Translation |
OutArgument<String>
|
No | Specify the Translation value using a VB expression or variable. If the Translation is not found, the OriginalText value will be returned in the out argument. You can use the log file in debug mode and search for "No Translation found" to determine which items were not translated. |
ValidationMessages | InOutArgument <ValidationMessageCollection
|
No | Specify a variable that can be used to capture validation messages. |