Permalink
Browse files

(Fixes issue 3121) added more rules for proper pluralization to CCode…

…Model->pluralize()
  • Loading branch information...
1 parent f2dd7be commit 56b931f4c46c17e333028e6eb080eb0756cb1268 mdomba committed Jan 24, 2012
Showing with 15 additions and 3 deletions.
  1. +1 −0 CHANGELOG
  2. +14 −3 framework/gii/CCodeModel.php
View
@@ -15,6 +15,7 @@ Version 1.1.10 work in progress
- Enh #3097: Added CHttpRequest::decodePathInfo() (Y!!)
- Enh #3101: The methods of CSecurityManager do now work correctly for the case that mbstring.func_overload is in effect (Y!!)
- Enh #3112: Fixed the exception error display on ajax calls when YII_DEBUG is true (mdomba)
+- Enh #3121: Gii, added more rules for proper pluralization to CCodeModel->pluralize() (mdomba)
- Enh: Added CActiveForm::validateTabular() to simplify ajax validation for tabular input (mdomba)
- Chg: Upgraded JQuery UI to 1.8.17 (mdomba)
- Chg: Upgraded HTMLPurifier to v4.4.0 (Sam Dark)
@@ -405,11 +405,22 @@ public function getStickyFile()
public function pluralize($name)
{
$rules=array(
+ '/move$/i' => 'moves',
+ '/foot$/i' => 'feet',
+ '/child$/i' => 'children',
+ '/human$/i' => 'humans',
+ '/man$/i' => 'men',
+ '/tooth$/i' => 'teeth',
+ '/person$/i' => 'people',
+ '/([m|l])ouse$/i' => '\1ice',
'/(x|ch|ss|sh|us|as|is|os)$/i' => '\1es',
+ '/([^aeiouy]|qu)y$/i' => '\1ies',
'/(?:([^f])fe|([lr])f)$/i' => '\1\2ves',
- '/(m)an$/i' => '\1en',
- '/(child)$/i' => '\1ren',
- '/(r|t)y$/i' => '\1ies',
+ '/(shea|lea|loa|thie)f$/i' => '\1ves',
+ '/([ti])um$/i' => '\1a',
+ '/(tomat|potat|ech|her|vet)o$/i' => '\1oes',
+ '/(bu)s$/i' => '\1ses',
+ '/(ax|test)is$/i' => '\1es',
'/s$/' => 's',
);
foreach($rules as $rule=>$replacement)

0 comments on commit 56b931f

Please sign in to comment.