Skip to content

Display Screen Flow Labels in User’s Local Language

While working on projects, being a Trailblazer, it’s a challenging task to deal with different languages in salesforce org. Sometimes you may want to convert labels for your users in their local languages while working on the screen flows. It can be accessed from Visualforce pages, Lightning Pages, or Lightning components as well.

For example, you’re working on a project, and you have a requirement to create a screen flow by using help text or error messages for your users who are using their native language as Hindi.

Now you can imagine how tedious it is. It may take a few hours to finish the above work. In this article, I will try to answer the above question and explain how you can solve it with a few clicks.

Pre-requisite

Before you translate the labels in screen flows, there are some pre-requisite.

Follow the below steps to enable Translation Language Settings:

  1. Navigate to Setup | Translation Workbench | Translation Language Settings.
  2. Click on Enable button.

Let’s start to create a custom label and translate it to use it.

Create a Custom Label

  1. Navigate to Setup | User Interface | Custom Labels.
  1. Click on New Custom Label to create a label.
  1. Fill in all mandatory fields and click on the save button.
    1. Short Description: Date of Birth
    2. Name: Date_of_Birth (will auto-populate)
    3. Value: DOB
    4. Click on Save.
  1. Click on the New button under Translations related list.
  1. Fill in Translation Information:
    1. Select the Language you are translating into.
    2. Enter a translated value in the Translation Text field.
    3. Click on the Save button.

We have done with the base configuration! Let’s use it in the Screen flow.

  1. Create a Screen Flow and add the Date element to the screen.
  2. Put the Lable as {!$Label.Date_of_Birth}. ( Tips – Search for global variable $Label and select the Custom Label you want to use on the screen under Default Value and copy-paste it in the label). API name will auto-populate.
  3. Click on the Done button.

Let’s validate it.

Change the user language to Hindi; you want to test with and run the screen flow by login with the same user.

Points to Remember

  1. An organization can have upto 5000 custom labels.
  2. Lenght of custom labels can be upto 1,000 characters.
  3. Make sure you enable platform-only Languages.

You are Done!!!

I would love to hear about your experience with Custom Labels. How do you use it?

Leave a Reply