Logo

Internationalization

Last modified: 05/20/2006 07:47 AM
Revision: i18n.txt 31278 2006-01-03 16:37:05Z dkuhlman

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.

This site is powered by CPS, which includes CPSSkins. CPS and its design are Copyright © 2002-2006 Nuxeo SAS.
CPSSkins is Copyright © 2003-2006 Jean-Marc Orliaguet.
powered_by_nuxeo.png