Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Fix inflector bug on pluralize the irregular words

#549

There's one problem that I count it as a bug, but I don't know it should be counted as a bug or not.

Normally, when you use inflector 'pluralize' and 'singularize' methods, it would look something like this:

puts "bag".pluralize
#=> "bags"
puts "bags".singularize
#=> "bag"

Now when it comes to pluralize the plural, it returns the same word again:

puts "bags".pluralize
#=> "bags"

However, for the irregular word (i.e. person and people), when using the pluralize on the plural form, it gives a strange result:

puts "person".pluralize
#=> "people"
puts "people".singularize
#=> "person"
puts "people".pluralize
#=> "peoples"

I don't think this is an expected behavior, since you would normally not putting 's' after the plural form of the word. :)

Reported by Prem Sichanugrist (sikachu) · July 4th, 2008 @ 08:52 AM

State: stale
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. José Valim
  2. josh
    josh
    • State changed from new to stale

    October 28th, 2008 @ 04:23 PM

  3. Prem Sichanugrist (sikachu)
    Prem Sichanugrist (sikachu)

    To make it clear, as the patch become stalled now.

    I focus this patched only for the irregular plurals, which defined in Rails only. For example, if Rails already defined plural of person as 'people', when you call 'people'.pluralize, it shouldn't become 'peoples'.

    Just wonder why there's no enough people to support this ..

    October 28th, 2008 @ 05:33 PM

  4. Cab Jones
    Cab Jones
    • Importance changed from to

    The plural of person is ambiguous, people may be the best choice. But people can be construed as singular with the plural peoples. If the plural of people is requested, it is not wrong to presume that people is being construed as singular. Here is a relevant article: http://www.worldwidewords.org/articles/people.htm

    October 12th, 2010 @ 08:28 AM