getting at the current frame
which actually will look something like this in real code:
def trade(yours, mine): print _('if you give me %(yours)s, i will give you %(mine)s') % { 'yours': yours, 'mine' : mine, }
The string wrapped in _() is what gets translated here.
Okay, we all know that's a pain, right?
What's wrong with def trade(yours, mine): print _('if you give me %(yours)s, i will give you %(mine)s') % vars() Look Ma, no magic! Regards, Martin
"MvL" == Martin v Loewis
writes:
MvL> What's wrong with MvL> def trade(yours, mine): print _('if you give me MvL> %(yours)s, i will give you %(mine)s') % vars() MvL> Look Ma, no magic! Except that I also want globals() to be included and vars() doesn't include that. I really want: d = globals().copy() d.update(locals()) but I've also noticed that you sometimes want attribute following so you can do things like _('the name of the list is %(mlist.listname)') -Barry
participants (2)
-
barry@wooz.org
-
Martin v. Loewis