Export Content from Your LWR Site for Translation
LWR site content exports in an .xlf file, the standard format that’s compatible with third-party translation software. Content in your site’s original default language is contained within the <source> tags. Translated content goes within the <target> tags. This excerpt from an .xlf file shows content in English (US), the default site language, along with its French translation.
<segment id="title">
<source>Subscribe to our newsletter!</source>
<target>Inscrivez-vous à notre newsletter!</target>
</segment>
<segment id="headline">
<source>We'll send you our latest news.</source>
<target>On vous apporte nos dernières nouvelles.</target>
</segment>
<segment id="description">
<source>No need to search. Get all our news every week in your mailbox.</source>
<target>Plus besoin de chercher. Recevez toute notre actu chaque semaine dans votre boîte mail.</target>
</segment>
- In the Settings panel in Experience Builder, select Languages.
- In the Languages panel, click Export Content.
The exported file doesn’t include CMS content or the items in your site’s navigation menu. Translate the CMS content in your CMS Workspace in the Digital Experiences app. Use Translation Workbench to translate the items in the site’s navigation menu.
- In the Export site content window, select the language that you want to export. Optionally,
enter a name for the .zip file, such as the name of the language that you’re exporting.
You can export more than one language at a time. All languages export in one .zip file, but within the .zip file each language is in its own .xlf file.
- Click Export.
The .xlf file includes the translatable component property values—the properties that are defined as translatable=“true” in the component’s js-meta.xml file. However, the file excludes empty String values, even if they’re marked as translatable, because those properties contain no text to translate.
If you use the HTML Editor component or add SEO head tags to your site, the .xlf file also includes their text, which is in HTML. The exported file includes the HTML tags because these tags sometimes include attributes that need translation, such as placeholder text. For example, an email field where site visitors can enter their email address can look like this in the .xlf file:
&lt;input type=”email” value=”” placeholder=”Enter your email address” name=”contact[email]” id=”Email-footer” class=”newsletter-form-group__input”&gt;
Translators must be familiar enough with HTML tags to know what to translate and what to leave alone. In this case, the only part to translate is Enter your email address.