[#8464] added helper to pluralize specific tool names
diff --git a/Allura/allura/controllers/project.py b/Allura/allura/controllers/project.py
index e78d29e..56d01c9 100644
--- a/Allura/allura/controllers/project.py
+++ b/Allura/allura/controllers/project.py
@@ -329,7 +329,7 @@
total_entries=total_entries,
entries=entries[start:start + limit],
type=tool_label,
- tool_name=tool_label,
+ tool_name=h.pluralize_tool_name(tool_label, total_entries),
)
diff --git a/Allura/allura/lib/helpers.py b/Allura/allura/lib/helpers.py
index 5ecb786..4a5445b 100644
--- a/Allura/allura/lib/helpers.py
+++ b/Allura/allura/lib/helpers.py
@@ -1318,3 +1318,10 @@
url = user.url()
return f'{url}profile/'
+
+
+def pluralize_tool_name(tool_name:string, count:int):
+ pluralize_tools = ['Wiki', 'Discussion', 'Blog']
+ if tool_name is not None and tool_name in pluralize_tools:
+ return f"{tool_name}{'s'[:count^1]}"
+ return tool_name