You can directly reference a translation string in interfaces and expressions throughout your application using the translation!
domain. This domain prefix is a direct object reference to your translation string.
You can use the translation!
domain to reference a translation string in any parameter with user display text. It's easy to construct your translation string references, since the translation!
domain leverages type-ahead to suggest a selection of existing translation strings from the translation sets in your environment.
And, the translation string can be referenced using whichever locale is set as your user locale, as long as the translation string has a value for that locale. For example, if your user locale is Spanish, reference the translation strings using Spanish. If a translation string doesn't have a value in your user locale, the translation string will use the primary translation locale.
You can use the translation!
domain to reference a translation string in any parameter that shows user display text in any expression editor in your application, except for those using sync-time custom fields.
Translation strings are ideal for translating the label, instruction, and tooltip parameters of input and display components. They are also great for translating links, buttons, charts, the names of process models, and more.
Translation strings are frequently used to translate interfaces, and the references can be used in both Expression and Design modes of an interface.
To reference an existing translation string in an interface in EXPRESSION mode:
translation!
followed by the translation string you want to use or select it from the list of suggested existing translation strings. You can hover over the suggested translation strings to make sure you're selecting the correct string.Follow these same steps to reference a translation string from an expression rule or any object with an expression editor.
To reference an existing translation string in an interface from DESIGN mode:
translation!
followed by the translation string you want to use or select it from the list of suggested existing translation strings. You can hover over the suggested translation strings to make sure you're selecting the correct string.Tip: If you are unable to reference a specific translation string, make sure that you have Viewer permission to the translation set.
Translation variables are variables in a translation string that represent dynamic values, such as the value of a function, rule input, or variable. Translation variables can also be used to format parts of a translation string with rich text formatting. Similarly to functions, parameters, and rules, translation variables use keyword syntax and you can pass in arguments for the translation variables into the translation strings using parentheses.
Referencing a translation string that contains a translation variable is as easy as following the instructions above for referencing a translation string and adding values for the translation variable's value like you would for the parameters in any function.
To reference translation variables in an expression:
translation!
followed by the translation string you want to use or select it from the list of suggested existing translation strings.:
on separate lines, like you would for parameters in a function.The example below shows how to use both functions and rich text formatting with translation variables.
1
2
3
4
5
6
7
8
9
10
11
{
a!richTextDisplayField(
value: translation!Case submitted on {date} and last modified by {name}(
date: today(),
name: a!richTextItem(
text: loggedInUser(),
style: "STRONG"
)
)
)
}
Translation string references are specific to each environment. This example is for reference only and will not work if you copy and paste it into your environment.
To learn more about creating and editing translation variables, see Adding and editing translation variables.
Translation variables cannot contain direct object references to record types, but you can use rule inputs and translation variables to reference record data. For examples of how to use record data in your translation variable, see Using translation variables.
Reference Translation Strings in your Applications