Mercurial > p > roundup > code
diff roundup/backends/sessions_redis.py @ 7750:216662fbaaee
fix(i18n): fix incorrect lookup of some translations
The code had:
_("some term %s here" % term)
this extracts the template, but looks up the string with %s replaced.
So the translation is broken. Changed to:
_("some term %s here") % term
which looks up the template and substitutes in the translation of the
template.
Found by ruff INT ruleset.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Fri, 01 Mar 2024 14:04:05 -0500 |
| parents | dd15c307c409 |
| children |
line wrap: on
line diff
--- a/roundup/backends/sessions_redis.py Wed Feb 28 22:40:32 2024 -0500 +++ b/roundup/backends/sessions_redis.py Fri Mar 01 14:04:05 2024 -0500 @@ -76,8 +76,8 @@ if default != self._marker: return default raise KeyError(_('Key %(key)s not found in %(name)s ' - 'database.' % {"name": self.name, - "key": escape(infoid)})) + 'database.') % {"name": self.name, + "key": escape(infoid)}) return self.todict(v)[value] def getall(self, infoid): @@ -95,8 +95,8 @@ # If so, we get a misleading error, but anydbm does the # same so.... raise KeyError(_('Key %(key)s not found in %(name)s ' - 'database.' % {"name": self.name, - "key": escape(infoid)})) + 'database.') % {"name": self.name, + "key": escape(infoid)}) ''' def set_no_tranaction(self, infoid, **newvalues): """ this is missing transaction and may be affected by @@ -190,8 +190,8 @@ break except redis.exceptions.WatchError: self.log_info( - _('Key %(key)s changed in %(name)s db' % - {"key": escape(infoid), "name": self.name}) + _('Key %(key)s changed in %(name)s db') % + {"key": escape(infoid), "name": self.name} ) else: try:
