You can implement localization strings to translate the content that is automatically added by your Heretto PDF Generator publishing scenario.
- Ensure that you are a Heretto CCMS Administrator.
- Prepare a localized map.
Add the localization string files
- Download the language_strings.zip file.
- In the Content Library, navigate to the __configuration folder.
Note:
If you can't locate the __configuration folder, contact your Customer Success Manager.
- Create the language_strings folder.
The __configuration/language_strings folder exists.
- In the language_strings folder, Upload the ZIP file that you downloaded in 1.
Configure your publishing scenario
- In the top-left corner, click the
Main Menu and go to PDF Generator.
- In the Scenario Configuration window, in the XSLT tab, reference the strings.xml file by adding the code immediately following the xsl:import:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:import href="/db/sdk2/internal/pdf_generator/pdf_generator.xsl"/>
<!-- Add this code -->
<xsl:param name="variableFiles.url">/db/organizations/organization_name/repositories/master/__configuration/documents/language_strings/strings.xml</xsl:param>
<!-- End of add this code -->
</xsl:stylesheet>
Where: organization_name is the name of your Heretto CCMS organization.
- To translate the “Contents” label in the Table of Contents (TOC):
Note: A number of strings are already translated. However, if you need to translate more strings, you can do that similarly to this step.
- In the XSLT tab, add the entire <xsl:template> from this example:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:import href="/db/sdk2/internal/pdf_generator/pdf_generator.xsl"/>
<xsl:param name="variableFiles.url">/db/organizations/organization_name/repositories/master/__configuration/documents/language_strings/strings.xml</xsl:param>
<!-- Add this code -->
<xsl:template match="*[contains(@class, ' map/map ')]" mode="toc">
<xsl:param name="pathFromMaplist"/>
<xsl:if test="descendant::*[contains(@class, ' map/topicref ')] [not(@toc = 'no')][not(@processing-role = 'resource-only')]">
<nav>
<h1>
<xsl:call-template name="getVariable">
<xsl:with-param name="id" select="'Contents'"/>
</xsl:call-template>
</h1>
<ul>
<xsl:call-template name="commonattributes"/>
<xsl:apply-templates select="*[contains(@class, ' map/topicref ')]" mode="toc">
<xsl:with-param name="pathFromMaplist" select="$pathFromMaplist"/>
</xsl:apply-templates>
</ul>
</nav>
</xsl:if>
</xsl:template>
<!-- End of add this code -->
</xsl:stylesheet>
- At the bottom of the CSS tab, add the following code:
nav::before {
content: normal;
}
- Click Save Scenario.
Verify if the strings are localized as expected
- In the right pane, click Select map to preview and select a localized map.
- From the Locale drop-down menu, select a map locale.
- Click Generate PDF.
If needed, edit the default localization strings. See Edit the Heretto PDF Generator Localization Strings.