Files @ f4b050aceb1e
Branch filter:

Location: kallithea/docs/api/models.rst

f4b050aceb1e 573 B text/prs.fallenstein.rst Show Annotation Show as Raw Download as Raw
Thomas De Schampheleire
templates: don't apply formatting inside ugettext (_) calls

The call to ugettext (_) is there to obtain a translated string. It may
contain format specifiers like '%s'. If the code is as follows:

_('User-facing string with %s data' % data)

then the string will never be translated in the application, because the
variable 'data' is replaced in the string _before_ being passed to the
translation function '_' (ugettext).

The correct code is:

_('User-facing string with %s data') % data

so that we first get the translated string and _then_ substitute the
variable 'data'.

Note: the string extraction logic (used to extract all user-facing strings
to pass to translators) happily accepted the bad code, ignoring the string
substitution. It would have been better if it had warned loudly about this
problem.
.. _models:

========================
The :mod:`models` module
========================

.. automodule:: kallithea.model
   :members:

.. automodule:: kallithea.model.comment
   :members:

.. automodule:: kallithea.model.permission
   :members:

.. automodule:: kallithea.model.repo_permission
   :members:

.. automodule:: kallithea.model.repo
   :members:

.. automodule:: kallithea.model.repo_group
   :members:

.. automodule:: kallithea.model.scm
   :members:

.. automodule:: kallithea.model.user
   :members:

.. automodule:: kallithea.model.user_group
   :members: