From 02735642f1de1c8a93b6775a2e197cd0c79185d6 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Sat, 11 Feb 2017 21:41:09 -0200 Subject: [PATCH] better pluralize --- kfet/static/kfet/js/kfet.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kfet/static/kfet/js/kfet.js b/kfet/static/kfet/js/kfet.js index e54d0e74..1412cd4b 100644 --- a/kfet/static/kfet/js/kfet.js +++ b/kfet/static/kfet/js/kfet.js @@ -140,6 +140,7 @@ function requestAuth(data, callback, focus_next = null) { } String.prototype.pluralize = function(count, irreg_plural = false) { - plural = irreg_plural ? irreg_plural : this + 's' ; - return (count==1 ? this : plural) ; + if (Math.abs(count) >= 2) + return irreg_plural ? irreg_plural : this+'s' ; + return this ; }