The SimplePluralizer is a package written in C# that allows you to use a noun in the correct form depending on a numeric value.
The SimplePluralizer package supports the below environments:
- .NET 5 or greater
- .NET Core 2.0 or greater
- .NET Framework 4.6.1 and greater
The SimplePluralizer NuGet package is available on NuGet.org.
PM> Install-Package SimplePluralizer
Return a correct form for English:
var pluralizer = new Pluralizer("key", "keys");
string result1 = pluralizer.Format(1); // Result: "key"
string result2 = pluralizer.Format(2); // Result: "keys"
string result5 = pluralizer.Format(5); // Result: "keys"
In Polish, for example, endings in the genitive plural are not equal for all grammatical genders:
var pluralizer = new Pluralizer("klucz", "klucze", "kluczy");
string result1 = pluralizer.Format(1); // Result: "klucz"
string result2 = pluralizer.Format(2); // Result: "klucze"
string result5 = pluralizer.Format(5); // Result: "kluczy"