From e8b2a7143d1b42ef03067b87f58d6758aa5a0bec Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 7 Jul 2020 19:54:21 -0400 Subject: [PATCH] GenCode - Fix pluralization of words ending in x --- CRM/Utils/String.php | 2 +- ang/api4Explorer/Explorer.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Utils/String.php b/CRM/Utils/String.php index 654b74ff0e..8ffc390096 100644 --- a/CRM/Utils/String.php +++ b/CRM/Utils/String.php @@ -941,7 +941,7 @@ 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') { diff --git a/ang/api4Explorer/Explorer.js b/ang/api4Explorer/Explorer.js index 653ee7bd8f..f07c22958a 100644 --- a/ang/api4Explorer/Explorer.js +++ b/ang/api4Explorer/Explorer.js @@ -96,7 +96,7 @@ function pluralize(str) { var lastLetter = str[str.length - 1], lastTwo = str[str.length - 2] + lastLetter; - if (lastLetter === 's' || lastTwo === 'ch') { + if (lastLetter === 's' || lastLetter === 'x' || lastTwo === 'ch') { return str + 'es'; } if (lastLetter === 'y' && lastTwo !== 'ey') { -- 2.25.1