Files @ f4b050aceb1e
Branch filter:

Location: kallithea/dev_requirements.txt

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.
1
2
3
4
5
6
7
8
pytest >= 3.3.0, < 3.8
pytest-runner < 4.3
pytest-sugar >= 0.7.0, < 0.10
pytest-benchmark < 3.2
pytest-localserver < 0.5
mock < 2.1
Sphinx < 1.8
WebTest < 2.1