Translating Web Content
Liferay DXP/Portal 7.3+
Liferay provides integrated tools for translating web content articles, so you can create engaging, localized content for your global users. With these tools, you can manually translate web content or import translations as XLIFF files.
If desired, you can enable a custom workflow to direct the review and publishing process for translations.
The languages available for translation are determined by your instance’s localization settings. See Initial Instance Localization and Virtual Instance Localization for more information.
Manually Translating Content
To manually translate web content, users must have either View and Update permissions for the asset or Translation permissions for one or more languages. See Managing Permissions for Translation for more information.
Open the Site Menu () and navigate to Content & Data → Web Content.
Click Actions () for the content you want to translate and select Translate.
This redirects you to the translation interface, where you can view the content’s original text alongside your translation.
The left column displays the language you’re translating from, and the right column provides editable fields you can use for your translation.
Select the language you want to translate.
ImportantUsers with content Update permissions can translate the original text into any language.
Users with
translate
permissions can only translate the origin text into languages for which they have permission.Enter your translation for the available fields.
NoteThe friendly URL for translations remains empty unless filled in by the user. If the friendly URL is left empty, the default language’s friendly URL is used.
Click Publish to create a new version of the web content or initiate a workflow, if it’s enabled.
Alternatively, click Save as Draft to save and publish your translation later.
Publishing Translated Web Content Using Localizable Fields
Translated web content in localizable fields can be different structurally from the content displayed in the original language. Liferay does this so your changes don’t override content that has been already translated. To see how this works, follow these steps:
In Web Content, go to Structures and Click Add.
Create a structure using a repeatable fieldset. For example, add a Text and an Image field to your fieldset. Make them both required and click Save.
Add the fieldset to your new structure and make it repeatable.
In the upper left corner, click the flag icon and click Manage Translations.
Click Add () and add a language of your choice. Click Done.
Name your structure and click Save.
Now navigate to Web Content and click New. Select the structure you just created.
Enter a value for your text field and select an image.
In the upper left corner, click the flag icon and click the language previously chosen as your translation. Notice that the content in the fieldset has not changed. The same happens when you duplicate the fieldset using the default language; the secondary language’s content doesn’t change. Now change the translation back to the default language and name your web content. Click Publish.
Click Actions () next to your web content and click Translate.
On Translate From in the upper corner, select the language chosen in the structure creation. Click Publish.
Click your web content to enter edit mode.
In the upper left corner, click the flag icon. See that the secondary language has the Translated message next to it.
Using your default language, click Duplicate () once more and enter a value for the text field and select an image.
In the upper left corner, click the flag icon and select the translated language. You can see that the content selected for the duplicated fieldset is not present when using this translation.
This behavior frees you to manage your translations independently from the original language.
Exporting and Importing Translations
To translate content page experiences manually, users must have either View and Update permissions for content pages or Translation permissions for one or more languages. See Managing Translation Permissions for more information.
With Liferay, you can export web content for translation as .xliff
or .xlf
files. You can send these files to translators and then import the translations together as a .zip
file or individually as .xliff
or .xlf
files.
Liferay supports both XLIFF 1.2 and 2.0 files. However, it may not support all features and capabilities those formats provide.
Exporting Content for Translation
Open the Site Menu () and navigate to Content & Data → Web Content.
Click Actions () for the content you want to translate and select Export for Translation. This opens a modal window for configuring your export.
In Liferay Portal 7.4 GA26+, you can select multiple articles and click the Export for Translation button.
Select an export format: XLIFF 1.2 or XLIFF 2.0.
Select the web content’s original language.
Select the languages you want to translate to.
Click Export.
Liferay generates a ZIP archive that contains an XLIFF file for each selected language. You can then use these files with compatible translation software.
Importing Content Translations
Open the Site Menu () and navigate to Content & Data → Web Content.
Click Actions () for the translated web content and select Import Translation.
In Liferay Portal 7.4 GA26+, you can import translations for multiple articles at once by clicking the Actions button () in the Application Bar and selecting Import Translations.
Select the
.xliff
,.xlf
, and.zip
files you want to import.ImportantWhile Liferay supports importing XLIFF files created using the Export for Translation action, it cannot guarantee the successful import of files generated by other means.
Click Publish.
If successful, Liferay displays a success message with the imported files. The web content is updated with all changes included in the translation files. If workflow is enabled, this change must be approved as with other content updates.
However, if errors occur during import, Liferay notifies you of the failing files and provides a downloadable CSV error report.
Translating Web Content Using Third Party Services
If you’ve enabled Liferay’s integration with Google Cloud Translation, Amazon Translate, or Microsoft Translator, you can use them to automatically translate web content. See Using Third Parties for Translation for more information.