diff --git a/frontend/js/count.js b/frontend/js/count.js index 5fbbdc8..734447b 100644 --- a/frontend/js/count.js +++ b/frontend/js/count.js @@ -55,7 +55,13 @@ count = resp.commentCounts[paths[i]]; } - doms[i].innerText = count + " " + (count === 1 ? "comment" : "comments"); + var useCustomCommentsText = doms[i].getAttribute("data-custom-comments-text") !== null; + + if(useCustomCommentsText) { + doms[i].innerText = eval(doms[i].getAttribute("data-custom-comments-text"))(count); + } else { + doms[i].innerText = count + " " + (count === 1 ? "comment" : "comments"); + } } }); }