[EntityTableView] smarter header for MainEntityColRenderer: use plural form only when necessary. Closes #2093182
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 17 Nov 2011 18:19:56 +0100
changeset 8089 0bce018bc7d7
parent 8088 145c0701bac6
child 8090 0b5639aa2dac
[EntityTableView] smarter header for MainEntityColRenderer: use plural form only when necessary. Closes #2093182
web/views/tableview.py
--- a/web/views/tableview.py	Thu Nov 17 18:21:04 2011 +0100
+++ b/web/views/tableview.py	Thu Nov 17 18:19:56 2011 +0100
@@ -782,7 +782,11 @@
 
     def default_header(self):
         view = self.view
-        return u', '.join(self._cw.__(et+'_plural')
+        if len(view.cw_rset) > 1:
+            suffix = '_plural'
+        else:
+            suffix = ''
+        return u', '.join(self._cw.__(et + suffix)
                           for et in view.cw_rset.column_types(view.cw_col or 0))
 
     def render_entity(self, w, entity):