doc/book/en/development/devweb/internationalization.rst
changeset 4442 7bc0e4ed4109
parent 4437 21f2e01fdd6a
child 4751 1a9d2c3c7f0c
equal deleted inserted replaced
4441:550cf406dbc6 4442:7bc0e4ed4109
    33          id = 'primary'
    33          id = 'primary'
    34          title = _('primary')
    34          title = _('primary')
    35 
    35 
    36   OR
    36   OR
    37 
    37 
    38  * by using the equivalent._cwuest's method ::
    38  * by using the equivalent request's method ::
    39 
    39 
    40      class NoResultView(EmptyRsetView):
    40      class NoResultView(EmptyRsetView):
    41          """default view when no result has been found"""
    41          """default view when no result has been found"""
    42          id = 'noresult'
    42          id = 'noresult'
    43 
    43 
    48 The goal of the *built-in* function `_` is only **to mark the
    48 The goal of the *built-in* function `_` is only **to mark the
    49 translatable strings**, it will only return the string to translate
    49 translatable strings**, it will only return the string to translate
    50 itself, but not its translation (it's actually another name for the
    50 itself, but not its translation (it's actually another name for the
    51 `unicode` builtin).
    51 `unicode` builtin).
    52 
    52 
    53 In the other hand the._cwuest's method `self._cw._` is meant to retrieve the
    53 In the other hand the request's method `self._cw._` is meant to retrieve the
    54 proper translation of translation strings in the._cwuested language.
    54 proper translation of translation strings in the requested language.
    55 
    55 
    56 Finally you can also use the `__` attribute of._cwuest object to get a
    56 Finally you can also use the `__` attribute of request object to get a
    57 translation for a string *which should not itself added to the catalog*,
    57 translation for a string *which should not itself added to the catalog*,
    58 usually in case where the actual msgid is created by string interpolation ::
    58 usually in case where the actual msgid is created by string interpolation ::
    59 
    59 
    60   self._cw.__('This %s' % etype)
    60   self._cw.__('This %s' % etype)
    61 
    61