Skip to content

Commit 298d984

Browse files
author
Alexander Smishlajev
committed
translate action names and property names in the history list
1 parent 9750a6e commit 298d984

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

roundup/cgi/templating.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ def history(self, direction='descending', dre=re.compile('^\d+$')):
858858
comments['no_exist'] = self._(
859859
"<em>The indicated property no longer exists</em>")
860860
cell.append(self._('<em>%s: %s</em>\n')
861-
% (k, str(args[k])))
861+
% (self._(k), str(args[k])))
862862
continue
863863

864864
if args[k] and (isinstance(prop, hyperdb.Multilink) or
@@ -913,7 +913,7 @@ def history(self, direction='descending', dre=re.compile('^\d+$')):
913913
else:
914914
subml.append(label)
915915
ml.append(sublabel + ', '.join(subml))
916-
cell.append('%s:\n %s'%(k, ', '.join(ml)))
916+
cell.append('%s:\n %s'%(self._(k), ', '.join(ml)))
917917
elif isinstance(prop, hyperdb.Link) and args[k]:
918918
label = classname + args[k]
919919
# if we have a label property, try to use it
@@ -934,50 +934,50 @@ def history(self, direction='descending', dre=re.compile('^\d+$')):
934934
old = '<a href="%s%s">%s</a>'%(classname, args[k], label)
935935
else:
936936
old = label;
937-
cell.append('%s: %s' % (k,old))
937+
cell.append('%s: %s' % (self._(k), old))
938938
if current.has_key(k):
939939
cell[-1] += ' -> %s'%current[k]
940940
current[k] = old
941941

942942
elif isinstance(prop, hyperdb.Date) and args[k]:
943943
d = date.Date(args[k],
944944
translator=self._client).local(timezone)
945-
cell.append('%s: %s'%(k, str(d)))
945+
cell.append('%s: %s'%(self._(k), str(d)))
946946
if current.has_key(k):
947947
cell[-1] += ' -> %s' % current[k]
948948
current[k] = str(d)
949949

950950
elif isinstance(prop, hyperdb.Interval) and args[k]:
951951
val = str(date.Interval(args[k],
952952
translator=self._client))
953-
cell.append('%s: %s'%(k, val))
953+
cell.append('%s: %s'%(self._(k), val))
954954
if current.has_key(k):
955955
cell[-1] += ' -> %s'%current[k]
956956
current[k] = val
957957

958958
elif isinstance(prop, hyperdb.String) and args[k]:
959959
val = cgi.escape(args[k])
960-
cell.append('%s: %s'%(k, val))
960+
cell.append('%s: %s'%(self._(k), val))
961961
if current.has_key(k):
962962
cell[-1] += ' -> %s'%current[k]
963963
current[k] = val
964964

965965
elif isinstance(prop, hyperdb.Boolean) and args[k] is not None:
966-
val = args[k] and 'Yes' or 'No'
967-
cell.append('%s: %s'%(k, val))
966+
val = args[k] and ''"Yes" or ''"No"
967+
cell.append('%s: %s'%(self._(k), val))
968968
if current.has_key(k):
969969
cell[-1] += ' -> %s'%current[k]
970970
current[k] = val
971971

972972
elif not args[k]:
973973
if current.has_key(k):
974-
cell.append('%s: %s'%(k, current[k]))
974+
cell.append('%s: %s'%(self._(k), current[k]))
975975
current[k] = '(no value)'
976976
else:
977-
cell.append('%s: (no value)'%k)
977+
cell.append(self._('%s: (no value)')%self._(k))
978978

979979
else:
980-
cell.append('%s: %s'%(k, str(args[k])))
980+
cell.append('%s: %s'%(self._(k), str(args[k])))
981981
if current.has_key(k):
982982
cell[-1] += ' -> %s'%current[k]
983983
current[k] = str(args[k])
@@ -995,7 +995,7 @@ def history(self, direction='descending', dre=re.compile('^\d+$')):
995995
if dre.match(user):
996996
user = self._db.user.get(user, 'username')
997997
l.append('<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>'%(
998-
date_s, user, action, arg_s))
998+
date_s, user, self._(action), arg_s))
999999
if comments:
10001000
l.append(self._(
10011001
'<tr><td colspan=4><strong>Note:</strong></td></tr>'))

0 commit comments

Comments
 (0)