From 183537db39838c3335ea9224c0fc8848435878dc Mon Sep 17 00:00:00 2001 From: naomi Date: Sun, 5 Jun 2022 15:49:27 +0100 Subject: [PATCH] pluraliser ignores selected words e,g, "staff" --- src/Pluraliser.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Pluraliser.php b/src/Pluraliser.php index 35ba94f..9f3dcd0 100644 --- a/src/Pluraliser.php +++ b/src/Pluraliser.php @@ -2,8 +2,14 @@ namespace Drupal\opencase; + class Pluraliser { + const NO_CHANGE = ['Staff']; public static function pluralise($text) { - return $text . "s"; + if (in_array($text, self::NO_CHANGE)) { + return $text; + } else { + return $text . "s"; + } } } \ No newline at end of file