Fixed inflections for status, quiz, move #2056 [deirdre@deirdre.net]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2214 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 2fe86106
*SVN*
* Fixed inflections for status, quiz, move #2056 [deirdre@deirdre.net]
* Added Hash#reverse_merge, Hash#reverse_merge!, and Hash#reverse_update to ease the use of default options
* Added Array#to_sentence that'll turn ['one', 'two', 'three'] into "one, two, and three" #2157 [m.stienstra@fngtps.com]
......
Inflector.inflections do |inflect|
inflect.plural /$/, 's'
inflect.plural /s$/i, 's'
inflect.plural /(ax|cri|test)is$/i, '\1es'
inflect.plural /(ax|test)is$/i, '\1es'
inflect.plural /(octop|vir)us$/i, '\1i'
inflect.plural /(alias)/i, '\1es'
inflect.plural /(alias|status)/i, '\1es'
inflect.plural /(bu)s$/i, '\1ses'
inflect.plural /(buffal|tomat)o$/i, '\1oes'
inflect.plural /([ti])um$/i, '\1a'
......@@ -16,10 +16,10 @@
inflect.plural /(matr|vert|ind)ix|ex$/i, '\1ices'
inflect.plural /([m|l])ouse$/i, '\1ice'
inflect.plural /^(ox)$/i, '\1en'
inflect.plural /(quiz)$/i, '\1zes'
inflect.singular /s$/i, ''
inflect.singular /(n)ews$/i, '\1ews'
inflect.singular /(s)tatus$/i, '\1tatus'
inflect.singular /([ti])a$/i, '\1um'
inflect.singular /((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i, '\1\2sis'
inflect.singular /(^analy)ses$/i, '\1sis'
......@@ -37,15 +37,17 @@
inflect.singular /(shoe)s$/i, '\1'
inflect.singular /(cris|ax|test)es$/i, '\1is'
inflect.singular /([octop|vir])i$/i, '\1us'
inflect.singular /(alias)es$/i, '\1'
inflect.singular /(alias|status)es$/i, '\1'
inflect.singular /^(ox)en/i, '\1'
inflect.singular /(vert|ind)ices$/i, '\1ex'
inflect.singular /(matr)ices$/i, '\1ix'
inflect.singular /(quiz)zes$/i, '\1'
inflect.irregular 'person', 'people'
inflect.irregular 'man', 'men'
inflect.irregular 'child', 'children'
inflect.irregular 'sex', 'sexes'
inflect.irregular 'move', 'moves'
inflect.uncountable %w( equipment information rice money species series fish sheep )
end
\ No newline at end of file
......@@ -35,6 +35,8 @@ class InflectorTest < Test::Unit::TestCase
"safe" => "saves",
"half" => "halves",
"move" => "moves",
"salesperson" => "salespeople",
"person" => "people",
......@@ -65,6 +67,8 @@ class InflectorTest < Test::Unit::TestCase
"series" => "series",
"species" => "species",
"quiz" => "quizzes",
"perspective" => "perspectives",
"ox" => "oxen",
......@@ -76,6 +80,7 @@ class InflectorTest < Test::Unit::TestCase
"information" => "information",
"equipment" => "equipment",
"bus" => "buses",
"status" => "statuses",
"mouse" => "mice",
"louse" => "lice",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册