Magnolia 5.3 reached end of life on June 30, 2017. This branch is no longer supported, see End-of-life policy.

Page tree
Skip to end of metadata
Go to start of metadata

The app is installed by the Content Translation Support module.

The Content Translation app allows you to manually export and re-import page content in translation-friendly XLIFF, CSV and Excel formats. You can then send it to your translation office and import the translated content back. The generated output file includes context information and a link back to the page to facilitate translation.

   

Configuration

The Content Translation app is installed by the Content Translation Support module. The app is based on the content app framework so its configuration is typical of any content app. The app is configured at Configuration > /modules/content-translation-support/apps/contentTranslationSupport.

Node name

 modules

 content-translation-support

 apps

 contentTranslationSupport

Workspace

The Content Translation app operates on the website workspace. 

Node types

The Content Translation app operates on the mgnl:page node type.

Usage

The  Content Translation app  allows you to manually export pages for translation and re-import translated pages. You can also preview and publish pages. The app is available at  Tools > Content Translation .

  • Preview page: Opens the the page in preview mode in the Pages app.
  • Publish and Unpublish are subject to workflow

Exporting content for translation

We use the googleSpreadsheetExporter exporter to demonstrate.  The GoogleSpreadsheetTranslationBundleWriter exporter class adds the Google translate formula to the CSV exporter. When you upload the CSV file to Google Docs it evaluates the formula and the text is machine-translated into the target i18n languages automatically.

To export content:

  1. Select a page. Subpages are included in the export file.
  2. Click Export translation.
  3. Select a file format
  4. Click Export File.

The download filename is created from the file path in the website workspace, with dots replacing forward slashes. In our example website.demo-project.about.history.csv. The file has the following columns (comma separated headings in CSV or elements in XLIFF):

  • Modification date of page
  • Key. Internal identifier that consists of component UUID and field name. This is used by Magnolia to store and render translated content. Do not edit this value.
  • Link to page: Page URL for easy access by the translator. Click to see the translatable text in page context.
  • Title. A pseudo-title created by combining component type and field name, for example Text and Image: Subheading. This tells the translator what kind of page element he is translating.
  • Default language. Default language text.
  • <language_code>. Empty columns for each locale configured for the site. German (de) and Chinese (zh_CN) in the example below. This is where the translator types the corresponding target language text.

Uploading to Google Docs

You can upload the file to Google Docs for automatic machine-translation, or to give your translator a useful starting point. In Google Docs ensure that you have the Settings > Upload Settings > Convert documents, presentations, spreadsheets, and drawings to the corresponding Google Docs format option selected. Here's the History page in Google Docs. You can now download the file and save it as a CSV file for import into Magnolia.

Importing translated content

Once the file has been translated you can upload it in the app. The translated content is automatically included on the page.

To import translated content:

  1. Select the page.
  2. Click Import translation.
  3. Upload the file.
  4. Select the format.
  5. Optionally check the overwrite and import empty translations options.
  6. Click Import File.

In the Pages app you can now see the translated content in the components and dialogs.