*Before importing multilingual content, please refer to the basic Importing Content documentation.
dotCMS supports importing multilingual content in a few different ways via CSV upload. For the import of new content, the importer supports uploading a specific language version at a time, or multiple language versions. For updating existing content and importing new language versions, dotCMS provides an exporter that exports the existing content. The exported file contains an identifier, language code, and country code column to help users translate each row and add the proper codes for new language versions of the existing content that needs to be updated by matching identifier.
The following documentation steps show how to export existing content for a Movies Content Type, and then import a translated spanish version of the same movie titles and descriptions, updating the existing content. To export a sample CSV file of existing content, first select the Content Type and the contentlets that you'd like to translate, and then click on the Export button as show below.
Download and open the .CSV file containing your existing content. You should see an identifier column that will be used as a “key” field to update the existing content. Do not change anything in the identifier column. Change the two letter language and country codes to match the new language translation version that you'd like to upload, then translate the text in the rest of the fields as appropriate.
After translating and saving the .CSV file, choose the “Import Content” option from the content tab as show below.
Make sure that the proper Content Type is selected as the “Content Type to Import”, then select the specific language version or the “Multilingual File” option if uploading more than one language translation within the same file.
In this example, we have selected the “España - Español” option. Note that you can also download a sample .CSV file here from within the importer, which will generate an empty .CSV file with the mandatory content fields for importing new content. However, since we have already downloaded existing content to translate it, we can just click on the “Choose File” button, select our saved .CSV file with the spanish content versions, and click on “Go to Preview”.
The import preview will let you know that the Identifier field has been found to update the existing content with the new language versions, and which headers match fields in the Content Type. The importer will throw a warning that the “languageCode” and the “countryCode” were not found as fields on the Content Type, but this is ok, the settings in your file will still be respected and define the language version. As long as there are no errors, then click on the “Import Content” button.
The imported content will only import as saved content, but will display the flag for the appropriate language version next to content fields. Make sure that you select all of the newly imported content and Publish them so that they can be pulled dynamically or display on live pages. Edit one of your contentlets to verify that all the language versions are present on the History Tab of each contentlet.
Note that the identifier version number never changes. The inode number identifies each change made to the content, including changes to each language version.