public function Translator::transChoice in Plug 7
@api
Overrides TranslatorInterface::transChoice
File
- lib/
Symfony/ translation/ Translator.php, line 237
Class
- Translator
- Translator.
Namespace
Symfony\Component\TranslationCode
public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null) {
if (null === $domain) {
$domain = 'messages';
}
$id = (string) $id;
$catalogue = $this
->getCatalogue($locale);
$locale = $catalogue
->getLocale();
while (!$catalogue
->defines($id, $domain)) {
if ($cat = $catalogue
->getFallbackCatalogue()) {
$catalogue = $cat;
$locale = $catalogue
->getLocale();
}
else {
break;
}
}
return strtr($this->selector
->choose($catalogue
->get($id, $domain), (int) $number, $locale), $parameters);
}