Mercurial > p > roundup > code
diff roundup/backends/rdbms_common.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 | 4af0d235b570 |
| children | 8b31893f5930 |
line wrap: on
line diff
--- a/roundup/backends/rdbms_common.py Wed Feb 28 22:40:32 2024 -0500 +++ b/roundup/backends/rdbms_common.py Fri Mar 01 14:04:05 2024 -0500 @@ -629,8 +629,8 @@ if not self.config.RDBMS_ALLOW_ALTER: raise DatabaseError(_( - 'ALTER operation disallowed: %(old)r -> %(new)r.' % { - 'old': old_spec, 'new': new_spec})) + 'ALTER operation disallowed: %(old)r -> %(new)r.') % { + 'old': old_spec, 'new': new_spec}) logger = logging.getLogger('roundup.hyperdb.backend') logger.info('update_class %s' % spec.classname) @@ -864,8 +864,8 @@ """ if not self.config.RDBMS_ALLOW_CREATE: - raise DatabaseError(_('CREATE operation disallowed: "%s".' % - spec.classname)) + raise DatabaseError(_('CREATE operation disallowed: "%s".') % + spec.classname) cols, mls = self.create_class_table(spec) self.create_journal_table(spec) @@ -881,7 +881,7 @@ """ if not self.config.RDBMS_ALLOW_DROP: - raise DatabaseError(_('DROP operation disallowed: "%s".' % cn)) + raise DatabaseError(_('DROP operation disallowed: "%s".') % cn) properties = spec[1] # figure the multilinks @@ -925,7 +925,7 @@ """ cn = cl.classname if cn in self.classes: - raise ValueError(_('Class "%s" already defined.' % cn)) + raise ValueError(_('Class "%s" already defined.') % cn) self.classes[cn] = cl # add default Edit and View permissions
