Customizing XLIFF export for translations

By default, the XLIFF files exported by translation services use CDATA notation. You disable CDATA in exported XLIFF files by adding the CMSTranslationServicesUseCDATAForTransUnit key into your web.config file.

Example of an XLIFF file with CDATA notation

<xliff version="1.2">
  <file original="cms.document;25" source-language="en-US" target-language="fr-FR" datatype="htmlbody">
    <body>
    ...
 
      <trans-unit id="newstitle">
        <source><![CDATA[Apple iPad Mini In Stock]]></source>
      </trans-unit>
      <trans-unit id="newssummary">
        <source><![CDATA[Today, we have good news for all fans of the awesome Apple iPad. We are glad to announce that its new version, Apple iPad Mini, is available in our web shop. Furthermore, we keep our reasonable pricing policy, providing the lowest price currently available on the Web.]]></source>
      </trans-unit>
 
    ...
    </body>
  </file>
</xliff>

The CDATA section permits the special characters such as '&', '<', '>', etc. to be included in the text without being escaped. If you disable CDATA via the CMSTranslationServicesUseCDATAForTransUnit web.config key, special characters in the exported XLIFF files will automatically be escaped.

For example: <p> Text to be translated </p> becomes &lt;p&gt; Text to be translated &lt;/p&gt;

For more information, see the XLIFF documentation.

On this page

Disabling CDATA in exported XLIFF files

  1. Edit your Kentico project's web.config file.
  2. Add the CMSTranslationServicesUseCDATAForTransUnit key into the <appSettings> section of the file.

    <appSettings>
      ...
     
      <add key="CMSTranslationServicesUseCDATAForTransUnit" value="false" />
     
      ...
    </appSettings>
  3. Save the web.config file.

Now, whenever you submit a document for translation, the system exports it without the CDATA notation.

Example of an XLIFF file without CDATA notation

<xliff version="1.2">
  <file original="cms.document;25" source-language="en-US" target-language="fr-FR" datatype="htmlbody">
    <body>
    ...
 
      <trans-unit id="newstitle">
        <source>Apple iPad Mini In Stock</source>
      </trans-unit>
      <trans-unit id="newssummary">
        <source>Today, we have good news for all fans of the awesome Apple iPad. We are glad to announce that its new version, Apple iPad Mini, is available in our web shop. Furthermore, we keep our reasonable pricing policy, providing the lowest price currently available on the Web.</source>
      </trans-unit>
 
    ...
    </body>
  </file>
</xliff>

Was this page helpful?