Return the plural of the given name. Override this and return the plural version of particular names
if this generic version isn't working for you.

@param string $strName
@return string
165265
protected function pluralize($strName)
    {
        // Special Rules go Here
        switch (true) {
            case (strtolower($strName) == 'play'):
                return $strName . 's';
        }

        $intLength = strlen($strName);
        if (substr($strName, $intLength - 1) == "y") {
            return substr($strName, 0, $intLength - 1) . "ies";
        }
        if (substr($strName, $intLength - 1) == "s") {
            return $strName . "es";
        }
        if (substr($strName, $intLength - 1) == "x") {
            return $strName . "es";
        }
        if (substr($strName, $intLength - 1) == "z") {
            return $strName . "zes";
        }
        if (substr($strName, $intLength - 2) == "sh") {
            return $strName . "es";
        }
        if (substr($strName, $intLength - 2) == "ch") {
            return $strName . "es";
        }

        return $strName . "s";
    }
136594
private static function getType($mode = 'strtolower', $plural = true)
    {
        $namespace = get_called_class();
        $class = explode('\\', $namespace);
        $complement = strtolower(array_pop($class) . ($plural ? 's' : ''));

        switch ($mode) {
            case 'ucfirst':
                return ucfirst($complement);
            case 'strtoupper':
                return strtoupper($complement);
            default:
                return $complement;
        }
    }
1271785
public function findReplaceName(
        string $singularFindName,
        string $singularReplaceName
    ): self {
        $singularFindName    = Inflector::classify($singularFindName);
        $singularReplaceName = Inflector::classify($singularReplaceName);
        $this->findReplace($singularFindName, $singularReplaceName);
        $this->findReplace(\lcfirst($singularFindName), \lcfirst($singularReplaceName));
        $this->findReplace(\strtoupper($singularFindName), \strtoupper($singularReplaceName));
        $this->findReplace(
            \strtoupper(Inflector::tableize($singularFindName)),
            \strtoupper(Inflector::tableize($singularReplaceName))
        );

        $pluralFindName    = $this->getPlural($singularFindName);
        $pluralReplaceName = $this->getPlural($singularReplaceName);
        $this->findReplace($pluralFindName, $pluralReplaceName);
        $this->findReplace(\lcfirst($pluralFindName), \lcfirst($pluralReplaceName));
        $this->findReplace(\strtoupper($pluralFindName), \strtoupper($pluralReplaceName));
        $this->findReplace(
            \strtoupper(Inflector::tableize($pluralFindName)),
            \strtoupper(Inflector::tableize($pluralReplaceName))
        );

        return $this;
    }
935364
public static function pluralize($word)
    {
        //Get the cached noun of it exists
        if(isset(self::$_cache['pluralized'][$word])) {
            return self::$_cache['pluralized'][$word];
        }

        //Create the plural noun
        if (in_array($word, self::$_rules['countable'])) {
            self::$_cache['pluralized'][$word] = $word;
            return $word;
        }

        foreach (self::$_rules['pluralization'] as $regexp => $replacement)
        {
            $matches = null;
            $plural = preg_replace($regexp, $replacement, $word, -1, $matches);
            if ($matches > 0) {
                self::$_cache['pluralized'][$word] = $plural;
                return $plural;
            }
        }

        return $word;
    }
172787
public static function pluralize($word) {
        foreach(self::$_exceptions as $exception) {
			if($exception['singular'] == $word){
				return $exception['plural'];
			}
        }

        return parent::pluralize($word);
	}
750897
public static function toRoman($num)
  {
    $num = (int)$num;
    switch($num){
      case 1:
        $roman = 'I';
        break;
      case 2:
        $roman = 'II';
        break;
      case 3:
        $roman = 'III';
        break;
      case 4:
        $roman = 'IV';
        break;
      case 5:
        $roman = 'V';
        break;
      case 6:
        $roman = 'VI';
        break;
      case 7:
        $roman = 'VII';
        break;
      case 8:
        $roman = 'VIII';
        break;
      case 9:
        $roman = 'IX';
        break;
      case 10:
        $roman = 'X';
        break;
      default:
        $roman = (string)$num;
        break;
    }
    
    return $roman;
  }
919507
private function getPluralForms()
    {
        // lets assume message number 0 is header
        // this is true, right?

        // cache header field for plural forms
        if (is_null($this->pluralequation)) {
            if (isset($this->cache_translations[''])) {
                $header = $this->cache_translations[''];
            } else {
                $header = '';
            }
            $expr = $this->extractPluralsForms($header);
            $this->pluralequation = $this->sanitizePluralExpression($expr);
            $this->pluralcount = $this->extractPluralCount($expr);
        }

        return $this->pluralequation;
    }
935067
public static function pluralize( $name )
    {
        /** @noinspection SpellCheckingInspection */
        static $_blacklist = array(
            'Amoyese',
            'bison',
            'Borghese',
            'bream',
            'breeches',
            'britches',
            'buffalo',
            'cantus',
            'carp',
            'chassis',
            'clippers',
            'cod',
            'coitus',
            'Congoese',
            'contretemps',
            'corps',
            'debris',
            'deer',
            'diabetes',
            'djinn',
            'eland',
            'elk',
            'equipment',
            'Faroese',
            'flounder',
            'Foochowese',
            'gallows',
            'Genevese',
            'geese',
            'Genoese',
            'Gilbertese',
            'graffiti',
            'headquarters',
            'herpes',
            'hijinks',
            'Hottentotese',
            'information',
            'innings',
            'jackanapes',
            'Kiplingese',
            'Kongoese',
            'Lucchese',
            'mackerel',
            'Maltese',
            '.*?media',
            'metadata',
            'mews',
            'moose',
            'mumps',
            'Nankingese',
            'news',
            'nexus',
            'Niasese',
            'Pekingese',
            'Piedmontese',
            'pincers',
            'Pistoiese',
            'pliers',
            'Portuguese',
            'proceedings',
            'rabies',
            'rice',
            'rhinoceros',
            'salmon',
            'Sarawakese',
            'scissors',
            'sea[- ]bass',
            'series',
            'Shavese',
            'shears',
            'siemens',
            'species',
            'swine',
            'testes',
            'trousers',
            'trout',
            'tuna',
            'Vermontese',
            'Wenchowese',
            'whiting',
            'wildebeest',
            'Yengeese',
        );
        /** @noinspection SpellCheckingInspection */
        static $_rules = array(
            '/(s)tatus$/i'                                                                 => '\1\2tatuses',
            '/(quiz)$/i'                                                                   => '\1zes',
            '/^(ox)$/i'                                                                    => '\1en',
            '/(matr|vert|ind)(ix|ex)$/i'                                                   => '\1ices',
            '/([m|l])ouse$/i'                                                              => '\1ice',
            '/(x|ch|ss|sh|us|as|is|os)$/i'                                                 => '\1es',
            '/(shea|lea|loa|thie)f$/i'                                                     => '\1ves',
            '/(buffal|tomat|potat|ech|her|vet)o$/i'                                        => '\1oes',
            '/([^aeiouy]|qu)ies$/i'                                                        => '\1y',
            '/([^aeiouy]|qu)y$/i'                                                          => '\1ies',
            '/(?:([^f])fe|([lre])f)$/i'                                                    => '\1\2ves',
            '/([ti])um$/i'                                                                 => '\1a',
            '/sis$/i'                                                                      => 'ses',
            '/move$/i'                                                                     => 'moves',
            '/foot$/i'                                                                     => 'feet',
            '/human$/i'                                                                    => 'humans',
            '/tooth$/i'                                                                    => 'teeth',
            '/(bu)s$/i'                                                                    => '\1ses',
            '/(hive)$/i'                                                                   => '\1s',
            '/(p)erson$/i'                                                                 => '\1eople',
            '/(m)an$/i'                                                                    => '\1en',
            '/(c)hild$/i'                                                                  => '\1hildren',
            '/(alumn|bacill|cact|foc|fung|nucle|octop|radi|stimul|syllab|termin|vir)us$/i' => '\1i',
            '/us$/i'                                                                       => 'uses',
            '/(alias)$/i'                                                                  => '\1es',
            '/(ax|cris|test)is$/i'                                                         => '\1es',
            '/s$/'                                                                         => 's',
            '/$/'                                                                          => 's',
        );

        if ( empty( $name ) || in_array( strtolower( $name ), $_blacklist ) )
        {
            return $name;
        }

        foreach ( $_rules as $_rule => $_replacement )
        {
            if ( preg_match( $_rule, $name ) )
            {
                return preg_replace( $_rule, $_replacement, $name );
            }
        }

        return $name;
    }
639541
public static function hasData($strName)
	{
		foreach ($GLOBALS['TL_CTP'] as $v)
		{
			foreach ($v as $kk=>$vv)
			{
				if ($kk == $strName)
				{
					return ($vv['data']) ?:false;
				}
			}
		}
		
		return null;
	}
975198
public function getName()
	{
		$strName = parent::getName();
		if (empty($strName)) {
			$strName = $this->__name = $this->__generateName();
		}

		return $strName;
	}
957759
public static function pluralize($string)
    {
        $specials = apply_filters('cuztom_plural', [
            ['/(quiz)$/i',               '$1zes'],
            ['/^(ox)$/i',                '$1en'],
            ['/([m|l])ouse$/i',          '$1ice'],
            ['/(matr|vert|ind)ix|ex$/i', '$1ices'],
            ['/(x|ch|ss|sh)$/i',         '$1es'],
            ['/([^aeiouy]|qu)y$/i',      '$1ies'],
            ['/([^aeiouy]|qu)ies$/i',    '$1y'],
            ['/(hive)$/i',               '$1s'],
            ['/(?:([^f])fe|([lr])f)$/i', '$1$2ves'],
            ['/sis$/i',                  'ses'],
            ['/([ti])um$/i',             '$1a'],
            ['/(buffal|tomat)o$/i',      '$1oes'],
            ['/(bu)s$/i',                '$1ses'],
            ['/(alias|status)$/i',       '$1es'],
            ['/(octop|vir)us$/i',        '$1i'],
            ['/(ax|test)is$/i',          '$1es'],
            ['/s$/i',                    's'],
            ['/$/',                      's'],
        ]);

        $irregular = apply_filters('cuztom_irregular', [
            ['move',   'moves'],
            ['sex',    'sexes'],
            ['child',  'children'],
            ['man',    'men'],
            ['person', 'people'],
        ]);

        $uncountable = apply_filters('cuztom_uncountable', [
            'sheep',
            'fish',
            'series',
            'species',
            'money',
            'rice',
            'information',
            'equipment',
            'pokemon',
        ]);

        // Save time if string in uncountable
        if (in_array(strtolower($string), $uncountable)) {
            return apply_filters('cuztom_pluralize', $string, 'uncountable');
        }

        // Check for irregular words
        foreach ($irregular as $noun) {
            if (strtolower($string) == $noun[0]) {
                return apply_filters('cuztom_pluralize', ucwords($noun[1]), 'irregular');
            }
        }

        // Check for plural forms
        foreach ($specials as $pattern) {
            if (preg_match($pattern[0], $string)) {
                return apply_filters(
                    'cuztom_pluralize',
                    ucwords(preg_replace($pattern[0], $pattern[1], $string)),
                    'special'
                );
            }
        }

        // Return if noting found
        return apply_filters('cuztom_pluralize', $string, null);
    }
1091125
public static function translate_plural($string, Translation $translation = null) {
		if ($translation !== null) {
			$translation = self::get($translation->language, $translation->application_name);
		} else {
			$translation = self::get();
		}

		return $translation->translate_string($string);
	}
1034027
public function pluralize ($word) {
		$word .= 's';
		$word = preg_replace ('/(x|ch|sh|ss])s$/', '\1es', $word);
		$word = preg_replace ('/ss$/', 'ses', $word);
		$word = preg_replace ('/([ti])ums$/', '\1a', $word);
		$word = preg_replace ('/sises$/', 'ses', $word);
		$word = preg_replace ('/([^aeiouy]|qu)ys$/', '\1ies', $word);
		$word = preg_replace ('/(?:([^f])fe|([lr])f)s$/', '\1\2ves', $word);
		$word = preg_replace ('/ieses$/', 'ies', $word);
		if (isset ($this->pleural_corrections[$word])) {
			return $this->pleural_corrections[$word];
		}
		return $word;
	}
494171
public function setName($strName)
    {
        parent::setName($strName);

        if (is_object($this->__validator)) {
            $this->__validator->setFieldName($strName);
        }
    }
171537
public function getGreeting($locale = null)
    {
        if (! $this->_getVar('user_greeting')) {
            $greeting[] = $this->getGenderGreeting($locale);

            if ($this->_getVar('user_last_name')) {
                $greeting[] = $this->_getVar('user_surname_prefix');
                $greeting[] = $this->_getVar('user_last_name');
            } else {
                $name = $this->getLoginName();
                if ($name) {
                    $name = substr($name, 0, 3) . str_repeat('*', strlen($name) - 2);
                    $greeting[] = $name;
                }
            }
            array_filter($greeting);

            $this->_setVar('user_greeting', implode(' ', $greeting));
        }

        return $this->_getVar('user_greeting');
    }
45799
protected function getNameForLocale($locale, &$names)
    {
        if (isset($names[$locale][1])) {
            $name = $names[$locale][1];
            unset($names[$locale][1]);
        } elseif (isset($names[$locale][4])) {
            $name = $names[$locale][4];
            unset($names[$locale][4]);
        } else {
            $name = array_shift($names[$locale]);
        }

        return $name;
    }
468857
public static function getTime($strName = 'default')
    {
        $objTimer = static::getTimerInstance($strName, false);
        if ($objTimer) {
            return $objTimer->getTimerTime();
        } else {
            throw new Caller('Timer with name ' . $strName . ' was not started, cannot get its value');
        }
    }