Author: ianb
Date: 2008-12-04 18:25:12 -0700 (Thu, 04 Dec 2008)
New Revision: 3706

Modified:
   FormEncode/trunk/formencode/api.py
Log:
Don't catch as many KeyErrors during message substitution

Modified: FormEncode/trunk/formencode/api.py
===================================================================
--- FormEncode/trunk/formencode/api.py  2008-12-01 13:28:14 UTC (rev 3705)
+++ FormEncode/trunk/formencode/api.py  2008-12-05 01:25:12 UTC (rev 3706)
@@ -225,13 +225,15 @@
             trans = _stdtrans
 
 
+        msg = self._messages[msgName]
+        msg = trans(msg, **self.gettextargs)
         try:
-            return trans(self._messages[msgName], **self.gettextargs) % kw
+            return msg % kw
         except KeyError, e:
             raise KeyError(
                 "Key not found (%s) for %r=%r %% %r (from: %s)"
                 % (e, msgName, self._messages.get(msgName), kw,
-                   ', '.join(self._messages.keys())))        
+                   ', '.join(self._messages.keys())))
 
     def all_messages(self):
         """


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
FormEncode-CVS mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/formencode-cvs

Reply via email to