Mercurial > p > roundup > code
comparison roundup/roundupdb.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 | 2b0089104f08 |
| children | 24549122f9b1 |
comparison
equal
deleted
inserted
replaced
| 7749:79344ea780ea | 7750:216662fbaaee |
|---|---|
| 135 except ValueError as e: | 135 except ValueError as e: |
| 136 username = props['username'] | 136 username = props['username'] |
| 137 # Try to make error message less cryptic to the user. | 137 # Try to make error message less cryptic to the user. |
| 138 if str(e) == 'node with key "%s" exists' % username: | 138 if str(e) == 'node with key "%s" exists' % username: |
| 139 raise ValueError( | 139 raise ValueError( |
| 140 _("Username '%s' already exists." % username)) | 140 _("Username '%s' already exists.") % username) |
| 141 else: | 141 else: |
| 142 raise | 142 raise |
| 143 | 143 |
| 144 # clear the props from the otk database | 144 # clear the props from the otk database |
| 145 self.getOTKManager().destroy(otk) | 145 self.getOTKManager().destroy(otk) |
