This project is archived and is in readonly mode.
Fix inflector bug on pluralize the irregular words
Reported by Prem Sichanugrist (sikachu) | July 4th, 2008 @ 08:52 AM | in 2.x
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. :)
Comments and changes to this ticket
-
josh October 28th, 2008 @ 04:23 PM
- State changed from new to stale
-
Prem Sichanugrist (sikachu) October 28th, 2008 @ 05:33 PM
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 ..
-
Cab Jones October 12th, 2010 @ 08:28 AM
- 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
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
- 1183 Switch active_model to use I18n.translate method instead https://rails.lighthouseapp.com/projects/8994/tickets/54...