src/Translator.php
private function selectString($n)
    {
        if (is_null($this->pluralexpression)) {
            $this->pluralexpression = new ExpressionLanguage();
        }
        try {
            $plural = $this->pluralexpression->evaluate(
                $this->getPluralForms(),
                ['n' => $n]
            );
        } catch (\Exception $e) {
            $plural = 0;
        }

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

        return $plural;
    }
private function selectString($n)
    {
        if (is_null($this->pluralexpression)) {
            $this->pluralexpression = new ExpressionLanguage();
        }
        try {
            $plural = $this->pluralexpression->evaluate(
                $this->getPluralForms(),
                ['n' => $n]
            );
        } catch (\Exception $e) {
            $plural = 0;
        }

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

        return $plural;
    }
private function selectString ( $ n ) { if ( is_null ( $ this -> pluralexpression ) ) { $ this -> pluralexpression = new ExpressionLanguage ( ) ; } try { $ plural = $ this -> pluralexpression -> evaluate ( $ this -> getPluralForms ( ) , [ 'n' => $ n ] ) ; } catch ( \ Exception $ e ) { $ plural = 0 ; } if ( $ plural >= $ this -> pluralcount ) { $ plural = $ this -> pluralcount - 1 ; } return $ plural ; }
Detects which plural form to take.

@param int $n count of objects

@return int array index of the right plural form
Detects which plural form to take .