[mq]: plural_display_name_fix
authorCharles Hébert
Fri, 18 Dec 2009 15:07:54 +0100
changeset 4144 a85db6fa9814
parent 4143 e6d936eef7aa
child 4145 77784738bf7b
[mq]: plural_display_name_fix
web/views/startup.py
--- a/web/views/startup.py	Fri Dec 18 15:07:26 2009 +0100
+++ b/web/views/startup.py	Fri Dec 18 15:07:54 2009 +0100
@@ -133,7 +133,11 @@
             if eschema.final or not eschema.may_have_permission('read', req):
                 continue
             etype = eschema.type
-            label = display_name(req, etype, 'plural')
+            nb = req.execute('Any COUNT(X) WHERE X is %s' % etype)[0][0]
+            if nb > 1:
+                label = display_name(req, etype, 'plural')
+            else:
+                label = display_name(req, etype)
             nb = req.execute('Any COUNT(X) WHERE X is %s' % etype)[0][0]
             url = self._cw.build_url(etype)
             etypelink = u'&#160;<a href="%s">%s</a> (%d)' % (