comparison 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
comparison
equal deleted inserted replaced
7749:79344ea780ea 7750:216662fbaaee
27 class Timestamped: 27 class Timestamped:
28 def timecheck(self, field, delay): 28 def timecheck(self, field, delay):
29 try: 29 try:
30 created = unpack_timestamp(self.form[field].value) 30 created = unpack_timestamp(self.form[field].value)
31 except KeyError: 31 except KeyError:
32 raise FormError(_("Form is corrupted, missing: %s." % field)) 32 raise FormError(_("Form is corrupted, missing: %s.") % field)
33 if time.time() - created < delay: 33 if time.time() - created < delay:
34 raise FormError(_("Responding to form too quickly.")) 34 raise FormError(_("Responding to form too quickly."))
35 return True 35 return True

Roundup Issue Tracker: http://roundup-tracker.org/