Setting up the Auto Response Enhanced Chat Component for Translation
Overview
Auto responders are optional, automatic greetings that show when an end user starts a conversation (for example, “Welcome! An agent will be on shortly to help you.”).
When you use custom auto responses with the Language IO Enhanced Chat application, you must translate the source language responses (for example, in English) to all the languages that you service.
The purpose of this article is to show you how to set up multilingual Auto Responses for Language IO Enhanced Chat. This article was created using this Salesforce documentation as a reference.
To translate and store your custom auto responses with Language IO, see Setting up Custom Auto Responses for Salesforce Enhanced Chat to be stored by Language IO.
In this article
- Setting up the Auto Response Messaging Component
- Adding the Auto response component to the Messaging channel
- Translate the Messaging Components
- Testing your Auto-Response Messaging component
- Useful notes
Setting up the Auto Response Messaging Component
Note: It is only possible to translate Messaging Component Names and Constant Values. This means that all of the text that you want to translate must either be the Component Name or must exist within a Constant. Literals cannot be translated.
There are multiple ways to configure Messaging Components. The following is an example of a configuration that is compatible with translation.
- In Salesforce, go to Setup and type “Messaging Components” in the Quick Find box.
- Click on the New Component button.
- Select “Auto Response“ as the type of messaging component:
- Type the Auto Response that you want your application to send.
- Enter the details for the messaging component (Name, Description):
- Click Done.
- The Messaging Component Builder opens:
- On the left hand side, go to the Constants page. This is where you can configure all of the values that will require translation.
- To create a new constant click New next to "Custom Constant". There are three types of Constants: Text, URL, and ImageAsset. Text and URL can be translated, ImageAsset cannot.
- To create a new constant click New next to "Custom Constant". There are three types of Constants: Text, URL, and ImageAsset. Text and URL can be translated, ImageAsset cannot.
- Once you have configured your constants, you can proceed to the Component Format.
- To add a constant to your Formula Template, you must follow this naming convention:
{!$.Constants.[Constant API Name]}.- Open your Component Format on the left hand side.
-
Next, on the right hand side, you will insert the constants in your desired format.
Note: Any literal text will not be translated. This screenshot shows an example of a Formula Template that contains the Constants and an example of a Literal that will not be translated.
- This is what the Auto Response looks like to your end user (pre-translation):
You have successfully created the Auto response messaging component. Now, you must add the component to your messaging channel.
Adding the Auto response component to the Messaging channel
- Go to Setup and type “Messaging Settings” in the Quick Find box.
- Select Messaging Settings.
- To add the component to a Messaging for In-App and Web channel, find your channel in the list, then click Edit in its action menu.
-
If you are adding a “Conversation Acknowledgement”, “Start Conversation”, “End Conversation”, or “Inactive Conversation” component:
- Scroll down to the Automated Responses section of the page.
- In the “Conversation Acknowledgment”, “Start Conversation”, “End Conversation”, or “Inactive Conversation” fields, select an auto-response component.
- You can use the same component for multiple fields.
- Set up “custom field” in the messaging settings. This will be referenced in Embedded Service Deployment for the end user’s preferred language.
- Set up a parameter mapping to map the Language variable to an Omni-Channel Flow.
- This is required to make sure that you use the same variable name as the one you gave in the Pre-Chat setup when you created Embedded service Deployments.
-
Routing work to queue using Omni-Channel Flow.
Important: This section assumes you are familiar with the creation of Flows.- Create an Omni-Channel Flow. This flow will be used by the messaging channel to update the EndUserLanguage field on the messaging session object.
- Create an input variable named “Language”. Specify “Text” as the Data Type:
- Create an input variable named “RecordID”. Specify “Text” as the Data Type:
- Update the “EndUserLanguage” field on the messaging session like this:
- Object: Messaging Session
- Under “Filter Messaging Session Records”:
- Condition Requirements to Update Records: All Conditions Are Met (AND)
- Field: Messaging Session ID
- Operator: Equals
- Value: RecordID
- Under “Set Field values for the Messaging Session Records”:
- Field: Messaging User Language
- Value: Language
- Set the flow to route work items to respective queues:
- Records to Router: Single
- Record ID variable: RecordID field created above
- Service Channel: Messaging
- Route to: Queue
- Select queue for the corresponding messaging channel
- Your flow should look like this:
- Go back to the respective Messaging Channel under the Omni-Channel Routing section:
Translate the Messaging Components
- Go to Setup and type “Translation Workbench” in the Quick Find box.
- Click Translate.
- Select the following fields:
- Language: The target language you wish to translate to
- Setup Component: Select “Messaging Component”
- Messaging Component: Select the Component that you want to translate
- Object:
- Constant Values: The constant values created in the previous steps, that are used as the content of the Messaging Component
- Messaging Component Name: The name of the Messaging Components that you created. This translation is shown to the agents, not the end users.
- Translate the message that you selected with the extension, then enter the translation as “Messaging component” in the language that you selected in “Language”.
Testing your Auto-Response Messaging component
To test your Auto response messaging components, you must create an Embedded Service Deployment.
- Go to Setup and type “Embedded Service” in the Quick Find box.
- Select “Embedded Service”.
- In the Embedded Service configuration page, click New Deployment.
- Select a conversation type for your deployment:
- Select “Messaging for In App and Web”, and click Next.
- Set the type to Web.
- Enter below details:
- In “Embedded Service Deployment Name”, enter a unique name for your chat deployment.
- The API Name field is automatically populated.
-
In the “Site Endpoint” menu, select an “Experience Builder” site from the drop-down list.
Note: You must create an Experience builder site before you can create Embedded service deployments.
- Click Save.
- Activate Pre-chat in the Embedded Service deployment.
- Add a custom field named Language to visible pre-chat fields. This field is used in the Parameter Mapping in the Messaging Channel.
Useful notes
- In messaging components, all values entered are constants by default.
- You can select ‘Type : Formula’ to dynamically populate values within your messaging component formats. This allows you to create rich, customized experiences by drawing data from other Salesforce objects and fields.
- Using formula templates allow you to incorporate values from Salesforce records, users, or other variables into your messaging component. For example, you could use a formula to display the end user's name or the value of a custom field.
- With the current solution, messaging end users must select their preferred language in the pre-chat form before they start a conversation.