X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FString.php;h=7c0897436508acb9f83c494f343981706c3b235c;hb=d6ec1535f89c868fecc6cbbf221fe1abce1eec16;hp=654b74ff0ebcb41cbd4c28162935265021dbebe0;hpb=4a00ebd175e4819197ddec91312675c58b25096a;p=civicrm-core.git diff --git a/CRM/Utils/String.php b/CRM/Utils/String.php index 654b74ff0e..7c08974365 100644 --- a/CRM/Utils/String.php +++ b/CRM/Utils/String.php @@ -941,10 +941,10 @@ class CRM_Utils_String { public static function pluralize($str) { $lastLetter = substr($str, -1); $lastTwo = substr($str, -2); - if ($lastLetter == 's' || $lastTwo == 'ch') { + if ($lastLetter == 's' || $lastLetter == 'x' || $lastTwo == 'ch') { return $str . 'es'; } - if ($lastLetter == 'y' && $lastTwo != 'ey') { + if ($lastLetter == 'y' && !in_array($lastTwo, ['ay', 'ey', 'iy', 'oy', 'uy'])) { return substr($str, 0, -1) . 'ies'; } return $str . 's';