====================
Internationalization
====================

:Revision: $Id: i18n.txt 31278 2006-01-03 16:37:05Z dkuhlman $

.. sectnum::    :depth: 4
.. contents::   :depth: 4


How to internationalize entries in the selection or multi
selection lists.

- 'i18n'

  type: boolean

  default: 0

  explanation: if 'i18n' is set the entries in the selection list
  will be translated using Localizer / Translation service. msgids
  are computed on the basis of the list values returned by the
  'select_variable'.

- 'i18n_prefix'

  type: string

  default: '_'

  explanation: the 'i18n_prefix' is prepended to select entries.
  (e.g. if 'i18n_prefix' is '_option_' 'xxx' becomes 'msgid
  "_option_xxx"')

- 'i18n_suffix'

  type: string

  default: '_'

  explanation: the 'i18n_prefix' is appended to select entries.
  (e.g.  if 'i18n_prefix' is '_title' 'xxx' becomes 'msgid "xxx_title"')

- 'i18n_default_domain'

  type: boolean

  default: 0

  If 'i18n_default_domain' is true the default message catalogue
  will be used instead of the 'cpsskins' message catalogue.

- 'i18n_transform'

  type: string

  default: ''
  
  If 'i18n_transform' contains the name of a method, the entry
  titles will be transformed using the specified method.  This is
  needed for instance to convert portal type ids to portal type
  titles.


Example:  If 'def LifetimeList()' returns ['10', '20', '30']::

  _properties = (
     {'id': 'cache_lifetime', 
      'type': 'selection', 
      'mode': 'w', 
      'label': 'Cache lifetime',  
      'select_variable': 'LifetimeList',
      'i18n': 1,
      'i18n_prefix': '_option_lifetime_',
     }
  )

msgids will be:

- '_option_lifetime_10_' 
- '_option_lifetime_20_'
- '_option_lifetime_30_'

The 'i18n_suffix' is '_' by default.


.. Emacs
.. Local Variables:
.. mode: rst
.. End:
.. Vim
.. vim: set filetype=rst:

