comparison roundup/scripts/roundup_server.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 5a35cfee727a
children 683af7c57ce5
comparison
equal deleted inserted replaced
7749:79344ea780ea 7750:216662fbaaee
546 self.end_headers() 546 self.end_headers()
547 547
548 548
549 def error(): 549 def error():
550 exc_type, exc_value = sys.exc_info()[:2] 550 exc_type, exc_value = sys.exc_info()[:2]
551 return _('Error: %(type)s: %(value)s' % {'type': exc_type, 551 return _('Error: %(type)s: %(value)s') % {'type': exc_type,
552 'value': exc_value}) 552 'value': exc_value}
553 553
554 554
555 def setgid(group): 555 def setgid(group):
556 if group is None: 556 if group is None:
557 return 557 return
838 "port already in use.") % self["PORT"]) 838 "port already in use.") % self["PORT"])
839 if e.args[0] == errno.EACCES: 839 if e.args[0] == errno.EACCES:
840 raise socket.error(_( 840 raise socket.error(_(
841 "Unable to bind to port %(port)s, " 841 "Unable to bind to port %(port)s, "
842 "access not allowed, " 842 "access not allowed, "
843 "errno: %(errno)s %(msg)s" % { 843 "errno: %(errno)s %(msg)s") % {
844 "port": self["PORT"], 844 "port": self["PORT"],
845 "errno": e.args[0], 845 "errno": e.args[0],
846 "msg": e.args[1]} 846 "msg": e.args[1]}
847 )) 847 )
848 848
849 raise 849 raise
850 # change user and/or group 850 # change user and/or group
851 setgid(self["GROUP"]) 851 setgid(self["GROUP"])
852 setuid(self["USER"]) 852 setuid(self["USER"])

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