Plural version of gettext.

@param string $singular
@param string $plural
@param int $count
@return string
424868
public function ngettext($singular, $plural, $count) {
		if ($this->reader === null) {
			return $count > 1 ? $plural : $singular;
		}
		return $this->reader->ngettext((string)$singular, (string)$plural, $count);
	}
1281029
public static function pluralise($iValue, $sSingular, $sSpecified = null)
    {
        $sSingular = trim($sSingular);

        if ($iValue == 1) {
            return $sSingular;
        } else {
            return $sSpecified ?: plural($sSingular);
        }
    }
668872
public function getPluralSuffixes($count)
	{
		if ($this->callbacks['pluralSuffixes'] !== null)
		{
			return call_user_func($this->callbacks['pluralSuffixes'], $count);
		}
		else
		{
			return array((string) $count);
		}
	}
1051323
public function translatePlural( $singular,
                                     $plural,
                                     $number,
                                     $textDomain = self::DEFAULT_TEXT_DOMAIN,
                                     $locale     = null )
    {
        return $this->getTranslator()
                    ->translatePlural( $singular, $plural, $number,
                                       $textDomain, $locale );
    }
1236789
public static function addWord($singular, $plural, $verbal = null)
    {
        self::$_cache['pluralized'][$singular] = $plural;
        self::$_cache['singularized'][$plural] = $singular;
        
        self::$_cache['singularized'][$singular] = $singular;
        self::$_cache['pluralized'][$plural] = $plural;
        
        if (isset($verbal)) {
            self::$_cache['verbalized'][$singular] = $verbal;
            self::$_cache['verbalized'][$plura] = $verbal;
        }
    }
700786
public static function getWords($sentence, $count = 10) {
        $sentence = str_replace("\r", '', str_replace("\n", '', trim(strip_tags($sentence))));
        $words = explode(' ', $sentence);

        if (count($words) <= $count) {
            return $sentence;
        }

        $trimmed = '';
        for ($i = 0; $i < $count; $i++) {
            $trimmed .= $words[$i] . ' ';
        }

        $trimmed = trim($trimmed);

        return $trimmed;
    }
123476
public function getPluralSuffixes($count)
	{
		if ($this->pluralSuffixesCallback !== null)
		{
			return call_user_func($this->pluralSuffixesCallback, $count);
		}
		else
		{
			return array((string) $count);
		}
	}
626346
public function ngettext($single, $plural, $number, &$num) {
        if ($this->short_circuit) {
            if ($number != 1)
                return $plural;
            else
                return $single;
        }

        // find out the appropriate form
        $select = $this->select_string($number);

        // this should contains all strings separated by NULLs
        $key = $single . chr(0) . $plural;


        if ($this->enable_cache) {
            if (!array_key_exists($key, $this->cache_translations)) {
                return ($number != 1) ? $plural : $single;
            }
            else {
                $result = $this->cache_translations[$key];
                $list = explode(chr(0), $result);
                return $list[$select];
            }
        }
        else {
            $num = $this->find_string($key);
            if ($num == -1) {
                return ($number != 1) ? $plural : $single;
            }
            else {
                $result = $this->get_translation_string($num);
                $list = explode(chr(0), $result);
                return $list[$select];
            }
        }
    }
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);
    }
1213079
public function ngettext($single, $plural, $number) {
        $count = 0;
        foreach ($this->handles as $handle) {
            $string = $handle->ngettext($single, $plural, $number, $count);
            if (-1 != $count) {
                break;
            }
        }

        return $string;
    }
795348
public static function plural($string)
    {
        $result = $string;
        foreach (self::$_plural as $rule => $replacement) {
            $rule = self::_normalize($rule);
            if (preg_match($rule, $string)) {
                $result = preg_replace($rule, $replacement, $string);
                break;
            }
        }
        return $result;
    }
335674
def pluralize(singular):
    
    if singular in UNCOUNTABLES:
        return singular
    for i in IRREGULAR:
        if i[0] == singular:
            return i[1]
    for i in PLURALIZE_PATTERNS:
        if re.search(i[0], singular):
            return re.sub(i[0], i[1], singular)
1027432
public function dnpgettext($domain, $context, $original, $plural, $value)
    {
        $translation = $this->getTranslation($domain, $context, $original);
        $key = $this->getPluralIndex($domain, $value, $translation === false);

        if (isset($translation[$key]) && $translation[$key] !== '') {
            return $translation[$key];
        }

        return ($key === 0) ? $original : $plural;
    }
10671
public function inflect(string $string, $pluralize = 0) : string
    {
        return ($pluralize) ? Inflect::pluralize($string) : Inflect::singularize($string);
    }
239664
public function toPlural(Pluralizer $pluralizer = null) {
		$pluralizer = $pluralizer ?: new EnglishPluralizer();

		return new Text($pluralizer->getPluralForm($this->string), $this->encoding);
	}
268970
protected function getPluralIndex(callable $pluralForm, $number)
    {
        $nplurals = 0;
        $plural = 0;

        call_user_func_array($pluralForm, [&$nplurals, &$plural, $number]);

        if (is_bool($plural)) {
            $plural = $plural ? 1 : 0;
        }

        if ($plural < 0) {
            $plural = 0;
        }

        if ($plural > $nplurals - 1) {
            $plural = $nplurals - 1;
        }

        return $plural;
    }
1155907
public function sp($singular, $plural, $count, $autoTranslate = false) {
		if ((int)$count !== 1) {
			$result = $plural;
		} else {
			$result = $singular;
		}

		if ($autoTranslate) {
			$result = __($result);
		}
		return $result;
	}