[i18n] use named substitution to avoid gettext warnings stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 31 Mar 2010 11:41:17 +0200
branchstable
changeset 5098 32b1adfb6b92
parent 5097 60a237638f57
child 5099 da66ad091745
[i18n] use named substitution to avoid gettext warnings
server/sources/native.py
--- a/server/sources/native.py	Wed Mar 31 10:56:43 2010 +0200
+++ b/server/sources/native.py	Wed Mar 31 11:41:17 2010 +0200
@@ -1031,8 +1031,8 @@
             entity = self.repo.vreg['etypes'].etype_class(etype)(session)
         except Exception:
             return [session._(
-                "Can't undo creation of entity %s of type %s, type "
-                "no more supported" % (eid, etype))]
+                "Can't undo creation of entity %(eid)s of type %(etype)s, type "
+                "no more supported" % {'eid': eid, 'etype': etype})]
         entity.set_eid(eid)
         # for proper eid/type cache update
         hook.set_operation(session, 'pendingeids', eid,
@@ -1075,8 +1075,8 @@
             cu = self.doexec(session, sql)
             if cu.fetchone() is None:
                 errors.append(session._(
-                    "Can't undo addition of relation %s from %s to %s, doesn't "
-                    "exist anymore" % (rtype, subj, obj)))
+                    "Can't undo addition of relation %(rtype)s from %(subj)s to"
+                    " %(obj)s, doesn't exist anymore" % locals()))
         if not errors:
             self.repo.hm.call_hooks('before_delete_relation', session,
                                     eidfrom=subj, rtype=rtype, eidto=obj)