Fix incorrect pluralization of Human.

Human should become humans, unlike other words ending in man.

Fixes #5370
This commit is contained in:
mark_story 2014-12-09 21:51:42 -05:00
parent 1a1583a832
commit ac6d5cc70f
2 changed files with 5 additions and 1 deletions

View file

@ -186,6 +186,10 @@ class InflectorTest extends CakeTestCase {
* @return void
*/
public function testInflectingPlurals() {
$this->assertEquals(Inflector::pluralize('axman'), 'axmen');
$this->assertEquals(Inflector::pluralize('man'), 'men');
$this->assertEquals(Inflector::pluralize('woman'), 'women');
$this->assertEquals(Inflector::pluralize('human'), 'humans');
$this->assertEquals(Inflector::pluralize('categoria'), 'categorias');
$this->assertEquals(Inflector::pluralize('house'), 'houses');
$this->assertEquals(Inflector::pluralize('powerhouse'), 'powerhouses');

View file

@ -44,7 +44,7 @@ class Inflector {
'/sis$/i' => 'ses',
'/([ti])um$/i' => '\1a',
'/(p)erson$/i' => '\1eople',
'/(m)an$/i' => '\1en',
'/(?<!u)(m)an$/i' => '\1en',
'/(c)hild$/i' => '\1hildren',
'/(buffal|tomat)o$/i' => '\1\2oes',
'/(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|vir)us$/i' => '\1i',