This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

1. GNOME Website - Plone and Translation

Plone is used to support several languages at www.gnome.org. There are two layers in Plone where translation happens: template layer and content layer.

1.1. Translating Templates

Templates in Plone are used to create the XHTML markup of the site, except of the main content. This includes menues, labels, instructionary text, footers and so on. Templates are also used to create views on content or on folders.

Translating them is a built-in feature of Plone, in short: In Zope-Page-Templates the programmer or web-designer provides message-ids for each string. They are extracted manually or with help of i18ndude and are written to a gettext pot-file. The pot-file resides in the corresponding python-package and lives in filesystem. So it can be managed by a VCS. Translators can pick up the files, translate them and store them back into the python-package. After update on the server and restart of the application server the translations are loaded.

Further reading at Internationalization (i18n) For Developers or see also the overview at plone.org about this topic.

1.2. Translating Content

In Plone content is usally added through the web. Content are items like a Document, a News Item, an Image or an File. The addon LinguaPlone is used to translate those items.

1.2.1. Default Strategy of LinguaPlone

this is the process Plone offers without the proposed add-ons for wgo. Gnome-translators will never touch it.

LinguaPlone builds up linked parallel trees of content. One tree for each language. In Plone content is organizes in folders and subfolders. A folder may have a default view (i.e. listing of contained items) or an item in the folder can be picked as the default item showed when accessing the folder.

The default process to create translated content works this way:

  1. Create an item and select its language, save it. Its the so called canonical item.

  2. Select the language for translation in the content menu. A copy is created and a side-by-side view shows the new items form on the left and the canonical items content on the right.

This need to be repeated for every language needed.

The translated item is created parallel to the existent canonical item. But if the folder the item is contained in is already translated, the item will be stored in the translated folder and not in the canonical items folder. This works up the tree for the complete website structure. This way the url to the translated content item is different and translated as well. After each translation an internal reference between the canonical and all translated objects is kept. This helps to keep translations together.

If content is not translated there is by default no fallback language! The content just does not exist for the visitor of the non-canonical language.

1.2.2. Integration Plone content with gnome's translation process

the wgo-plone team is only 90% sure about the process and how best to integrate, here a proposal from plones point of view how integration can be solved.

1.2.2.1. Assumptions

Gnome Translation Team uses GNU-Gettext PO/POT files to translate everything. Those files are stored somewhere in a VCS (like GIT).

Image-Handling: Original english images are stored in a subfolder "figures" of the english po-files. Translations are stored with the same filename in the subfolder figures of the translation.

Also we assume the technicians of the gnome translation team are able to interface with webservices (simple XML-RPC) offered to fetch a list of items. For each item it pulls XML files from the webservice and pushes back translated xml-files. This xml-files can be processed with xml2po in both directions.

A fallback to english is needed if the item is not (yet) translated.

If english text has changed, existing translations are replaced by the english original, accuracy in the strings takes priority over having them localised.

1.2.2.2. Proposed Process

1.2.2.3. Technical Solutions

Inside Plone we are using the built-in feature of marshalling and de-marshalling content to a well-formed XML format called ATXML (Example ATXML Document) The ATXML will only export relevant fileds (different from the example shown).

The webservice has three features:

  1. fetch: takes a date/time as an optional parameter, returns a list of UIDS of all canonical items modified after the given date (or all if no date was given).

  2. pull: takes an UID as parameter, returns the ATXML text of the item.

  3. push: takes an ATXML document as parameter, returns Boolean (True=success).


2024-10-23 11:10