Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does this library differ from Humanizer? #1

Closed
x2764tech opened this issue Oct 3, 2016 · 2 comments
Closed

How does this library differ from Humanizer? #1

x2764tech opened this issue Oct 3, 2016 · 2 comments

Comments

@x2764tech
Copy link

I already use Humanizer - what are the advantages of PluralNet?

@jnm2
Copy link

jnm2 commented Oct 3, 2016

This is going to be everyone's first question. A chart would be nice.

@rudyhuyn
Copy link
Owner

rudyhuyn commented Oct 3, 2016

The purpose of these 2 libraries are very different.

Humanizer is a library to do operations on strings, one of the operation is to pluralize a word : "man".Pluralize().

To cut a long story short, Humanizer does:

  • verify if the word is "man" "woman" "child", etc... and use the correct plural
  • verify the ending of the word: potato => potatoES
  • verify if the word is uncountable
  • else add a S

It only supports english, no sentences and is not related numbers.

PluralNet is totally different, it's a tool for localizations (select the correct resource depends of the number), if you want to display:

  • you have removed XX item(s), you can restore this file(s) using this link.

You can create 2 resources:

  • you have removed 1 item, you can restore this file using this link.
  • you have removed {0} items, you can restore these files, using this link.

PluralNet will select the correct string depends of the number and will support all languages.

For example

  • 0 is singular in french
  • 9999.999991 is singular for some languages cause ending with a 1
  • Polish has 4 different plural forms

etc...

I wrote an article about that, read it here:
http://www.rudyhuyn.com/blog/2016/09/28/pluralization-the-missing-part-of-net/

To conclude, both libraries are useful but has 2 different purposes, you can use both on your application

@rudyhuyn rudyhuyn closed this as completed Oct 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants