src/IntlService.php
public function _n($textSingular, $textPlural, $number, $replacements = null, $locale = null)
    {
        if (!$locale) {
            $locale = $this->getLocale();
        }

        if ($this->translator !== null) {
            $text = $this->translator->translatePlurals($textSingular, $textPlural, $number, $locale);
        } else {
            $text = $number == 1 ? $textSingular : $textPlural;
        }

        return $this->replace($text, $replacements);
    }
public function _n($textSingular, $textPlural, $number, $replacements = null, $locale = null)
    {
        if (!$locale) {
            $locale = $this->getLocale();
        }

        if ($this->translator !== null) {
            $text = $this->translator->translatePlurals($textSingular, $textPlural, $number, $locale);
        } else {
            $text = $number == 1 ? $textSingular : $textPlural;
        }

        return $this->replace($text, $replacements);
    }
public function _n ( $ textSingular , $ textPlural , $ number , $ replacements = null , $ locale = null ) { if ( ! $ locale ) { $ locale = $ this -> getLocale ( ) ; } if ( $ this -> translator !== null ) { $ text = $ this -> translator -> translatePlurals ( $ textSingular , $ textPlural , $ number , $ locale ) ; } else { $ text = $ number == 1 ? $ textSingular : $ textPlural ; } return $ this -> replace ( $ text , $ replacements ) ; }
Translate the given text based on the given number.

@param string     $textSingular The text in its singular form.
@param string     $textPlural   The text in its plural form.
@param int        $number       The number.
@param array|null $replacements Values that should be replaced.
@param string     $locale       The locale or null to use the current locale.

@return string Translated text or given text if no translation found.
Translate the given text based on the given number .