pluralize function

This commit is contained in:
Ludovic Stephan 2016-12-11 23:23:12 -02:00
parent ee54b36696
commit e52c44580f

View file

@ -138,3 +138,8 @@ 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) ;
}