public function choose($line, $number, $locale)
    {
        $segments = explode('|', $line);

        if (($value = $this->extract($segments, $number)) !== null) {
            return trim($value);
        }

        $segments = $this->stripConditions($segments);

        $pluralIndex = $this->getPluralIndex($locale, $number);

        if (count($segments) === 1 || ! isset($segments[$pluralIndex])) {
            return $segments[0];
        }

        return $segments[$pluralIndex];
    }
public function choose($line, $number, $locale)
    {
        $segments = explode('|', $line);

        if (($value = $this->extract($segments, $number)) !== null) {
            return trim($value);
        }

        $segments = $this->stripConditions($segments);

        $pluralIndex = $this->getPluralIndex($locale, $number);

        if (count($segments) === 1 || ! isset($segments[$pluralIndex])) {
            return $segments[0];
        }

        return $segments[$pluralIndex];
    }
public function choose ( $ line , $ number , $ locale ) { $ segments = explode ( '|' , $ line ) ; if ( ( $ value = $ this -> extract ( $ segments , $ number ) ) !== null ) { return trim ( $ value ) ; } $ segments = $ this -> stripConditions ( $ segments ) ; $ pluralIndex = $ this -> getPluralIndex ( $ locale , $ number ) ; if ( count ( $ segments ) === 1 || ! isset ( $ segments [ $ pluralIndex ] ) ) { return $ segments [ 0 ] ; } return $ segments [ $ pluralIndex ] ; }
Select a proper translation string based on the given number.

@param  string  $line
@param  int  $number
@param  string  $locale
@return mixed
Select a proper translation string based on the given number .