4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Translation
;
15 * IdentityTranslator does not translate anything.
17 * @author Fabien Potencier <fabien@symfony.com>
21 class IdentityTranslator
implements TranslatorInterface
28 * @param MessageSelector $selector The message selector for pluralization
32 public function __construct(MessageSelector
$selector)
34 $this->selector
= $selector;
42 public function setLocale($locale)
51 public function getLocale()
60 public function trans($id, array $parameters = array(), $domain = 'messages', $locale = null)
62 return strtr((string) $id, $parameters);
70 public function transChoice($id, $number, array $parameters = array(), $domain = 'messages', $locale = null)
72 return strtr($this->selector
->choose((string) $id, (int) $number, $locale), $parameters);