Learn / eZ Publish / Translating Content in eZ Publish

Translating Content in eZ Publish

This article is the eighth and final article in a series focusing on concepts and features discussed in the newly released book eZ Publish Content Management Basics. It provides an introduction to working with multilingual content in eZ Publish. It explains how to create new translations and describes the powerful translation tools built into eZ Publish. The target audience for this article includes all content editors working with multilingual eZ Publish websites.

Requirements

Translation management is performed via the eZ Publish Website Interface or Administration Interface. Readers can review the access requirements for the Website Interface and Administration Interface from the previous articles in this series.

In order to be able to translate content, your eZ Publish website must have more than one language installed. Contact your site administrator or webmaster regarding the available languages and what is set up for your site.

Recall from the seventh article in this series that a content object represents a piece of content in eZ Publish, and consists of at least one version. Each version further consists of at least one translation. Versions are the second dimension of content objects, while translations are the third dimension of content objects.

The translation layer makes it possible to represent the same version of the same content in multiple languages. A translation consists of attributes. Recall that attributes are the entity that holds the actual content, such as the title of an article. When you translate content, attributes are represented by the values of the different input fields.

Fallback system

Sometimes not all content objects have been translated into all of a site's available languages. eZ Publish has a built-in fallback system that still displays content when a particular object or its attributes have not been translated.

eZ Publish can be configured to use a prioritized list of languages. The system will first try to display content in the highest prioritized language. If an object has not been translated to this language, the system will then try to display content in the second prioritized language, and so on down the language list. If an object does not exist in any of the site languages, it will not be shown unless it is configured to override this default behavior. This override is configured in the Translations window, which is described later in this article.

Some content objects (such as user objects and folders) must always be displayed, even if they do not exist in any of the configured languages. Also, some attributes cannot be translated, such as people's names and email addresses. In this case, the same value is displayed for all translations.

Translation languages

Translation languages are the set of languages in which content can be created and translated. These can be managed via the Administration Interface. The maximum number of translation languages is 30.

The best way to get an overview of translations for a content object is to use the Translations window in the Administration Interface. This window and associated switch are only available on multilingual eZ Publish sites (which is configured during installation). There is no equivalent window in the Website Interface.

Translations window

The Translations window shows the languages that exist for the published version of an object. The currently selected translation is displayed in bold characters. The top of the window shows the number of translations. From the Translations window, you can edit a translation by clicking on the language's corresponding edit icon on the right. Clicking on a translation name, such as "German" in the above screenshot, will reload the page to display the selected translation in the Preview window. When either one or several languages are selected using the checkboxes on the left, clicking the Remove selected button deletes the selected translations.

You can also set the main language for an object. Main languages cannot be deleted (unless you change the site's main language). When the checkbox at the bottom of the window is marked, and an object does not exist in any of the site languages and is always available, the system will use the object's main language to display its contents.

Note that you cannot add new translations through the Translations window, as it only displays information about existing translations and enables you to access them.

You can translate an object into any of the available translation languages. There are several ways to add a new translation to an object, depending on which interface you use and whether or not you have JavaScript enabled. The process for editing an existing translation is the same as described for editing content objects in the Website Interface and Administration Interface.

Adding a new translation using the Website Interface

To translate content through the front-end of your site, access the site in the target language and follow the steps below.

Make sure you are logged in as an Editor (or Administrator) user and are viewing the content you wish to translate in the target language. For example, to translate an article from English into French, first access the French version of the site (the French siteaccess), typically by clicking the "Fre" link in the top left corner of the page.

  1. Links for selecting language specific siteaccess
  2. Click on the Edit button on the Website Toolbar.
  3. Write the content in the new language and click the Send for publishing button.

Adding a new translation using the Administration Interface

In the Administration Interface, there are several options for adding a translation, which follow the same process as you would normally use to access the Object Edit Interface.

The first is to use the Sub items window at the bottom of the main area when viewing an object's parent node. Locate the object that you wish to edit in the Sub items window, and click on its corresponding edit icon (on the right). You will be taken to the Language selection interface:

Language selection interface, new translation

Select the desired parameters and click the Edit button. The system will bring up the Object Edit Interface where you can enter your translated content.

The second option is to use the Edit button at the bottom of the Preview window when viewing an object. Use the dropdown list of languages and select "Another language". Clicking the Edit button will take you to a reduced form of the Language selection interface that was shown above. It will contain a list of languages in which the object does not exist and a list of available languages on which the new translation can be based. Then you can continue as described above.

The third option is to use the left tree menu and the context-sensitive pop-up menu (or alternatively the pop-up menu for your eZ Publish bookmarks). This is usually the quickest option if you have JavaScript enabled. Locate the object that you wish to edit in the tree menu on the left of the Administration Interface and click on the object's icon in order to bring up the context-sensitive pop-up menu. Access the "Edit in" sub menu and select "Another language". You will be taken to the reduced Language selection interface, and can then continue as describe above.

(JavaScript is a lightweight programming language that extends the functionality of XHTML. It is used in eZ Publish to create a more user-friendly environment. If JavaScript is disabled, the pop-up menu will not be available.)

When adding a new translation, you can choose an existing translation on which to base it, as was shown previously:

Language selection interface, new translation

Select the desired parameters and click the Edit button. The system will bring up the Object Edit Interface where you can enter your translated content.

The second option is to use the Edit button at the bottom of the Preview window when viewing an object. Use the dropdown list of languages and select "Another language". Clicking the Edit button will take you to a reduced form of the Language selection interface that was shown above. It will contain a list of languages in which the object does not exist and a list of available languages on which the new translation can be based. Then you can continue as described above.

The third option is to use the left tree menu and the context-sensitive pop-up menu (or alternatively the pop-up menu for your eZ Publish bookmarks). This is usually the quickest option if you have JavaScript enabled. Locate the object that you wish to edit in the tree menu on the left of the Administration Interface and click on the object's icon in order to bring up the context-sensitive pop-up menu. Access the "Edit in" sub menu and select "Another language". You will be taken to the reduced Language selection interface, and can then continue as describe above.

(JavaScript is a lightweight programming language that extends the functionality of XHTML. It is used in eZ Publish to create a more user-friendly environment. If JavaScript is disabled, the pop-up menu will not be available.)

When adding a new translation, you can choose an existing translation on which to base it, as was shown previously:

Language selection interface, new translation

You can select one of the existing languages or "None". When a language is chosen instead of "None", the standard edit interface (the Content Editing Interface or Object Edit Interface) will be in translator mode. In translator mode, the attributes are shown in the base language above the input fields representing the attributes for the new translation:

Translator mode

Within edit mode, you can toggle translator mode on and off and change the base language. In the Website Interface, use the dropdown list and the Translate button on the Website Toolbar:

Website Toolbar with tools for customizing translator mode

In the Administration Interface, use the Translate from window on the left:

Translate from window

Note that new translations can only be specified prior to entering edit mode.

eZ Publish supports content in multiple languages. The translation layer of content objects makes it possible to represent the same version of the same content in multiple languages. eZ Publish has an integrated fallback system to ensure that content is displayed when it is not available in a specific language.

The translation languages are a set of languages in which you can create and translate content. This list of languages is specified by the site administrator.

Adding a new translation in the Website Interface is done from the Website Toolbar when viewing content in the target language. In the Administration Interface, you can use either the Edit buttons within the main area or the context-sensitive pop-up menu. When adding a new translation, it is possible to base it on an existing translation. In this case, the existing translation is shown to help you create the new translation.

Resources