public function translateChoice($id, $number, array $parameters = array(), $locale = null) {
        if (null === $locale) {
            $locale = $this->getLocale();
        } else {
            $this->assertValidLocale($locale);
        }
        //Get the translations
        $translations = $this->getTranslation($locale);

        //Calculate the translation and replace the parameters
        return strtr($this->getTranslationForId($id, $translations, $number), $parameters);
    }
public function translateChoice($id, $number, array $parameters = array(), $locale = null) {
        if (null === $locale) {
            $locale = $this->getLocale();
        } else {
            $this->assertValidLocale($locale);
        }
        //Get the translations
        $translations = $this->getTranslation($locale);

        //Calculate the translation and replace the parameters
        return strtr($this->getTranslationForId($id, $translations, $number), $parameters);
    }
public function translateChoice ( $ id , $ number , array $ parameters = array ( ) , $ locale = null ) { if ( null === $ locale ) { $ locale = $ this -> getLocale ( ) ; } else { $ this -> assertValidLocale ( $ locale ) ; } //Get the translations $ translations = $ this -> getTranslation ( $ locale ) ; //Calculate the translation and replace the parameters return strtr ( $ this -> getTranslationForId ( $ id , $ translations , $ number ) , $ parameters ) ; }
Translates the given choice message by choosing a translation according to a number.

@param string      $id         The message id (may also be an object that can be cast to string)
@param int         $number     The number to use to find the indice of the message
@param array       $parameters An array of parameters for the message
@param string|null $locale     The locale or null to use the default

@throws \InvalidArgumentException If the locale contains invalid characters

@return string The translated string
Translates the given choice message by choosing a translation according to a number .