When slapping yourself in the head is too good for you
-
public static string Pluralise(string text, int count, string culture = "en-US") { // The road to hell is paved with good intentions. if (text.Length > 5 && text.EndsWithIgnoreCase(" need")) { string start = text.Substring(0, text.Length - 5); if (count == 1) return start + " needs"; return Pluralise(start, count, culture) + " need"; } if (count == 1) return text; return PluralizationService.CreateService(new CultureInfo(culture)).Pluralize(text); }
I'll go have a stern word with myself about this one...
cheers Chris Maunder
-
public static string Pluralise(string text, int count, string culture = "en-US") { // The road to hell is paved with good intentions. if (text.Length > 5 && text.EndsWithIgnoreCase(" need")) { string start = text.Substring(0, text.Length - 5); if (count == 1) return start + " needs"; return Pluralise(start, count, culture) + " need"; } if (count == 1) return text; return PluralizationService.CreateService(new CultureInfo(culture)).Pluralize(text); }
I'll go have a stern word with myself about this one...
cheers Chris Maunder
-
public static string Pluralise(string text, int count, string culture = "en-US") { // The road to hell is paved with good intentions. if (text.Length > 5 && text.EndsWithIgnoreCase(" need")) { string start = text.Substring(0, text.Length - 5); if (count == 1) return start + " needs"; return Pluralise(start, count, culture) + " need"; } if (count == 1) return text; return PluralizationService.CreateService(new CultureInfo(culture)).Pluralize(text); }
I'll go have a stern word with myself about this one...
cheers Chris Maunder
It was as if millions of non-English speaking users cried out in anguish, and were suddenly silenced...
Software Zen:
delete this;
-
Chris Maunder wrote:
I'll go have a stern word with myself about this one...
Chris Maunder wrote:
Pluralise
For spelling this wrong, no doubt. :-D
There are only 10 types of people in the world, those who understand binary and those who don't.
Pluralise is correct English. Pluralize, as is commonly the case, is a US bastardisation of English.
"If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.
-
Pluralise is correct English. Pluralize, as is commonly the case, is a US bastardisation of English.
"If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.
If the English knew how to speak and spell properly, we would have never left. :-\
There are two kinds of people in the world: those who can extrapolate from incomplete data. There are only 10 types of people in the world, those who understand binary and those who don't.