---
schema_version: "1"
id: 926542542c0aa6367cd97f3dee343741bc54957104de41d081b0e59ac99620d5
title: XLIFF File Format for Importing Commerce Translations
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/commerce/264-0-0/comm_xliff_file_format_import_translations.md
canonical_url: https://help.salesforce.com/s/articleView?id=commerce.comm_xliff_file_format_import_translations.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 59a3c249518836734401c8e5994232a9edd61f1e3d41096a6cf48104ce5e59c9
description: The Translation Workbench supports the XML Localization Interchange File Format (XLIFF) and Salesforce Translation File (STF) file formats.
products:
  - Commerce
  - B2B Commerce
release: "264"
---
# XLIFF File Format for Importing Commerce Translations

The Translation Workbench supports the XML Localization Interchange File Format (XLIFF) and Salesforce Translation File (STF) file formats.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=commerce.comm_editions.htm&amp;language=en_US" target="_blank">View supported editions</a>.</td></tr></tbody></table>

[Which Salesforce Commerce Product Do I Have?](https://help.salesforce.com/s/articleView?id=commerce.comm_what_product.htm&language=en_US)

Salesforce recommends that you use the XLIFF format. You can export the metadata and data translation source files and use them as a template to enter the initial translation of your store’s metadata, and Product, Promotion, and Category data fields. See [Export Data Translation Files](https://help.salesforce.com/s/articleView?id=platform.workbench_export_data.htm&type=5&language=en_US).

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-commerce-comm-264-0-0-production-enus/d863e308-482a-4dfa-8d20-2a94737d394a/images/icon_important.png)

Important To properly encode a translation file for import, save the XFILL file in UTF-8 format.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col>
          <col>
          <col>
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d57611e72">Element</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d57611e75">Purpose</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d57611e78">Attributes</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d57611e72 "><code>&lt;trans-unit&gt;</code></td>

            <td data-label="Purpose" class="slds-cell-wrap" style="vertical-align:top;" headers="d57611e75 ">Represents a translatable unit within the XLF file. This element is used to encapsulate the source text
              and its corresponding translation</td>

            <td data-label="Attributes" class="slds-cell-wrap" style="vertical-align:top;" headers="d57611e78 ">
              <p><code>ID:</code> A unique identifier for the translation unit.
              </p>
              <p><code>Maxwidth:</code> The maximum width allowed for the translated text.</p>
              <p><code>Field Type:</code> The type of field being translated.</p>
              <ul>
                <li><code>SingleLineText:</code> A line of text. Use for short text fields such as names, titles, or labels.</li>

                <li><code>MultiLineText:</code> Multiple lines of text. Use for longer text fields such as descriptions, comments, or notes.</li>

                <li>R<code>ichText:</code> Text that can include formatting, such as bold, italics, lists, and hyperlinks. Use for content that requires rich text formatting.</li>

                <li>H<code>TML:</code> HTML content. This field type is used for fields that contain HTML code. Use HTML content for more complex formatting and structure.</li>

                <li><code>Picklist:</code> A picklist (dropdown) field. Use for fields where the user selects a value from a predefined list of options.</li>

                <li>C<code>heckbox:</code> A checkbox field. Use for fields that capture a boolean value (true or false).</li>

                <li><code>Date:</code> A date field. Use for fields that capture date values.</li>

                <li><code>DateTime:</code> A date and time field. Use for fields that capture both date and time values.</li>

                <li>N<code>umber:</code> A numeric field. Use for fields that capture numeric values, such as quantities or amounts.</li>

                <li><code>Currency:</code> A currency field. Use for fields that capture monetary values.</li>

                <li><code>Email:</code> An email address field. Use for fields that capture email addresses.</li>

                <li><code>Phone:</code> A phone number field. Use for fields that capture phone numbers.</li>

                <li><code>URL:</code> A URL field. Use for fields that capture web addresses</li>

              </ul>
              <p><code>size-unit:</code> The unit of measurement for the size attribute.</p>
              <ul>
                <li><code>char:</code> The size of the text in terms of the number of characters.</li>

                <li><code>word:</code> The size of the text in terms of the number of words.</li>

                <li><code>pixel:</code> The size of the text in terms of the number of pixels. Use for graphical user interfaces where space is measured in pixels.</li>

                <li><code>pt:</code> The size of the text in terms of typographic points. Use in print and digital typography.</li>

                <li>e<code>m:</code> The size of the text relative to the current font size, used for scalable and responsive design.</li>

                <li><code>percent:</code> The size of the text as a percentage of a reference value. Use with flexible layouts.</li>

              </ul>
            </td>

          </tr>
          <tr class="">
            <td data-label="Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d57611e72 "><code>&lt;source&gt;</code></td>

            <td data-label="Purpose" class="slds-cell-wrap" style="vertical-align:top;" headers="d57611e75 ">The original text that needs to be translated. Can include HTML encoding or CDATA sections for formatting.</td>

            <td data-label="Attributes" class="slds-cell-wrap" style="vertical-align:top;" headers="d57611e78 ">None</td>

          </tr>
          <tr class="">
            <td data-label="Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d57611e72 "><code>&lt;target&gt;</code></td>

            <td data-label="Purpose" class="slds-cell-wrap" style="vertical-align:top;" headers="d57611e75 ">The translated version of the text found in the <code>&lt;source&gt;</code> element.</td>

            <td data-label="Attributes" class="slds-cell-wrap" style="vertical-align:top;" headers="d57611e78 ">
              <p>Doesn't have mandatory attributes but can include optional attributes to provide additional context or metadata
                about the translation. Some common attributes can include:
              </p>
              <ul>
                <li><code>&lt;state&gt;</code> Indicates the status of the translation. For example, <code>new, translated, reviewed, final</code>.</li>

                <li><code>&lt;xml:langt&gt;</code> Specifies the language of the translated text. Use standard language codes for this entry. For example, <code>en, fr, de</code>.</li>

              </ul>
            </td>

          </tr>
        </tbody>
      </table>

## Tips for XLIFF File Management

- Context Information: Help your translators with message translation by adding a `<note>` tag in the `<target>` that explains the content of the message.
    
    ```
    <trans-unit id=&quot;homepage.greeting&quot;>
          <source>Hello, world!</source>
          <target>Bonjour, le monde!</target>
          <note>This is a greeting message displayed on the homepage.</note>
         </trans-unit>
    ```
- Handling Placeholders and Variables: If your source text includes placeholders or variables (for example {0}, %s), make sure the placeholders are preserved in the target text and clearly documented for translators.
    
    ```
    <trans-unit id=&quot;product.price&quot;>
          <source>The price is {0}.</source>
          <target>Le prix est {0}.</target>
          <note>{0} will be replaced with the actual price</note>
         </trans-unit>
    ```
- Validation and Testing: Validate the XLF file to make sure it's well-formed and adheres to the XLIFF standard. Use XML validation tools or editors that support XLIFF validation. Test the translations in a staging environment to make sure they appear correctly and that there are no formatting or display issues.
- Consistent Language Codes: Use standard language codes (for example, `en` for English, `fr` for French, `de` for German) consistently
    
    ```
    throughout the file. 
         xml
           <file source-language="en" target-language="fr" 
           datatype="plaintext" original="example.txt">
         </file>
    ```
- Version Control and Backup: Keep version control and backups of your XLF files. This is important for tracking changes, rolling back if needed, and maintaining a history of translations.
- Integration with Translation Management Systems (TMS): If you're using a Translation Management System (TMS), make sure that the XLF files are compatible with the TMS and that the import/export processes are well-defined.
- Handling Special Characters: Use CDATA sections or escape special characters (for example, &, <\`, \`>) to avoid XML parsing errors.
    
    ```
    <trans-unit id=&quot;special.characters&quot;>
            <source><p>Click & learn more.</p></source>
            <target><p>Cliquez & apprenez plus.</p></target>
         </trans-unit>
    ```
- Rich Text Formatting: Use CDATA sections to include rich text formatting (HTML tags) within the <source> and <target> elements to prevent XML parsing issues.
    
    ```
    <trans-unit id=&quot;rich.text&quot;>
            <source><p>Welcome to <b>Salesforce</b>!</p></source>
            <target><p>Bienvenue chez<b>Salesforce</b>!</p></target>
         </trans-unit>
    ```