Mercurial > p > roundup > code
diff roundup/cgi/timestamp.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 | 07ce4e4110f5 |
| children |
line wrap: on
line diff
--- a/roundup/cgi/timestamp.py Wed Feb 28 22:40:32 2024 -0500 +++ b/roundup/cgi/timestamp.py Fri Mar 01 14:04:05 2024 -0500 @@ -29,7 +29,7 @@ try: created = unpack_timestamp(self.form[field].value) except KeyError: - raise FormError(_("Form is corrupted, missing: %s." % field)) + raise FormError(_("Form is corrupted, missing: %s.") % field) if time.time() - created < delay: raise FormError(_("Responding to form too quickly.")) return True
