doc/book/devweb/internationalization.rst
changeset 12580 f97eba3156c0
parent 11735 7a170207acbf
child 12581 0951dcdcfd5a
equal deleted inserted replaced
12579:ce089224954d 12580:f97eba3156c0
    62 translation for a string *which should not itself added to the catalog*,
    62 translation for a string *which should not itself added to the catalog*,
    63 usually in case where the actual msgid is created by string interpolation ::
    63 usually in case where the actual msgid is created by string interpolation ::
    64 
    64 
    65   self._cw.__('This %s' % etype)
    65   self._cw.__('This %s' % etype)
    66 
    66 
    67 In this example ._cw.__` is used instead of ._cw._` so we don't have 'This %s' in
    67 In this example `._cw.__` is used instead of `._cw._` so we don't have 'This %s' in
    68 messages catalogs.
    68 messages catalogs.
    69 
    69 
    70 Translations in cubicweb-tal template can also be done with TAL tags
    70 Translations in cubicweb-tal template can also be done with TAL tags
    71 `i18n:content` and `i18n:replace`.
    71 `i18n:content` and `i18n:replace`.
    72 
    72 
   147 You have added and/or modified some translation strings in your cube
   147 You have added and/or modified some translation strings in your cube
   148 (after creating a new view or modifying the cube's schema for exemple).
   148 (after creating a new view or modifying the cube's schema for exemple).
   149 To update the translation catalogs you need to do:
   149 To update the translation catalogs you need to do:
   150 
   150 
   151 1. `cubicweb-ctl i18ncube <cube>`
   151 1. `cubicweb-ctl i18ncube <cube>`
   152 2. Edit the <cube>/i18n/xxx.po  files and add missing translations (empty `msgstr`)
   152 2. Edit the `<cube>/i18n/xxx.po` files and add missing translations (those with an empty `msgstr`)
   153 3. `hg ci -m "updated i18n catalogs"`
   153 3. `hg ci -m "updated i18n catalogs"`
   154 4. `cubicweb-ctl i18ninstance <myinstance>`
   154 4. `cubicweb-ctl i18ninstance <myinstance>`
   155 
   155 
   156 
   156 
   157 Customizing the messages extraction process
   157 Customizing the messages extraction process
   278 
   278 
   279 Contextual entries are automatically used in some cases. For instance,
   279 Contextual entries are automatically used in some cases. For instance,
   280 entity.dc_type(), eschema.display_name(req) or display_name(etype,
   280 entity.dc_type(), eschema.display_name(req) or display_name(etype,
   281 req, form, context) methods/function calls will use them.
   281 req, form, context) methods/function calls will use them.
   282 
   282 
   283 It is also possible to explicitly use the with _cw.pgettext(context,
   283 It is also possible to explicitly use a context with `_cw.pgettext(context,
   284 msgid).
   284 msgid)`.
   285 
   285 
   286 
   286 
   287 Specialize translation for an application cube
   287 Specialize translation for an application cube
   288 ``````````````````````````````````````````````
   288 ``````````````````````````````````````````````
   289 
   289