Gets an inflected word from the cache where the singular form is supplied.

@param   string $singular A singular form of a word.

@return  mixed  The cached inflection or false if none found.

@since   2.0
551068
private function getCachedPlural($singular)
    {
        $singular = Utf8String::strtolower($singular);

        // Check if the word is in cache.
        if (isset($this->cache[$singular])) {
            return $this->cache[$singular];
        }

        return false;
    }
1317517
public function getPlural()
    {
        $singular = $this->getSingular();
        if (preg_match('/y$/', $singular)) {
            return preg_replace('/y$/', 'ies', $singular);
        }
        return (is_null($this->plural))
            ? Str::human($singular) . 's'
            : $this->plural;
    }
1129205
public static function pluralise( $string ) {

		// save some time in the case that singular and plural are the same
		if ( in_array( mb_strtolower( $string ), self::$uncountable ) )
			return $string;


		// check for irregular singular forms
		foreach ( self::$irregular as $pattern => $result )
		{
			$pattern = '/' . $pattern . '$/iu';

			if ( preg_match( $pattern, $string ) )
				return preg_replace( $pattern, $result, $string);
		}

		// check for matches using regular expressions
		foreach ( self::$plural as $pattern => $result )
		{
			if ( preg_match( $pattern, $string ) )
				return preg_replace( $pattern, $result, $string );
		}

		return $string;

	}
883461
public static function singularise($word)
    {
        // Run each rule over the word
        foreach (static::$singularRules as $rule => $replacement) {
            if (preg_match($rule, $word)) {
                return preg_replace($rule, $replacement, $word);
            }
        }

        return $word;
    }
386233
public function toPlural($word)
    {
        // Try to get the cached plural form from the singular.
        $cache = $this->getCachedPlural($word);

        if ($cache !== false) {
            return $cache;
        }

        // Check if the word is a known singular.
        if ($this->getCachedSingular($word)) {
            return false;
        }

        // Compute the inflection.
        $inflected = $this->matchRegexRule($word, 'plural');

        if ($inflected !== false) {
            $this->setCache($word, $inflected);

            return $inflected;
        }

        return false;
    }
762860
public static function singular($string)
    {
        $result = $string;
        foreach (self::$_singular as $rule => $replacement) {
            $rule = self::_normalize($rule);
            if (preg_match($rule, $string)) {
                $result = preg_replace($rule, $replacement, $string);
                break;
            }
        }
        return $result;
    }
1281029
public static function pluralise($iValue, $sSingular, $sSpecified = null)
    {
        $sSingular = trim($sSingular);

        if ($iValue == 1) {
            return $sSingular;
        } else {
            return $sSpecified ?: plural($sSingular);
        }
    }
867997
public function singular($value)
        {
            // First we'll check the cache of inflected values. We cache each word that
            // is inflected so we don't have to spin through the regular expressions
            // each time we need to inflect a given value for the developer.
            if (isset($this->singular[$value])) {
                return $this->singular[$value];
            }

            // English words may be automatically inflected using regular expressions.
            // If the word is English, we'll just pass off the word to the automatic
            // inflection method and return the result, which is cached.
            $irregular = $this->config['irregular'];

            $result = $this->auto($value, $this->config['singular'], $irregular);

            return $this->singular[$value] = $result ?: $value;
        }
491648
public static function pluralize( $word ) {
		if ( isset( self::$cache['pluralize'][ $word ] ) ) {
			return self::$cache['pluralize'][ $word ];
		}

		if ( ! isset( self::$plural['merged']['irregular'] ) ) {
			self::$plural['merged']['irregular'] = self::$plural['irregular'];
		}

		if ( ! isset( self::$plural['merged']['uninflected'] ) ) {
			self::$plural['merged']['uninflected'] = array_merge( self::$plural['uninflected'], self::$uninflected );
		}

		if ( ! isset( self::$plural['cacheUninflected'] ) || ! isset( self::$plural['cacheIrregular'] ) ) {
			self::$plural['cacheUninflected'] = '(?:' . implode( '|', self::$plural['merged']['uninflected'] ) . ')';
			self::$plural['cacheIrregular']   = '(?:' . implode( '|', array_keys( self::$plural['merged']['irregular'] ) ) . ')';
		}

		if ( preg_match( '/(.*)\\b(' . self::$plural['cacheIrregular'] . ')$/i', $word, $regs ) ) {
			self::$cache['pluralize'][ $word ] = $regs[1] . substr( $word, 0, 1 ) . substr( self::$plural['merged']['irregular'][ strtolower( $regs[2] ) ], 1 );

			return self::$cache['pluralize'][ $word ];
		}

		if ( preg_match( '/^(' . self::$plural['cacheUninflected'] . ')$/i', $word, $regs ) ) {
			self::$cache['pluralize'][ $word ] = $word;

			return $word;
		}

		foreach ( self::$plural['rules'] as $rule => $replacement ) {
			if ( preg_match( $rule, $word ) ) {
				self::$cache['pluralize'][ $word ] = preg_replace( $rule, $replacement, $word );

				return self::$cache['pluralize'][ $word ];
			}
		}
	}
767488
public function translatePlural(
        $singular,
        $plural,
        $number,
        $textDomain = 'default',
        $locale = null
    )
    {
        $textDomain = $textDomain !== 'default' ? $textDomain : $this->domain();
        $locale = $locale ?: (string) $this->currentLanguage();

        return $this->translationService()->translatePlural($singular, $plural, $number, $textDomain, $locale);
    }
987648
public static function encode_plurals($plurals)
    {
        // Validate against global plural list
        $forms = i18n::config()->uninherited('plurals');
        $forms = array_combine($forms, $forms);
        $intersect = array_intersect_key($plurals, $forms);
        if ($intersect) {
            return implode('|', $intersect);
        }
        return null;
    }
1268739
public static function inflector(string $name, bool $pluralize = true): string
    {
        $name = Inflector::tableize($name);

        return $pluralize ? Inflector::pluralize($name) : $name;
    }
626526
public function plural($value, $count = 2)
        {
            if ((int) $count == 1) return $value;

            // First we'll check the cache of inflected values. We cache each word that
            // is inflected so we don't have to spin through the regular expressions
            // each time we need to inflect a given value for the developer.
            if (isset($this->plural[$value])) {
                return $this->plural[$value];
            }

            // English words may be automatically inflected using regular expressions.
            // If the word is English, we'll just pass off the word to the automatic
            // inflection method and return the result, which is cached.
            $irregular = array_flip($this->config['irregular']);

            $result = $this->auto($value, $this->config['plural'], $irregular);

            return $this->plural[$value] = $result;
        }
383562
public function gettext_select_plural_form($count)
    {
        if (!isset($this->_gettext_select_plural_form)
            || is_null($this->_gettext_select_plural_form)) {
            list($nplurals, $expression) = $this->nplurals_and_expression_from_header($this->get_header('Plural-Forms'));
            $this->_nplurals = $nplurals;
            $this->_gettext_select_plural_form = $this->make_plural_form_function($nplurals, $expression);
        }

        return call_user_func($this->_gettext_select_plural_form, $count);
    }
1251608
public function get(string $alias = null)
    {
        if (is_null($alias)) {
            return $this->aliases;
        }

        return $this->has($alias) ? $this->aliases[$alias] : false;
    }
513269
protected function getLangContent($singular, $plural, $feminine)
    {
        if (!$stub = $this->getLangStub()) {
            return '';
        }

        $lcfSingular     = lcfirst($singular);
        $lcfPlural       = lcfirst($plural);
        $startsWithVowel = starts_with($lcfSingular, ['a', 'e', 'i', 'o', 'u']);
        $lcfDefArticle   = ($startsWithVowel ? "l’" : ($feminine ? 'la ' : 'le '));
        $ucfDefArticle   = ucfirst($lcfDefArticle);
        $lcfUndefArticle = ($feminine ? 'une' : 'un');

        return strtr($stub, [
            '{{storeSuccess}}'     => "{$ucfDefArticle}$lcfSingular a été ".($feminine ? 'créée' : 'créé')." avec succès.",
            '{{updateSuccess}}'    => "{$ucfDefArticle}$lcfSingular a été ".($feminine ? 'mise' : 'mis')." à jour avec succès.",
            '{{enableSuccess}}'    => "{$ucfDefArticle}$lcfSingular a été ".($feminine ? 'activée' : 'activé')." avec succès.",
            '{{disableSuccess}}'   => "{$ucfDefArticle}$lcfSingular a été ".($feminine ? 'désactivée' : 'désactivé')." avec succès.",
            '{{sortSuccess}}'      => "L’ordre des $lcfPlural a été modifié avec succès.",
            '{{destroySuccess}}'   => "{$ucfDefArticle}$lcfSingular a été ".($feminine ? 'supprimée' : 'supprimé')." avec succès.",
            '{{destroyFailure}}'   => "Suppression impossible : {$lcfDefArticle}$lcfSingular est peut-être ".($feminine ? 'liée' : 'lié')." à d’autres enregistrements.",
            '{{countZero}}'        => ($feminine ? 'aucune' : 'aucun')." $singular",
            '{{countOne}}'         => "$lcfUndefArticle $singular",
            '{{countMany}}'        => ":count $plural",
            '{{breadcrumbsIndex}}' => ucfirst($lcfPlural),
            '{{listTitle}}'        => "Liste des $lcfPlural",
            '{{listSummary}}'      => "Liste des :count $lcfPlural de <strong>:firstItem à :lastItem</strong> sur un total de :total.",
            '{{listSummarySimple}}'=> ":count $lcfPlural de <strong>:firstItem à :lastItem</strong> sur :total",
            '{{statusActive}}'     => ($feminine ? trans('common::status.active_fem') : trans('common::status.active')),
            '{{statusInactive}}'   => ($feminine ? trans('common::status.inactive_fem') : trans('common::status.inactive')),
            '{{listEmpty}}'        => "Il n’y a ".($feminine ? 'aucune' : 'aucun')." $lcfSingular à afficher.",
            '{{createButton}}'     => ($feminine ? 'Nouvelle' : ($startsWithVowel ? 'Nouvel' : 'Nouveau'))." $lcfSingular",
            '{{editTooltip}}'      => "Modifier {$lcfDefArticle}$lcfSingular «&nbsp;:name&nbsp;».",
            '{{enableTooltip}}'    => "Activer {$lcfDefArticle}$lcfSingular «&nbsp;:name&nbsp;».",
            '{{disableTooltip}}'   => "Désactiver {$lcfDefArticle}$lcfSingular «&nbsp;:name&nbsp;».",
            '{{destroyTooltip}}'   => "Supprimer {$lcfDefArticle}$lcfSingular «&nbsp;:name&nbsp;».",
            '{{destroyConfirm}}'   => "Êtes-vous sûr de vouloir supprimer {$lcfDefArticle}$lcfSingular «&nbsp;:name&nbsp;»&nbsp;?",
            '{{createTitle}}'      => "Création d’{$lcfUndefArticle} ".($feminine ? 'nouvelle' : ($startsWithVowel ? 'nouvel' : 'nouveau'))." $lcfSingular",
            '{{createFormTitle}}'  => ($feminine ? 'Nouvelle' : ($startsWithVowel ? 'Nouvel' : 'Nouveau'))." $lcfSingular",
            '{{editTitle}}'        => "Modification d’{$lcfUndefArticle} $lcfSingular",
            '{{editFormTitle}}'    => "Modification d’{$lcfUndefArticle} $lcfSingular",
        ]);
    }
183364
public static function pluralize($input) {
		if (self::$pluralizer === null) {
			self::$pluralizer = new StandardEnglishSingularizer();
		}

		return self::$pluralizer->getPluralForm($input);
	}