About this article
Translate() is a function that returns a row of the Translations data source, and then the value of the applicable language column. This article will explain the binding syntax and show examples how this can be configured in the Dynamics Designer.
Prerequisites
|
Syntax
There are two different syntaxes for Translate().
The first one returns the row of the 'NameValueToLookUp', and then the value of the applicable language 'ColumnName'. If the language column is not found it will show the value of the 'Name' column:
Syntax | {{Translate(NameValueToLookUp, ColumnName)}} |
The second syntax returns the row of the 'NameValueToLookUp', and then the DocumentLanguage set in the user profile. If no DocumentLanguage is set, it will show the value of the 'Name' column:
Syntax | {{Translate(NameValueToLookUp)}} |
|
Examples
|
In the examples below these data sources are used:
- Data source ’Languages’ containing the languages for your environment:
- Data source ’Translations’ with language code (’iana’) columns that contain the translations for that language:
|
- The ’DocumentLanguage’ field in the user profile, using the field ’Language’ from the data source ’Languages’:
|
Example 1
Translate "Subject" to Dutch.
Binding | {{Translate("Subject", "nl-NL")}} |
Output | Onderwerp |
|
Example 2
Translate "Subject" to the DocumentLanguage set in the user profile.
Binding |
{{Translate("Subject", DocumentLanguage)}} |
||
Input | DocumentLanguage = "nl-NL" | DocumentLanguage = "fr-FR" | DocumentLanguage = not set |
Output | Onderwerp | Sujet | Subject |
|
Example 3
Translate "Subject" to the DocumentLanguage selected in a form field.
Binding |
{{Translate("Subject", Form.DocumentLanguage.Language)}} |
||
Input | DocumentLanguage = "nl-NL" | DocumentLanguage = "fr-FR" | DocumentLanguage = not selected |
Output | Onderwerp | Sujet | Subject |
Example 4
Use Translate() combined with FormatDateTime() to show a specific date format depending on the DocumentLanguage set in the user profile.
Binding |
{{FormatDateTime(Form.Date, Translate("FormatLongDate", DocumentLanguage), DocumentLanguage)}} |
||
Input | Date = 4 October 2021, DocumentLanguage = "nl-NL" | Date = 4 October 2021, DocumentLanguage = "fr-FR" | Date = 4 October 2021, DocumentLanguage = "en-US" |
Output |
maandag 4 oktober 2021 |
lundi 04 oct. 2021 |
Mon 4 October 2021 |
|
|
Comments
0 comments
Article is closed for comments.