Skip to content

The SimplePluralizer is a package written in C# that allows you to use a noun in the correct form depending on a numeric value.

Notifications You must be signed in to change notification settings

mateusz-opoka/pluralizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Nuget build codecov Maintainability

SimplePluralizer

The SimplePluralizer is a package written in C# that allows you to use a noun in the correct form depending on a numeric value.

Supportability

The SimplePluralizer package supports the below environments:

  • .NET 5 or greater
  • .NET Core 2.0 or greater
  • .NET Framework 4.6.1 and greater

Download

The SimplePluralizer NuGet package is available on NuGet.org.

Installation

PM> Install-Package SimplePluralizer

Example Usage

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"

About

The SimplePluralizer is a package written in C# that allows you to use a noun in the correct form depending on a numeric value.

Resources

Stars

Watchers

Forks

Languages