From 41e70551930c47b0f77a91c957d72b6215012dcb Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 23 Jan 2013 18:59:39 +0100 Subject: [PATCH] updated StringHelper plural rules intregrated updates from version 1.1 --- framework/util/StringHelper.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/framework/util/StringHelper.php b/framework/util/StringHelper.php index 1c2c736..d5b8974 100644 --- a/framework/util/StringHelper.php +++ b/framework/util/StringHelper.php @@ -28,13 +28,14 @@ class StringHelper public static 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', + '/(s)taff$/i' => '\1taff', + '/(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',