How to manage languages and translations in Salesforce

Alexandre THIZY
4 min readJun 10, 2020

Prerequisites

  • Your must have a multi-language organization and translation workbench must be enabled.
  • The user who wants to manage the translations must have the permission « Manage translation ».

☁️ Salesforce help: Support Users in Multiple Languages

Supported languages

  • Salesforce support 3 levels of languages:
  1. Fully supported languages
    Ex: English: en_US, French: fr, German: de
  2. End-user languages
    Salesforce provides translated labels for all standard objects and pages, except administrative pages, Setup, and Help. When you specify an end-user language, labels and Help that aren’t translated appear in English.
    Ex: Czech: cs, English (UK): en_GB, Polish: pl, Portuguese (Portugal): pt_PT
  3. Platform-only languages
    In situations where Salesforce doesn’t provide default translations, use platform-only languages to localize apps and custom functionality that you’ve built on the Salesforce App Cloud. You can translate items such as custom labels, custom objects, and field names. You can also rename most standard objects, labels, and fields. Informative text and non-field label text aren’t translatable.
    Ex: French (Belgium): fr_BE, French (Canada): fr_CA, French (Luxembourg): fr_LU, French (Switzerland): fr_CH
  • Languages are identified by 2 or 5 characters:
    Ex : “en” or “en_AU”

☁️ Salesforce help: Supported languages

Translatable elements

  • Labels of standard objects and their standard fields can be translated

Where: Setup / Customize / Tab Names and labels / Rename Tabs and Labels

☁️ Salesforce help: Rename object, tab and field labels

  • A lot of customizations can be translated
Action, Address Country, Address State, Apex Sharing Reason, Button and Link Label, Custom App, Custom Field, Custom Report Type, Data Category, Data Category Group, Division, Feed Filter, FieldSet, Flow, Global Picklist, Layout Section, Lookup Filter, Navigation Menu Item (for Communities), Lookup Filters, Path Step Rich Text, Picklist Values, Quick Action Labels, Record Type, Record Type Description, Related List Label, Reputation Levels (for Communities), S-Control, Solution Category, Standard Field Help, Validation Error Message, Web Tabs (which also includes Lightning component and Visualforce tabs), Workflow Tasks

Where: Setup / User Interface / Translation workbench / Translate

How: Select a language, a setup component and an object.
Locate the label to be translated and add a translation in the “Label Translation” column.

☁️ Salesforce help: Translatable customizations

  • Custom labels can be translated

Where: Setup / User Interface / Custom labels

How: Click on a label.
In the translation section, click “New” to add a new translation. Select the language, enter the translation, and click save to validate.

☁️ Salesforce help: Translate custom labels

Remark: All those operations take a lot of time if you need to translate a lot of labels / languages.

How to export translations

Using translation workbench:
From the Setup, go to Translation workbench / Export.
Select “Bilingual” option and click on “Export” button.
You will receive an email when the export is finished.
The exported zip files are available in in your salesforce documents.
Each zip file contains one or more .stf file corresponding to the different languages.

stf files are text files and can be edited with a text editor (Ex: Notepad++):

☁️ Salesforce help: Exporting Translation Files

How to import translations (import a file)

If you have a lot of labels to translate in multiple languages, you can use the file import translation functionality to save time.

In Salesforce, it is a 2 steps process but you have to prepare your files before.

  • Preparing files to import (Modify an exported file or create a new one):
    Files must be encoded in UTF-8 without BOM.
    Their extension is .stf.
    They have a header (with language code and type) and multiples lines with key and translated label (separated by a tabulation).

Example:

# Language: French
Language code: fr
Type: Bilingual
------------------UNTRANSLATED-------------------# KEY LABEL
CustomLabel.Introduction Salesforce est le CRM N°1
CustomLabel.AllAccounts Tous les comptes
CustomLabel.MyTerritory Mon Territoire
CustomLabel.MyPortfolio Mon Portefeuille
  • If you don’t want to manage yourself the stf files, you can build a macro with Microsoft Excel to generate stf files with the translations you have added in the different cells. If needed, I can send you the macro I have written for one of my project.
  • You can then import .stf file by file or all files in a zip archive.
    From setup, go to Translation workbench/import.
    Select the file you want to import.
    Click the import button.
    You will receive an email when the import is finished. If some errors are found, you will have the detail in your salesforce documents.

☁️ Salesforce help: Import Translated Files

--

--