Skip to content

Commit

Permalink
Merge pull request #1786 from nsanden/1716-pluralize-case
Browse files Browse the repository at this point in the history
#1716 pluralize() maintain upper case on first word
  • Loading branch information
samdark committed Dec 1, 2012
2 parents 2b9996c + 523a49f commit 35d8088
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Version 1.1.13 work in progress
- Bug #1652: Fixed incorrect syntax of CDbSchema::renameTable() for SQLite, added CSqliteSchema::renameTable() method (Sarke)
- Bug #1673: CHttpRequest::getPreferredLanguage now works according to RFC2616. Added CHttpRequest::getPreferredLanguages that returns all user accepted languages in order of preference (Rupert-RR, bwoester, cebe, samdark)
- Bug #1676: Fixed listData() grouping when no group was specified (mdomba)
- Bug #1716: Fixed CCodeModel::pluralize() and CConsoleCommand::pluralize() so it doesn't force lowercase the first letter in any words (nsanden)
- Bug #1726: Fixed the error Undefined variable: json in CJSON.php when json_decode function did not exist (heyhoo)
- Bug: Table schema is refreshed on Gii model generation when schemaCachingDuration is used (SonkoDmitry)
- Bug: CDbCommand::setFetchMode wasn't accepting additional arguments needed for PDO::FETCH_CLASS (samdark)
Expand Down
14 changes: 7 additions & 7 deletions framework/console/CConsoleCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -489,13 +489,13 @@ public function renderFile($_viewFile_,$_data_=null,$_return_=false)
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)ove$/i' => '\1oves',
'/(f)oot$/i' => '\1eet',
'/(c)hild$/i' => '\1hildren',
'/(h)uman$/i' => '\1umans',
'/(m)an$/i' => '\1en',
'/(t)ooth$/i' => '\1eeth',
'/(p)erson$/i' => '\1eople',
'/([m|l])ouse$/i' => '\1ice',
'/(x|ch|ss|sh|us|as|is|os)$/i' => '\1es',
'/([^aeiouy]|qu)y$/i' => '\1ies',
Expand Down
14 changes: 7 additions & 7 deletions framework/gii/CCodeModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,13 +404,13 @@ 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)ove$/i' => '\1oves',
'/(f)oot$/i' => '\1eet',
'/(c)hild$/i' => '\1hildren',
'/(h)uman$/i' => '\1umans',
'/(m)an$/i' => '\1en',
'/(t)ooth$/i' => '\1eeth',
'/(p)erson$/i' => '\1eople',
'/([m|l])ouse$/i' => '\1ice',
'/(x|ch|ss|sh|us|as|is|os)$/i' => '\1es',
'/([^aeiouy]|qu)y$/i' => '\1ies',
Expand Down

0 comments on commit 35d8088

Please sign in to comment.