<?php
$commentLabel = ($numComments == 1) ? "comment" : "comments";
?>
And if you don't use PHP, I know that Java has an equivilant. ASP and C++ ought to, but I don't know. If doing it server-side is a big deal, here's a client-side, Javascript implementation, using my native jQuery:
$('span.comment-link').each(function() {
var numComments = $(this).html().split(" ")[0];
if(parseInt(numComments) == 1) {
$(this).html(numComments + " comment");
}
else {
$(this).html(numComments + " comments");
}
}
That oughtta do it. It's not tested though, so use it at your own risk.
Anyway, I'll be moving development of my book over to my personal blog. My intent was to generate some sort of traffic over here, make something interested that would help people want to come around every so often, but I don't think it quite fits.
All the best to you all,
-Benjamin
There's a syntax error in the javascript up there, should be:
ReplyDelete$('span.comment-link').each(function() {
var numComments = $(this).html().split(" ")[0];
if(parseInt(numComments) == 1) {
$(this).html(numComments + " comment");
}
else {
$(this).html(numComments + " comments");
}
});