For the complete documentation index, see llms.txt. This page is also available as Markdown.

Translating Document Content

Translate picklist values, field labels, and related list picklist output with Salesforce Translation Workbench.

What is Document Content Translation?

Document content translation in S-Docs lets you generate documents in multiple languages by translating picklist values, field labels, and related list content. This helps customers and stakeholders receive documents in their native language.

How is Translation Used in S-Docs?

S-Docs provides two main patterns for translating document content:

  • translate="true": Use Salesforce translations for picklist values and field labels

  • toLabel(): Return translated picklist labels in direct SOQL related lists

Use these patterns together to build translated documents that match your Salesforce language setup.


Translate with Salesforce Translation Workbench

The Translation Workbench method leverages translations already defined in Salesforce, supporting field labels and picklist values.

Supported translations:

  • All field labels (standard field labels are pre-translated; only custom field labels need translation)

  • Picklist field values only (other field types are not supported by Translation Workbench)

Note: Translation Workbench does not translate arbitrary free-text field output.

Step 1: Define translations in Salesforce

From Setup, type "Translation" in the Quick Find bar → click "Translate."

Translating Picklist Values

  1. Set Language to your target language (e.g., German)

  2. Set Setup Component to "Picklist Value"

  3. Set Object to your object (e.g., Contact)

  4. Scroll down and enter translations for your picklist values

Translating Field Labels

  1. Set Setup Component to "Custom Field"

  2. Set Aspect to "Field Label"

  3. Enter your translations

Standard field labels already have translations in Salesforce, so you only need to translate custom field labels.

Step 2: Enable translations at the template level

To use Translation Workbench translations in your documents:

  1. From Setup → Object Manager → click "SDoc Template" object

  2. Go to "Page Layouts" → click "Edit" for your layout

  3. Drag the "Language" field into the "SDoc Template Detail" section → click "Save"

  4. Go to "Fields & Relationships" → click "Language"

  5. Scroll to "Values" → click "New"

  6. Add the appropriate Salesforce language code → click "Save"

Now you can set the language directly on any template detail page by selecting the appropriate language code (e.g., 'DE' for German, 'FR' for French, 'ES' for Spanish).

Step 3: Add the translate attribute to merge fields

Add the translate="true" attribute to merge fields and field labels you want translated.

For picklist field data:

html

For field labels:

html

Note: Once you add the translate attribute to one instance of a merge field, all other instances of that same merge field in the document will also be translated, even without the attribute.

To translate picklist values in related lists, add the toLabel() function to the field in your SOQL query.

Original related list:

html

With translation:

html

The picklist column will now display translated values.

For lookup fields or more complex translations, use direct SOQL queries with the class set to "none":

html

This returns only the data without table formatting.


Formatting International Characters

If your templates contain international characters (Japanese, Hebrew, Arabic, etc.), additional formatting may be required.

Template Settings

  1. Navigate to your template → go to "Document Options" tab

  2. Check the box: "Template contains international characters (Unicode fonts)"

  3. If characters still don't render correctly, set Unicode Enforcement Level to "Strict" to override font settings

Right-to-Left Languages (RTL)

For languages like Arabic or Hebrew that read right-to-left:

Option 1: Use the rtl merge field attribute

html

This transforms merge field data to right-to-left but does not affect static text.

Option 2: Use <rtl> tags in template source

html

This transforms both merge field data and static text to right-to-left.

For more information, feel free to reference the RTF section of the Template Attribute Article


Best Practices

  • Use the right pattern: Use translate="true" for picklists and labels, and toLabel() for direct SOQL related lists

  • Test thoroughly: Generate sample documents for each language to verify translations appear correctly

  • Consider the substitute attribute: For complex related list translations, explore the substitute column attribute feature for additional flexibility

  • Set language at template level: Configure the language setting on individual templates to ensure consistent translation behavior


Translating document content in S-Docs ensures your global customers and stakeholders receive professional, localized documents that enhance their experience and build trust in your brand.

Related: https://sdoc.atlassian.net/wiki/spaces/196609/pages/2717646849/?draftShareId=ab53618e-b56d-4344-be08-02aea512d35c

Last updated

Was this helpful?