Conference Session

I18N for add-on developers

By: Hanno Schlichting

About Hanno Schlichting

Hanno Schlichting is the most prolific Plone contributer in recent years. Amongst his many roles he leads the Plone internationalization team and maintains all i18n related packages of Plone itself. He works as a software developer for Jarn AS in Norway.

About the session

I have been intending to talk or write a tutorial about best-practice i18n in current Plone for a long time. Now that I have finally convinced myself, that now is as good a time than at any other time, I'm struggling to find the right form of presentation. I'm somewhat open to change this tutorial into a talk, but cannot find the right spot, where to cut this off into a basic and advanced talk.

So what do I want to talk about at all? My approach would be to use a simple content type add-on, generated with best-practice paster templates and do a step-by-step rundown of what needs to be done, to turn this into a fully i18n-aware package.

So in order of appearance here are the topics:

  • I18N in TAL (i18n-ize a page template, toLocalizedTime)
  • Python and message ids (adding a field to the schema with labels and descriptions for the widget, add an i18n-aware vocabulary, generate a status message from a view)
  • GenericSetup (how to mark up the action and type information)
  • Domains (what about the plone domain vs. a custom i18n domain)
  • i18n vs. locales folders and when to use which (basically what versions of Plone do I need for this to work)
  • i18ndude and how to manage Gettext message catalogs (extraction of the message strings and how to sync po files with pot files)
  • Gettext message catalogs and PoEdit (how do I add a new translation and translate strings in it, why do we use message ids which are different from the default text, short note about msgctxt and plural forms)
  • zope.i18n vs. PlacelessTranslationService (how to debug and solve the most common errors, like missing or wrong headers, how to reload message catalogs without server restarts)
  • Language negotiation (how to configure my site for multiple languages and how to determine the language)
  • LinguaPlone (how to get my type LP aware and what are language independent fields)
  • I think this is ample material for a tutorial including breaks and Q&A.

If there is time left I can expand on more exotic stuff like locale aware normalization, locale based sorting, advanced date, country and currency localization, LinguaPlone and external translation tools like Trados, Wordfast and XLIFF, translation dependent workflows, ... but I doubt we'll get there and leave that to the open Q&A part.

This is a Tutorial (90 min)